mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-19 11:59:14 +00:00
quick fix : Manual min/max calculation
This commit is contained in:
1 parent
106f238698
commit
8806f3540a
4 files changed
+6
-10
No files matched your search
@@ -160,7 +160,7 @@ public class SmelteryGui extends ActiveContainerGui {
|
||||
int fuel = logic.getScaledFuelGague(52);
|
||||
int count = 0;
|
||||
while (fuel > 0) {
|
||||
int size = fuel >= 16 ? 16 : fuel;
|
||||
int size = Math.min(fuel, 16);
|
||||
fuel -= size;
|
||||
drawLiquidRect(
|
||||
cornerX + 117,
|
||||
|
||||
@@ -113,17 +113,17 @@ public class SmelteryLogic extends InventoryLogic implements IActiveLogic, IFaci
|
||||
|
||||
int[] tempActive = activeTemps;
|
||||
activeTemps = new int[maxBlockCapacity];
|
||||
int activeLength = tempActive.length > activeTemps.length ? activeTemps.length : tempActive.length;
|
||||
int activeLength = Math.min(tempActive.length, activeTemps.length);
|
||||
System.arraycopy(tempActive, 0, activeTemps, 0, activeLength);
|
||||
|
||||
int[] tempMelting = meltingTemps;
|
||||
meltingTemps = new int[maxBlockCapacity];
|
||||
int meltingLength = tempMelting.length > meltingTemps.length ? meltingTemps.length : tempMelting.length;
|
||||
int meltingLength = Math.min(tempMelting.length, meltingTemps.length);
|
||||
System.arraycopy(tempMelting, 0, meltingTemps, 0, meltingLength);
|
||||
|
||||
ItemStack[] tempInv = inventory;
|
||||
inventory = new ItemStack[maxBlockCapacity];
|
||||
int invLength = tempInv.length > inventory.length ? inventory.length : tempInv.length;
|
||||
int invLength = Math.min(tempInv.length, inventory.length);
|
||||
System.arraycopy(tempInv, 0, inventory, 0, invLength);
|
||||
|
||||
if (activeTemps.length > 0 && activeTemps.length > tempActive.length) {
|
||||
|
||||
@@ -57,7 +57,7 @@ public class SmelteryRender implements ISimpleBlockRenderingHandler {
|
||||
while (liquidSize > 0) {
|
||||
int cap = logic.getCapacityPerLayer();
|
||||
int room = cap - liquidBase;
|
||||
int countSize = liquidSize > room ? room : liquidSize;
|
||||
int countSize = Math.min(liquidSize, room);
|
||||
liquidSize -= countSize;
|
||||
|
||||
float height = countSize > cap ? 1.0F : (float) countSize / (float) cap;
|
||||
|
||||
@@ -450,11 +450,7 @@ public class ArrowEntity extends EntityArrow implements IEntityAdditionalSpawnDa
|
||||
return 0;
|
||||
} else {
|
||||
|
||||
int l = stackSize;
|
||||
|
||||
if (stackSize > stack.getMaxStackSize() - stack.stackSize) {
|
||||
l = stack.getMaxStackSize() - stack.stackSize;
|
||||
}
|
||||
int l = Math.min(stackSize, stack.getMaxStackSize() - stack.stackSize);
|
||||
|
||||
if (l > 64 - stack.stackSize) {
|
||||
l = 64 - stack.stackSize;
|
||||
|
||||
Reference in new issue
Block a user