[Bleeding] Use proper teleport reason for /tp command. Fixes BUKKIT-5348

Previously, when calling the /tp command with coordinates, no TeleportCause
was passed, causing the resulting PlayerTeleportEvent to be called with
TeleportCause.PLUGIN instead of TeleportCause.COMMAND. This commit adds the
missing TeleportCause to ensure that the resulting PlayerTeleportEvent
reports the correct TeleportCause.
This commit is contained in:
GJ
2014-02-04 12:44:25 -05:00
committed by Travis Watkins
parent 8652e1ff28
commit 8f42f10cb9

View File

@@ -71,7 +71,7 @@ public class TeleportCommand extends VanillaCommand {
playerLocation.setY(y); playerLocation.setY(y);
playerLocation.setZ(z); playerLocation.setZ(z);
player.teleport(playerLocation); player.teleport(playerLocation, TeleportCause.COMMAND);
Command.broadcastCommandMessage(sender, String.format("Teleported %s to %.2f, %.2f, %.2f", player.getDisplayName(), x, y, z)); Command.broadcastCommandMessage(sender, String.format("Teleported %s to %.2f, %.2f, %.2f", player.getDisplayName(), x, y, z));
} }
return true; return true;