Skip to content

Commit

Permalink
Fix MAX+ generator output and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IncandescenceSy committed Sep 8, 2024
1 parent 9bf77cd commit 8e97bc0
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ public long getMaxVoltage() {
// The voltage for recipe search is always on tier, so take the closest lower tier.
// List check is done because single hatches will always be a "clean voltage," no need
// for any additional checks.
return GTValues.V[GTUtility.getFloorTierByVoltage(voltage)];
return GTValues.VOC[GTUtility.getFloorTierByVoltage(voltage)];
}
return voltage;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,8 @@ public int getProgressPercent() {
@Override
public int getEnergyTier() {
if (energyContainer == null) return GTValues.LV;
return Math.max(GTValues.LV, GTUtility.getFloorTierByVoltage(energyContainer.getInputVoltage()));
return Math.min(GTValues.MAX,
Math.max(GTValues.LV, GTUtility.getFloorTierByVoltage(energyContainer.getInputVoltage())));
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/gregtech/api/util/TierByVoltageTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public void testVSpecialCases() {
expectTier(0L, ULV, ULV);
expectTier(2L, ULV, ULV);
expectTier(Integer.MAX_VALUE + 1L, MAX, MAX);
expectTier(Long.MAX_VALUE, MAX, MAX);
expectTier(Long.MAX_VALUE, MAX, MAX_TRUE);
expectTier(-1L, ULV, ULV);
}

Expand Down

0 comments on commit 8e97bc0

Please sign in to comment.