Fix controllable NPE

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

View File

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