13
0
geforkt von Mirrors/Paper

Use the result of EntityPortalExitEvent. Fixes BUKKIT-3559.

Dieser Commit ist enthalten in:
James Clarke 2013-02-02 23:02:08 +00:00 committet von feildmaster
Ursprung 1090e0cf46
Commit 94da64ee93

Datei anzeigen

@ -301,11 +301,19 @@ public class PortalTravelAgent {
this.a.getServer().getPluginManager().callEvent(event); this.a.getServer().getPluginManager().callEvent(event);
Location to = event.getTo(); Location to = event.getTo();
if (event.isCancelled() || to == null || !entity.isAlive()) { if (event.isCancelled() || to == null || !entity.isAlive()) {
position = from; position.setX(from.getX());
velocity = before; position.setY(from.getY());
position.setZ(from.getZ());
position.setYaw(from.getYaw());
position.setPitch(from.getPitch());
velocity.copy(before);
} else { } else {
position = to; position.setX(to.getX());
velocity = event.getAfter(); position.setY(to.getY());
position.setZ(to.getZ());
position.setYaw(to.getYaw());
position.setPitch(to.getPitch());
velocity.copy(event.getAfter()); // event.getAfter() will never be null, as setAfter() will cause an NPE if null is passed in
} }
// CraftBukkit end // CraftBukkit end
} }