3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 04:20:08 +01:00

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

Dieser Commit ist enthalten in:
minoneer 2016-05-30 21:29:10 +02:00 committet von md_5
Ursprung 0bc2724e51
Commit e2ff10bdcd

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();