added validation before serialization

This commit is contained in:
Tobias Ottenweller 2012-05-16 22:45:54 +02:00
parent f5049ecdfb
commit d605e54a1c

View File

@ -89,6 +89,8 @@ public class Gate extends BaseGate implements ConfigurationSerializable
public Map<String, Object> serialize()
{
validate(); // make sure to not write invalid stuff to disk
Map<String, Object> retVal = new HashMap<String, Object>();
retVal.put(idKey, id);
@ -131,6 +133,7 @@ public class Gate extends BaseGate implements ConfigurationSerializable
gate.id = id;
instances.put(gate.id, gate);
Plugin.log("created new gate " + gate.id);
return gate;
}