From 56d5a669cf349426a323460deca05c2632e3c046 Mon Sep 17 00:00:00 2001 From: Deauthorized <49701242+Deauthorized@users.noreply.github.com> Date: Wed, 15 Jan 2020 22:44:51 +0000 Subject: [PATCH] fishhooks can bypass pvp blocking (#178) add fishhook to the list --- .../totalfreedommod/blocking/PVPBlocker.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/PVPBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/PVPBlocker.java index 855c8bd1..3850660e 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/PVPBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/PVPBlocker.java @@ -7,6 +7,7 @@ import org.bukkit.GameMode; import org.bukkit.entity.Arrow; import org.bukkit.entity.Player; import org.bukkit.entity.Trident; +import org.bukkit.entity.FishHook; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.entity.EntityDamageByEntityEvent; @@ -57,6 +58,14 @@ public class PVPBlocker extends FreedomService player = (Player)trident.getShooter(); } } + else if (event.getDamager() instanceof FishHook) + { + FishHook fishhook = (FishHook)event.getDamager(); + if (fishhook.getShooter() instanceof Player) + { + player = (Player)fishhook.getShooter(); + } + } } if (player != null & !plugin.al.isAdmin(player))