From c8c732ebee608528f90e954674326ae0e7a74e76 Mon Sep 17 00:00:00 2001 From: CrazyPants Date: Sat, 3 May 2014 17:14:47 +0800 Subject: [PATCH] #640 Graphical Glitch with Combustion Generator Moved the fuel tank to the left. --- .../machine/AbstractMachineContainer.java | 4 ++-- .../generator/BlockCombustionGenerator.java | 22 +++++++++++-------- .../CombustionGeneratorRenderer.java | 5 +++++ .../generator/GuiCombustionGenerator.java | 13 ++++++----- 4 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/main/java/crazypants/enderio/machine/AbstractMachineContainer.java b/src/main/java/crazypants/enderio/machine/AbstractMachineContainer.java index 15fc2b47..7fbb0d88 100644 --- a/src/main/java/crazypants/enderio/machine/AbstractMachineContainer.java +++ b/src/main/java/crazypants/enderio/machine/AbstractMachineContainer.java @@ -85,8 +85,8 @@ public abstract class AbstractMachineContainer extends Container { } else { //Check from inv->input then inv->upgrade then inv->hotbar or hotbar->inv if(slotIndex >= startPlayerSlot) { - if(!mergeItemStack(origStack, slotDef.getMinInputSlot(), slotDef.getMaxInputSlot() + 1, false)) { - if(slotDef.getNumUpgradeSlots() > 0 && !mergeItemStack(origStack, slotDef.getMinUpgradeSlot(), slotDef.getMaxUpgradeSlot() + 1, false)) { + if(slotDef.getNumInputSlots() <= 0 || !mergeItemStack(origStack, slotDef.getMinInputSlot(), slotDef.getMaxInputSlot() + 1, false)) { + if(slotDef.getNumUpgradeSlots() <= 0 || !mergeItemStack(origStack, slotDef.getMinUpgradeSlot(), slotDef.getMaxUpgradeSlot() + 1, false)) { if(slotIndex <= endPlayerSlot) { if(!mergeItemStack(origStack, startHotBarSlot, endHotBarSlot, false)) { return null; diff --git a/src/main/java/crazypants/enderio/machine/generator/BlockCombustionGenerator.java b/src/main/java/crazypants/enderio/machine/generator/BlockCombustionGenerator.java index edebb252..0142e46e 100644 --- a/src/main/java/crazypants/enderio/machine/generator/BlockCombustionGenerator.java +++ b/src/main/java/crazypants/enderio/machine/generator/BlockCombustionGenerator.java @@ -142,16 +142,20 @@ public class BlockCombustionGenerator extends AbstractMachineBlock 0) { IIcon icon = tank.getFluid().getFluid().getStillIcon(); if(icon != null) { diff --git a/src/main/java/crazypants/enderio/machine/generator/GuiCombustionGenerator.java b/src/main/java/crazypants/enderio/machine/generator/GuiCombustionGenerator.java index 8a18fa77..89359fbf 100644 --- a/src/main/java/crazypants/enderio/machine/generator/GuiCombustionGenerator.java +++ b/src/main/java/crazypants/enderio/machine/generator/GuiCombustionGenerator.java @@ -27,7 +27,7 @@ public class GuiCombustionGenerator extends GuiMachineBase { super(te, new ContainerCombustionEngine(par1InventoryPlayer, te)); this.gen = te; - addToolTip(new GuiToolTip(new Rectangle(48, 21, 15, 47), "") { + addToolTip(new GuiToolTip(new Rectangle(114, 21, 15, 47), "") { @Override protected void updateText() { @@ -42,7 +42,7 @@ public class GuiCombustionGenerator extends GuiMachineBase { }); - addToolTip(new GuiToolTip(new Rectangle(114, 21, 15, 47), "") { + addToolTip(new GuiToolTip(new Rectangle(48, 21, 15, 47), "") { @Override protected void updateText() { @@ -101,7 +101,8 @@ public class GuiCombustionGenerator extends GuiMachineBase { int x = guiLeft + 48; int y = guiTop + 21; if(gen.coolantTank.getFluidAmount() > 0) { - //left tank + x = guiLeft + 114; + //right tank RenderUtil.renderGuiTank(gen.coolantTank.getFluid(), 4000, gen.coolantTank.getFluidAmount() - 1000, x, y, zLevel, 15, 47); if(gen.isActive()) { @@ -121,9 +122,10 @@ public class GuiCombustionGenerator extends GuiMachineBase { } if(gen.fuelTank.getFluidAmount() > 0) { - //right tank - x = guiLeft + 114; + //left tank + x = guiLeft + 48; + //RenderUtil.renderGuiTank(gen.fuelTank.getFluid(), 4000, gen.fuelTank.getFluidAmount() - 1000, x, y, zLevel, 15, 47); RenderUtil.renderGuiTank(gen.fuelTank.getFluid(), 4000, gen.fuelTank.getFluidAmount() - 1000, x, y, zLevel, 15, 47); if(gen.isActive()) { @@ -133,6 +135,7 @@ public class GuiCombustionGenerator extends GuiMachineBase { } //center tank + //RenderUtil.renderGuiTank(gen.fuelTank.getFluid(), 1000, Math.min(gen.fuelTank.getFluidAmount(), 1000), guiLeft + 81, guiTop + 5, zLevel, 14, 14); RenderUtil.renderGuiTank(gen.fuelTank.getFluid(), 1000, Math.min(gen.fuelTank.getFluidAmount(), 1000), guiLeft + 81, guiTop + 5, zLevel, 14, 14); }