From 976e9f231af53cf72f7b91e89e99182dfe2a13bf Mon Sep 17 00:00:00 2001 From: Nybashirka <92296042+Viptunbeqwfwew@users.noreply.github.com> Date: Tue, 1 Sep 2026 04:16:29 +0900 Subject: [PATCH] Fix on "fixed quartz modifier not adding attack due to overflow" (#323) --- src/main/java/tconstruct/modifiers/tools/ModAttack.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/main/java/tconstruct/modifiers/tools/ModAttack.java b/src/main/java/tconstruct/modifiers/tools/ModAttack.java index 5e102ea3..9038d9dd 100644 --- a/src/main/java/tconstruct/modifiers/tools/ModAttack.java +++ b/src/main/java/tconstruct/modifiers/tools/ModAttack.java @@ -91,12 +91,11 @@ public class ModAttack extends ItemModTypeFilter { if (tags.hasKey(key)) { int[] keyPair = tags.getIntArray(key); - int overThreshold = increase / threshold; int leftToBoost = threshold - (keyPair[0] % threshold); if (increase >= leftToBoost) { int attack = tags.getInteger("Attack"); - attack += (overThreshold > 1) ? overThreshold : 1; + attack += 1 + (increase - leftToBoost) / threshold; tags.setInteger("Attack", attack); } @@ -118,14 +117,13 @@ public class ModAttack extends ItemModTypeFilter { int modifiers = tags.getInteger("Modifiers"); modifiers -= 1; tags.setInteger("Modifiers", modifiers); - int overThreshold = increase / threshold; String modName = "\u00a7f" + guiType + " (" + increase + "/" + max + ")"; int tooltipIndex = addToolTip(tool, tooltipName, modName); int[] keyPair = new int[] { increase, max, tooltipIndex }; tags.setIntArray(key, keyPair); int attack = tags.getInteger("Attack"); - attack += (overThreshold >= 1) ? overThreshold : 0; + attack += 1 + increase / threshold; tags.setInteger("Attack", attack); } }