Moved gate validation from saving to loading. This hopefully resolves issues with gates getting closed on save.

This commit is contained in:
Tobias Ottenweller 2013-06-24 20:42:40 +02:00
parent aeae14e2a0
commit 8f54c0acc2

View File

@ -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<String, Object> 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<String, Object> retVal = new HashMap<String, Object>();
retVal.put(idKey, id);