From 58373f7d0fc25d526502b1de3e483ccbf2cdb453 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Sat, 20 Apr 2024 18:17:41 +0200 Subject: [PATCH] Adds some conditions to the portals updated during loading --- .../net/knarcraft/stargate/utility/PortalFileHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/knarcraft/stargate/utility/PortalFileHelper.java b/src/main/java/net/knarcraft/stargate/utility/PortalFileHelper.java index 0fd620d..f77e336 100644 --- a/src/main/java/net/knarcraft/stargate/utility/PortalFileHelper.java +++ b/src/main/java/net/knarcraft/stargate/utility/PortalFileHelper.java @@ -238,7 +238,8 @@ public final class PortalFileHelper { //Re-draw the signs in case a bug in the config prevented the portal from loading and has been fixed since for (Portal portal : PortalRegistry.getAllPortals()) { - if (portal.isRegistered()) { + if (portal.isRegistered() && portal.getWorld() != null && portal.getWorld().equals(world) && + world.getWorldBorder().isInside(portal.getSignLocation())) { portal.drawSign(); updatePortalButton(portal); } @@ -261,7 +262,7 @@ public final class PortalFileHelper { private static boolean loadPortal(@NotNull String[] portalData, @NotNull World world, int lineIndex) { //Load min. required portal data String name = portalData[0]; - BlockLocation button = (portalData[2].length() > 0) ? new BlockLocation(world, portalData[2]) : null; + BlockLocation button = (!portalData[2].isEmpty()) ? new BlockLocation(world, portalData[2]) : null; //Load the portal's location PortalLocation portalLocation = new PortalLocation();