Skip to content

Commit

Permalink
beta.8
Browse files Browse the repository at this point in the history
  • Loading branch information
bibi-reden committed Jul 30, 2024
1 parent 1406ca8 commit a1acd50
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 2 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
## Additions 💫

Implemented diminishing formula.
## Changes ⚙️
- Now using `WrapMethod` on computation of modifier(s) to avoid unneeded recalculation.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ loom_version=1.7-SNAPSHOT
minecraft_version=1.20.1
fabric_kotlin_version=1.11.0+kotlin.2.0.0
fabric_api_version=0.92.2+1.20.1
mod_version=2.0.0-beta.7+1.20.1
mod_version=2.0.0-beta.8+1.20.1
loader=fabric

yarn_mappings=1.20.1+build.10
Expand All @@ -23,7 +23,7 @@ ksp_owo_config_version=0.1.0
endec_version=0.1.7
endec_netty_version=0.1.3

mixinextras_version=0.3.6
mixinextras_version=0.5.0-beta.1

org.gradle.jvmargs=-Xmx4000m
org.gradle.parallel=true
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import com.llamalad7.mixinextras.injector.ModifyExpressionValue;
import com.llamalad7.mixinextras.injector.ModifyReturnValue;
import com.llamalad7.mixinextras.injector.wrapmethod.WrapMethod;
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
Expand Down Expand Up @@ -82,13 +84,13 @@ protected void onUpdate() {}
}

@SuppressWarnings("UnreachableCode")
@ModifyReturnValue(method = "computeValue", at = @At("RETURN"))
private double data_attributes$computeValue(double original) {
@WrapMethod(method = "computeValue")
private double data_attributes$computeValue(Operation<Double> original) {
MutableEntityAttribute attribute = (MutableEntityAttribute) this.getAttribute();
StackingFormula formula = attribute.data_attributes$formula();

// If the formula is set to Flat and there is no associated container, provide original.
if (formula == StackingFormula.Flat && this.data_attributes$container == null) return original;
if (formula == StackingFormula.Flat && this.data_attributes$container == null) return original.call();

AtomicReference<Double> k = new AtomicReference<>(0.0D);
AtomicReference<Double> v = new AtomicReference<>(0.0D);
Expand Down

0 comments on commit a1acd50

Please sign in to comment.