fix for null serializer when saving npcs
This commit is contained in:
parent
f28de908da
commit
14ded1ea49
1 changed files with 4 additions and 0 deletions
|
@ -108,6 +108,10 @@ public class YamlStorage implements NpcStorage {
|
||||||
|
|
||||||
for (EntityProperty<?> property : npc.getAppliedProperties()) {
|
for (EntityProperty<?> property : npc.getAppliedProperties()) {
|
||||||
PropertySerializer<?> serializer = propertyRegistry.getSerializer(((EntityPropertyImpl<?>) property).getType());
|
PropertySerializer<?> serializer = propertyRegistry.getSerializer(((EntityPropertyImpl<?>) property).getType());
|
||||||
|
if (serializer == null) {
|
||||||
|
Bukkit.getLogger().log(Level.WARNING, "Unknown serializer for property '" + property.getName() + "' for npc '" + entry.getId() + "'. skipping ...");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
config.set("properties." + property.getName(), serializer.UNSAFE_serialize(npc.getProperty(property)));
|
config.set("properties." + property.getName(), serializer.UNSAFE_serialize(npc.getProperty(property)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue