From b86e581fc5aec1f06cacac371950584bd6c4c1a1 Mon Sep 17 00:00:00 2001 From: patience Date: Sun, 8 Feb 2026 15:03:09 +0000 Subject: [PATCH] Optimised wither collapse calc --- .../patience/mc_rebalance/mixin/WitherSkeletonRework.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/WitherSkeletonRework.java b/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/WitherSkeletonRework.java index d395c92..ee272d5 100644 --- a/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/WitherSkeletonRework.java +++ b/src/main/java/xyz/nearmisses/patience/mc_rebalance/mixin/WitherSkeletonRework.java @@ -39,12 +39,10 @@ public abstract class WitherSkeletonRework extends AbstractSkeleton { } } else { // If on hoe, collapse wither effect int duration = effectsMap.get(MobEffects.WITHER).getDuration(); - int dmgCount = 0; + int dmgCount; int durationToDmg = 40 >> amp; - while(duration>0){ // There is definitely a better way to do this, I'll come back to it later - if(durationToDmg == 0 || duration % durationToDmg == 0) {dmgCount++;} - duration--; - } + if (durationToDmg==0){dmgCount=duration;} + else{dmgCount = duration / durationToDmg;} instance.removeEffect(MobEffects.WITHER); instance.hurt(instance.damageSources().wither(), dmgCount); this.setItemSlot(EquipmentSlot.MAINHAND, new ItemStack(Items.STONE_SWORD));