SPIGOT-1788: Correctly teleport the player back to their old location

By: Thinkofdeath <thinkofdeath@spigotmc.org>
This commit is contained in:
CraftBukkit/Spigot 2016-03-06 22:17:32 +00:00
parent 266f69b8a9
commit ba14876843

View file

@ -247,7 +247,7 @@
+
+ // If the event is cancelled we move the player back to their old location.
+ if (event.isCancelled()) {
+ this.player.playerConnection.sendPacket(new PacketPlayOutPosition(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch(), Collections.<PacketPlayOutPosition.EnumPlayerTeleportFlags>emptySet(), this.teleportAwait));
+ teleport(from);
+ return;
+ }
+
@ -375,7 +375,7 @@
+
+ // If the event is cancelled we move the player back to their old location.
+ if (event.isCancelled()) {
+ this.player.playerConnection.sendPacket(new PacketPlayOutPosition(from.getX(), from.getY(), from.getZ(), from.getYaw(), from.getPitch(), Collections.<PacketPlayOutPosition.EnumPlayerTeleportFlags>emptySet(), this.teleportAwait));
+ teleport(from);
+ return;
+ }
+