fishhooks can bypass pvp blocking (#178)

add fishhook to the list
This commit is contained in:
Deauthorized 2020-01-15 22:44:51 +00:00 committed by Robinson Gallego
parent 7940313dd1
commit 56d5a669cf

View File

@ -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))