Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ else if (src instanceof CommandBlockSource)
@Nonnull
@Override
public String[] getAliases() {
return new String[] { "tpaaccept", "tpaccept" };
return new String[] { "tpaaccept", "tpaccept", "tpyes" };
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ else if (src instanceof CommandBlockSource)
@Nonnull
@Override
public String[] getAliases() {
return new String[] { "tpadeny", "tpdeny" };
return new String[] { "tpadeny", "tpdeny", "tpno" };
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import io.github.hsyyid.essentialcmds.EssentialCmds;
import io.github.hsyyid.essentialcmds.utils.AFK;
import io.github.hsyyid.essentialcmds.utils.Utils;

import org.spongepowered.api.data.key.Keys;
import org.spongepowered.api.entity.living.player.Player;
import org.spongepowered.api.event.Listener;
Expand All @@ -42,7 +43,9 @@ public class PlayerMoveListener
@Listener
public void onPlayerMove(DisplaceEntityEvent event, @First Player player)
{
if (Utils.isTeleportCooldownEnabled() && EssentialCmds.teleportingPlayers.contains(player.getUniqueId()))
double dist = event.getFromTransform().getLocation().getPosition().distance(event.getToTransform().getLocation().getPosition());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should always use distanceSquared where possible


if (Utils.isTeleportCooldownEnabled() && EssentialCmds.teleportingPlayers.contains(player.getUniqueId()) && dist > 0)
{
EssentialCmds.teleportingPlayers.remove(player.getUniqueId());
player.sendMessage(Text.of(TextColors.RED, "Teleportation canceled due to movement."));
Expand Down