diff options
Diffstat (limited to 'src/main/java/gregtech/api/gui')
3 files changed, 11 insertions, 10 deletions
diff --git a/src/main/java/gregtech/api/gui/GT_Container.java b/src/main/java/gregtech/api/gui/GT_Container.java index ff0f1cbb9f..49aa1d9fe8 100644 --- a/src/main/java/gregtech/api/gui/GT_Container.java +++ b/src/main/java/gregtech/api/gui/GT_Container.java @@ -267,7 +267,8 @@ public class GT_Container extends Container { mTileEntity.markDirty(); - if (getSlotCount() > 0 && !(slotObject instanceof GT_Slot_Holo) && slotObject.getHasStack()) { + //null checks and checks if the item can be stacked (maxStackSize > 1) + if (getSlotCount() > 0 && slotObject != null && slotObject.getHasStack() && !(slotObject instanceof GT_Slot_Holo)) { ItemStack stackInSlot = slotObject.getStack(); stack = GT_Utility.copy(stackInSlot); diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java index b9cae3e0b3..9cdb74c2f1 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainerMetaTile_Machine.java @@ -1,9 +1,9 @@ package gregtech.api.gui; import gregtech.api.GregTech_API; +import gregtech.api.enums.Dyes; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemDye; import org.lwjgl.opengl.GL11; /** @@ -28,11 +28,11 @@ public class GT_GUIContainerMetaTile_Machine extends GT_GUIContainer { protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { super.drawGuiContainerBackgroundLayer(par1, par2, par3); if (GregTech_API.sColoredGUI && mContainer != null && mContainer.mTileEntity != null) { - int tColor = mContainer.mTileEntity.getColorization() & 15; - if (tColor < ItemDye.field_150922_c.length) { - tColor = ItemDye.field_150922_c[tColor]; - GL11.glColor4f(((tColor >> 16) & 255) / 255.0F, ((tColor >> 8) & 255) / 255.0F, (tColor & 255) / 255.0F, 1.0F); - } else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - } else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + byte colorByte=mContainer.mTileEntity.getColorization(); + Dyes color; + if(colorByte != -1) color= Dyes.get(colorByte); + else color=Dyes.MACHINE_METAL; + GL11.glColor3ub((byte)color.mRGBa[0], (byte)color.mRGBa[1], (byte)color.mRGBa[2]); + } else GL11.glColor3ub((byte)255,(byte)255,(byte)255); } }
\ No newline at end of file diff --git a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java index 189e5d25f1..c771212425 100644 --- a/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java +++ b/src/main/java/gregtech/api/gui/GT_GUIContainer_MultiMachine.java @@ -29,7 +29,7 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRendererObj.drawString(mName, 10, 8, 16448255); - if (mContainer != null) { + if (mContainer != null) {//(mWrench ? 0 : 1) | (mScrewdriver ? 0 : 2) | (mSoftHammer ? 0 : 4) | (mHardHammer ? 0 : 8) | (mSolderingTool ? 0 : 16) | (mCrowbar ? 0 : 32) | (mMachine ? 0 : 64)); if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 1) != 0) fontRendererObj.drawString("Pipe is loose.", 10, 16, 16448255); if ((((GT_Container_MultiMachine) mContainer).mDisplayErrorCode & 2) != 0) @@ -47,7 +47,7 @@ public class GT_GUIContainer_MultiMachine extends GT_GUIContainerMetaTile_Machin if (((GT_Container_MultiMachine) mContainer).mDisplayErrorCode == 0) { if (((GT_Container_MultiMachine) mContainer).mActive == 0) { - fontRendererObj.drawString("Hit with Soft Hammer", 10, 16, 16448255); + fontRendererObj.drawString("Hit with Soft Mallet", 10, 16, 16448255); fontRendererObj.drawString("to (re-)start the Machine", 10, 24, 16448255); fontRendererObj.drawString("if it doesn't start.", 10, 32, 16448255); } else { |