Fix controllable NPE

This commit is contained in:
fullwall 2012-10-16 17:25:18 +08:00
parent 08d4aa5fc8
commit 02ca3e7388

View File

@ -151,7 +151,10 @@ public class Controllable extends Trait implements Toggleable, CommandConfigurab
@Override
public void save(DataKey key) {
key.setBoolean("enabled", enabled);
key.setString("explicittype", explicitType.name());
if (explicitType == null)
key.removeKey("explicittype");
else
key.setString("explicittype", explicitType.name());
}
@Override