Fixed crash when wearing alicorn amulet. Fixes #400

This commit is contained in:
Sollace 2024-09-16 20:10:38 +01:00
parent 9d03ad7576
commit fe39258cff
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB

View file

@ -26,9 +26,7 @@ public interface AttributeContainer {
EntityAttributeModifier modifier = instance.getModifier(id);
if (!MathHelper.approximatelyEquals(desiredValue, modifier == null ? 0 : modifier.getValue())) {
if (modifier != null) {
instance.removeModifier(modifier);
}
instance.removeModifier(id);
if (desiredValue != 0) {
if (permanent) {