diff --git a/README b/README index 2fa3401..73c257f 100644 --- a/README +++ b/README @@ -82,6 +82,10 @@ gate-folder - The folder containing your .gate files ============= Changes ============= +[Version 0.24] + - Fixed a loading bug in which invalid gates caused file truncation +[Version 0.23] + - Added a check to make sure "nethergate.gate" exists, otherwise create it [Version 0.22] - Fixed multi-world stargates causing an NPE [Version 0.21] diff --git a/src/net/TheDgtl/Stargate/Portal.java b/src/net/TheDgtl/Stargate/Portal.java index f69442a..2c40f1a 100644 --- a/src/net/TheDgtl/Stargate/Portal.java +++ b/src/net/TheDgtl/Stargate/Portal.java @@ -764,15 +764,6 @@ public class Portal { Portal portal = new Portal(topLeft, modX, modZ, rotX, sign, button, dest, name, false, network, gate, owner, hidden, alwaysOn, priv); portal.close(true); - // Verify portal integrity/register portal - if (!portal.isVerified() || !portal.checkIntegrity()) { - portal.unregister(); - Stargate.log.info("[Stargate] Destroying stargate at " + portal.toString()); - } else { - portal.drawSign(); - portalCount++; - } - } scanner.close(); @@ -780,8 +771,18 @@ public class Portal { int OpenCount = 0; for (Portal portal : allPortals) { if (portal == null) continue; + + // Verify portal integrity/register portal + if (!portal.isVerified() || !portal.checkIntegrity()) { + portal.unregister(); + Stargate.log.info("[Stargate] Destroying stargate at " + portal.toString()); + continue; + } else { + portal.drawSign(); + portalCount++; + } + if (!portal.isAlwaysOn()) continue; - if (!portal.wasVerified()) continue; Portal dest = portal.getDestination(); if (dest != null) { diff --git a/src/net/TheDgtl/Stargate/Stargate.java b/src/net/TheDgtl/Stargate/Stargate.java index 52539f2..3275de9 100644 --- a/src/net/TheDgtl/Stargate/Stargate.java +++ b/src/net/TheDgtl/Stargate/Stargate.java @@ -148,7 +148,7 @@ public class Stargate extends JavaPlugin { public void reloadGates() { Gate.loadGates(gateFolder); // Replace nethergate.gate if it doesn't have an exit point. - if (Gate.getGateByName("nethergate.gate").getExit() == null) { + if (Gate.getGateByName("nethergate.gate") == null || Gate.getGateByName("nethergate.gate").getExit() == null) { Gate.populateDefaults(gateFolder); } diff --git a/src/plugin.yml b/src/plugin.yml index beec603..5bf7ccf 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: Stargate main: net.TheDgtl.Stargate.Stargate -version: 0.22 +version: 0.24 description: Stargate mod for Bukkit author: Drakia website: http://www.thedgtl.net \ No newline at end of file