Add Destroy Speed API
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
--- a/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
+++ b/net/minecraft/world/entity/ai/attributes/AttributeInstance.java
|
||||
@@ -153,20 +153,20 @@
|
||||
double d = this.getBaseValue();
|
||||
|
||||
for (AttributeModifier attributeModifier : this.getModifiersOrEmpty(AttributeModifier.Operation.ADD_VALUE)) {
|
||||
- d += attributeModifier.amount();
|
||||
+ d += attributeModifier.amount(); // Paper - destroy speed API - diff on change
|
||||
}
|
||||
|
||||
double e = d;
|
||||
|
||||
for (AttributeModifier attributeModifier2 : this.getModifiersOrEmpty(AttributeModifier.Operation.ADD_MULTIPLIED_BASE)) {
|
||||
- e += d * attributeModifier2.amount();
|
||||
+ e += d * attributeModifier2.amount(); // Paper - destroy speed API - diff on change
|
||||
}
|
||||
|
||||
for (AttributeModifier attributeModifier3 : this.getModifiersOrEmpty(AttributeModifier.Operation.ADD_MULTIPLIED_TOTAL)) {
|
||||
- e *= 1.0 + attributeModifier3.amount();
|
||||
+ e *= 1.0 + attributeModifier3.amount(); // Paper - destroy speed API - diff on change
|
||||
}
|
||||
|
||||
- return this.attribute.value().sanitizeValue(e);
|
||||
+ return attribute.value().sanitizeValue(e); // Paper - destroy speed API - diff on change
|
||||
}
|
||||
|
||||
private Collection<AttributeModifier> getModifiersOrEmpty(AttributeModifier.Operation operation) {
|
||||
Reference in New Issue
Block a user