Commits

GJ authored and Travis Watkins committed e02ea29e311
[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.
No tags

src/main/java/org/bukkit/command/defaults/TeleportCommand.java

Modified
64 64
65 65 if (x == MIN_COORD_MINUS_ONE || y == MIN_COORD_MINUS_ONE || z == MIN_COORD_MINUS_ONE) {
66 66 sender.sendMessage("Please provide a valid location!");
67 67 return true;
68 68 }
69 69
70 70 playerLocation.setX(x);
71 71 playerLocation.setY(y);
72 72 playerLocation.setZ(z);
73 73
74 - player.teleport(playerLocation);
74 + player.teleport(playerLocation, TeleportCause.COMMAND);
75 75 Command.broadcastCommandMessage(sender, String.format("Teleported %s to %.2f, %.2f, %.2f", player.getDisplayName(), x, y, z));
76 76 }
77 77 return true;
78 78 }
79 79
80 80 private double getCoordinate(CommandSender sender, double current, String input) {
81 81 return getCoordinate(sender, current, input, MIN_COORD, MAX_COORD);
82 82 }
83 83
84 84 private double getCoordinate(CommandSender sender, double current, String input, int min, int max) {

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut