Skip to content

Added distance check to PlayerMove listener for warp teleportation.#103

Open
FabioZumbi12 wants to merge 2 commits into
hsyyid:masterfrom
FabioZumbi12:dev
Open

Added distance check to PlayerMove listener for warp teleportation.#103
FabioZumbi12 wants to merge 2 commits into
hsyyid:masterfrom
FabioZumbi12:dev

Conversation

@FabioZumbi12
Copy link
Copy Markdown
Contributor

No description provided.

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

@MarkTwoFive
Copy link
Copy Markdown

FYI: DisplaceEntityEvent.Teleport does work in some of the latest Sponge builds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants