diff options
-rw-r--r-- | src/main/java/net/minecraft/server/EntityEnderPearl.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityEnderPearl.java b/src/main/java/net/minecraft/server/EntityEnderPearl.java index 484f326e..7be7bbda 100644 --- a/src/main/java/net/minecraft/server/EntityEnderPearl.java +++ b/src/main/java/net/minecraft/server/EntityEnderPearl.java @@ -1,9 +1,12 @@ package net.minecraft.server; +// CraftBukkit start import org.bukkit.Bukkit; import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.Location; +// CraftBukkit end public class EntityEnderPearl extends EntityProjectile { @@ -37,9 +40,12 @@ public class EntityEnderPearl extends EntityProjectile { if (this.shooter instanceof EntityPlayer) { CraftPlayer player = (CraftPlayer) this.shooter.bukkitEntity; teleport = player.isOnline() && player.getWorld() == getBukkitEntity().getWorld(); + Location location = getBukkitEntity().getLocation(); + location.setPitch(player.getLocation().getPitch()); + location.setYaw(player.getLocation().getYaw()); if (teleport) { - teleEvent = new PlayerTeleportEvent(player, player.getLocation(), getBukkitEntity().getLocation(), PlayerTeleportEvent.TeleportCause.ENDER_PEARL); + teleEvent = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.ENDER_PEARL); Bukkit.getPluginManager().callEvent(teleEvent); teleport = !teleEvent.isCancelled(); } |