13
0
geforkt von Mirrors/Paper

SPIGOT-1124: Changed To-Location on Teleport event ignored

By: minoneer <minoneer@gmail.com>
Dieser Commit ist enthalten in:
CraftBukkit/Spigot 2016-05-30 21:29:10 +02:00
Ursprung 989192ea0b
Commit 3e6ba4f676

Datei anzeigen

@ -446,7 +446,7 @@
+ PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), PlayerTeleportEvent.TeleportCause.UNKNOWN); + PlayerTeleportEvent event = new PlayerTeleportEvent(player, from.clone(), to.clone(), PlayerTeleportEvent.TeleportCause.UNKNOWN);
+ this.server.getPluginManager().callEvent(event); + this.server.getPluginManager().callEvent(event);
+ +
+ if (event.isCancelled() || to.equals(event.getTo())) { + if (event.isCancelled() || !to.equals(event.getTo())) {
+ set.clear(); // Can't relative teleport + set.clear(); // Can't relative teleport
+ to = event.isCancelled() ? event.getFrom() : event.getTo(); + to = event.isCancelled() ? event.getFrom() : event.getTo();
+ d0 = to.getX(); + d0 = to.getX();