fix for null serializer when saving npcs

This commit is contained in:
D3v1s0m 2023-09-10 17:35:52 +05:30
parent f28de908da
commit 14ded1ea49
No known key found for this signature in database
GPG Key ID: FA1F770C7B1D40C1

@ -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)));
} }