diff --git a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/king/CastleManager.java b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/king/CastleManager.java index f2d3c8c09..9fadd16d6 100644 --- a/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/king/CastleManager.java +++ b/Plugins/Mineplex.Core/src/mineplex/core/gadget/gadgets/particle/king/CastleManager.java @@ -132,7 +132,7 @@ public class CastleManager extends MiniPlugin if (event.getEntity() instanceof Item) return; - if (UtilAlg.inBoundingBox(event.getLocation(), _castleLocationA, _castleLocationB)) + if (isInsideCastle(event.getLocation())) { event.setCancelled(true); } @@ -164,7 +164,7 @@ public class CastleManager extends MiniPlugin if (!fromLocation.getWorld().equals(toLocation.getWorld())) return; // Cancels movement - if (UtilAlg.inBoundingBox(toLocation, _castleLocationA, _castleLocationB)) + if (isInsideCastle(toLocation)) { Entity target = player; while (target.getVehicle() != null) @@ -393,7 +393,7 @@ public class CastleManager extends MiniPlugin if (oldKing != null && oldKing.getKing().isOnline()) { // Removes old king from the throne - if (UtilAlg.inBoundingBox(oldKing.getKing().getLocation(), _castleLocationA, _castleLocationB)) + if (isInsideCastle(oldKing.getKing().getLocation())) { oldKing.getKing().teleport(new Location(UtilWorld.getWorld("world"), 0, 78, -31)); UtilPlayer.message(oldKing.getKing(), F.main("Kingdom", "You are no longer the king of that castle!")); @@ -634,6 +634,9 @@ public class CastleManager extends MiniPlugin if (!isHub()) return false; + if (!location.getWorld().equals(_castleLocationA.getWorld())) + return false; + return UtilAlg.inBoundingBox(location, _castleLocationA, _castleLocationB); }