diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/BlockInfo.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/BlockInfo.java index 09c46f93d..8bcd13f37 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/BlockInfo.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/BlockInfo.java @@ -39,4 +39,10 @@ public class BlockInfo { return _block.hashCode(); } + + @Override + public boolean equals(Object obj) + { + return _block.equals(obj); + } } diff --git a/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java b/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java index 99b1bbb9f..c233dfe37 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/treasure/Treasure.java @@ -388,17 +388,21 @@ public class Treasure public boolean containsBlock(Block block) { - if (_wallsBlockInfo.contains(block)) - return true; + for (BlockInfo blockInfo : _wallsBlockInfo) + if (blockInfo.equals(block)) + return true; - if (_outerRingBlockInfo.contains(block)) - return true; + for (BlockInfo blockInfo : _outerRingBlockInfo) + if (blockInfo.equals(block)) + return true; - if (_centerBlockInfo.contains(block)) - return true; + for (BlockInfo blockInfo : _centerBlockInfo) + if (blockInfo.equals(block)) + return true; - if (_chestBlockInfo.contains(block)) - return true; + for (BlockInfo blockInfo : _chestBlockInfo) + if (blockInfo.equals(block)) + return true; return false; } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java index 2e6da16b8..49b3b2a38 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/modules/ParkourManager.java @@ -28,11 +28,11 @@ import mineplex.core.common.util.F; import mineplex.core.common.util.UtilBlock; import mineplex.core.common.util.UtilEnt; import mineplex.core.common.util.UtilEvent; +import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.common.util.UtilMath; import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilServer; import mineplex.core.common.util.UtilTime; -import mineplex.core.common.util.UtilEvent.ActionType; import mineplex.core.donation.DonationManager; import mineplex.core.gadget.event.GadgetActivateEvent; import mineplex.core.gadget.event.GadgetBlockEvent; @@ -400,14 +400,15 @@ public class ParkourManager extends MiniPlugin { for (Iterator iterator = event.getBlocks().iterator(); iterator.hasNext();) { + Location location = iterator.next().getLocation(); for (ParkourData data : _parkour) { - if (data.InBoundary(iterator.next().getLocation())) + if (data.InBoundary(location)) { iterator.remove(); break; } - } + } } } diff --git a/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java b/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java index 937497aec..9da95a10d 100644 --- a/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java +++ b/Plugins/Mineplex.Hub/src/mineplex/hub/poll/PollManager.java @@ -85,7 +85,7 @@ public class PollManager extends MiniClientPlugin if (event.getType() != UpdateType.SLOW) return; - if (_polls.size() == 0) + if (_polls == null || _polls.size() == 0) return; for (Player player : _plugin.getServer().getOnlinePlayers())