mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 13:09:53 +00:00
fixed quartz modifier not adding attack due to overflow (#250)
Co-authored-by: imTheSupremeOne <[email protected]> Co-authored-by: Martin Robertz <[email protected]> Co-authored-by: UltraProdigy <[email protected]>
This commit is contained in:
1 file changed
+4
-2
@@ -86,11 +86,12 @@ public class ModAttack extends ItemModTypeFilter {
|
||||
if (tags.hasKey(key)) {
|
||||
int[] keyPair = tags.getIntArray(key);
|
||||
int increase = matchingAmount(input);
|
||||
int overThreshold = increase / threshold;
|
||||
|
||||
int leftToBoost = threshold - (keyPair[0] % threshold);
|
||||
if (increase >= leftToBoost) {
|
||||
int attack = tags.getInteger("Attack");
|
||||
attack += 1;
|
||||
attack += (overThreshold > 1) ? overThreshold : 1;
|
||||
tags.setInteger("Attack", attack);
|
||||
}
|
||||
|
||||
@@ -113,13 +114,14 @@ public class ModAttack extends ItemModTypeFilter {
|
||||
modifiers -= 1;
|
||||
tags.setInteger("Modifiers", modifiers);
|
||||
int increase = matchingAmount(input);
|
||||
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 += 1;
|
||||
attack += (overThreshold >= 1) ? overThreshold : 0;
|
||||
tags.setInteger("Attack", attack);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user