From cc7182a26960d939eecc89358864f11ba9b841a2 Mon Sep 17 00:00:00 2001 From: ItsHarry Date: Thu, 26 Nov 2015 19:51:01 -0600 Subject: [PATCH] Also apply the "vanished players don't have rights" patch to Fishing Hook entities. --- .../Vanished-players-don-t-have-rights.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch index 85df932053..734aeb2fc7 100644 --- a/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch +++ b/Spigot-Server-Patches/Vanished-players-don-t-have-rights.patch @@ -23,6 +23,25 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 if (movingobjectposition != null) { org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // CraftBukkit - Call event if (movingobjectposition.entity != null) { +diff --git a/src/main/java/net/minecraft/server/EntityFishingHook.java b/src/main/java/net/minecraft/server/EntityFishingHook.java +index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 +--- a/src/main/java/net/minecraft/server/EntityFishingHook.java ++++ b/src/main/java/net/minecraft/server/EntityFishingHook.java +@@ -0,0 +0,0 @@ public class EntityFishingHook extends Entity { + movingobjectposition = new MovingObjectPosition(entity); + } + ++ // PaperSpigot start - Allow fishing hooks to fly through vanished players the shooter can't see ++ if (movingobjectposition != null && movingobjectposition.entity instanceof EntityPlayer && owner != null && owner instanceof EntityPlayer) { ++ if (!((EntityPlayer) owner).getBukkitEntity().canSee(((EntityPlayer) movingobjectposition.entity).getBukkitEntity())) { ++ movingobjectposition = null; ++ } ++ } ++ // PaperSpigot end ++ + if (movingobjectposition != null) { + org.bukkit.craftbukkit.event.CraftEventFactory.callProjectileHitEvent(this); // Craftbukkit - Call event + if (movingobjectposition.entity != null) { diff --git a/src/main/java/net/minecraft/server/EntityProjectile.java b/src/main/java/net/minecraft/server/EntityProjectile.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/net/minecraft/server/EntityProjectile.java