respawn when a property changes

This commit is contained in:
Pyrbu 2023-04-25 18:49:27 +01:00
parent c86a41ddda
commit 4f8a8504b0

@ -117,11 +117,15 @@ public class NPC {
public <T> void setProperty(NPCProperty<T> key, T value) {
if (value.equals(key.getDefaultValue())) removeProperty(key);
else propertyMap.put(key, value);
else {
propertyMap.put(key, value);
respawn();
}
}
public void removeProperty(NPCProperty<?> key) {
propertyMap.remove(key);
respawn();
}
public Collection<NPCAction> getActions() {