From 8f54c0acc2c288aa7a93e8e03c235b3ac385278c Mon Sep 17 00:00:00 2001 From: Tobias Ottenweller Date: Mon, 24 Jun 2013 20:42:40 +0200 Subject: [PATCH] Moved gate validation from saving to loading. This hopefully resolves issues with gates getting closed on save. --- src/de/craftinc/gates/Gate.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/de/craftinc/gates/Gate.java b/src/de/craftinc/gates/Gate.java index 2fd860e..b658490 100644 --- a/src/de/craftinc/gates/Gate.java +++ b/src/de/craftinc/gates/Gate.java @@ -294,18 +294,18 @@ public class Gate implements ConfigurationSerializable Plugin.getPlugin().getGatesManager().storeInvalidGate(map); } + + try { + validate(); // make sure to not write invalid stuff to disk + } + catch (Exception e) { + Plugin.log("The loaded gate " + this.getId() + " seems to be not valid: " + e.getMessage()); + } } public Map serialize() { - try { - validate(); // make sure to not write invalid stuff to disk - } - catch (Exception e) { - Plugin.log("Gate " + this.getId() + " seems to be not valid. It got closed before serializing! (Reason: " + e.getMessage() + ")"); - } - Map retVal = new HashMap(); retVal.put(idKey, id);