diff options
author | James Clarke <jamesrtclarke@me.com> | 2013-02-02 23:02:08 +0000 |
---|---|---|
committer | feildmaster <admin@feildmaster.com> | 2013-02-04 18:53:03 -0600 |
commit | 94da64ee935f3710668f7dcc1aa94c74bd2bbb20 (patch) | |
tree | 0c9d06113a7ac711c80e1ce97b53154877af5cf2 /src | |
parent | 1090e0cf46a2d224be0619d92bcb91a993303804 (diff) | |
download | craftbukkit-94da64ee935f3710668f7dcc1aa94c74bd2bbb20.tar craftbukkit-94da64ee935f3710668f7dcc1aa94c74bd2bbb20.tar.gz craftbukkit-94da64ee935f3710668f7dcc1aa94c74bd2bbb20.tar.lz craftbukkit-94da64ee935f3710668f7dcc1aa94c74bd2bbb20.tar.xz craftbukkit-94da64ee935f3710668f7dcc1aa94c74bd2bbb20.zip |
Use the result of EntityPortalExitEvent. Fixes BUKKIT-3559.
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/net/minecraft/server/PortalTravelAgent.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main/java/net/minecraft/server/PortalTravelAgent.java b/src/main/java/net/minecraft/server/PortalTravelAgent.java index 5d5774e6..cb5a0ada 100644 --- a/src/main/java/net/minecraft/server/PortalTravelAgent.java +++ b/src/main/java/net/minecraft/server/PortalTravelAgent.java @@ -301,11 +301,19 @@ public class PortalTravelAgent { this.a.getServer().getPluginManager().callEvent(event); Location to = event.getTo(); if (event.isCancelled() || to == null || !entity.isAlive()) { - position = from; - velocity = before; + position.setX(from.getX()); + position.setY(from.getY()); + position.setZ(from.getZ()); + position.setYaw(from.getYaw()); + position.setPitch(from.getPitch()); + velocity.copy(before); } else { - position = to; - velocity = event.getAfter(); + position.setX(to.getX()); + 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 } |