Fix incorrect attribute modification calculation

Correct the calculation of the value to be added to an attribute. Adjusted the logging statement to reflect the new calculation method, ensuring accurate debug information.
This commit is contained in:
auto committed 2024-10-19 00:08:34 +02:00
1 parent 54fa8c2f81
commit 85bafe43a8
1 file changed
+2 -1
@@ -29,7 +29,8 @@ public class EntityAttributeModifier implements EntityModifier {
log.warn("Entity {} has no {} attribute", entity.getName(), attribute.name()); log.warn("Entity {} has no {} attribute", entity.getName(), attribute.name());
return; return;
} }
double add = attributeInstance.getBaseValue() - attributeInstance.getValue() - value; log.info("DEBUG: baseValue {}, value {}, setting {}", attributeInstance.getBaseValue(), attributeInstance.getValue(), value);
double add = value;
log.info("DEBUG: Adding {} to attribute {}", add, attribute.name()); log.info("DEBUG: Adding {} to attribute {}", add, attribute.name());
NamespacedKey namespacedKey = NamespacedKey.fromString("cm", main); NamespacedKey namespacedKey = NamespacedKey.fromString("cm", main);
if (namespacedKey == null) { if (namespacedKey == null) {