From b9a26c768f2a9479362892a5f5f94957bf3a3efd Mon Sep 17 00:00:00 2001 From: Yaruma3341 Date: Sat, 20 Apr 2019 17:05:31 +0200 Subject: [PATCH] hotfixes Signed-off-by: Yaruma3341 --- src/me/yaruma/fightsystem/fight/FightTeam.java | 5 ++++- src/me/yaruma/fightsystem/fight/WaterRemover.java | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/me/yaruma/fightsystem/fight/FightTeam.java b/src/me/yaruma/fightsystem/fight/FightTeam.java index 3f53d4e..816a8df 100644 --- a/src/me/yaruma/fightsystem/fight/FightTeam.java +++ b/src/me/yaruma/fightsystem/fight/FightTeam.java @@ -84,7 +84,10 @@ public class FightTeam { } public boolean isPlayerLeader(Player player) { - return leader.getPlayer().equals(player); + if(leader != null) + return leader.getPlayer().equals(player); + else + return false; } public void broadcast(String message) { diff --git a/src/me/yaruma/fightsystem/fight/WaterRemover.java b/src/me/yaruma/fightsystem/fight/WaterRemover.java index 0bc7ae3..cabc173 100644 --- a/src/me/yaruma/fightsystem/fight/WaterRemover.java +++ b/src/me/yaruma/fightsystem/fight/WaterRemover.java @@ -92,6 +92,10 @@ public class WaterRemover { if (anchor.getType() == Material.STATIONARY_WATER) { collected.add(anchor); } + if(visitedBlocks.size() > 50) { + collected.clear(); + return; + } this.collectBlocks(anchor.getRelative(BlockFace.UP), collected, visitedBlocks); this.collectBlocks(anchor.getRelative(BlockFace.NORTH), collected, visitedBlocks); this.collectBlocks(anchor.getRelative(BlockFace.EAST), collected, visitedBlocks);