diff options
Diffstat (limited to 'src/main/java/gregtech/common/gui')
46 files changed, 1727 insertions, 3103 deletions
diff --git a/src/main/java/gregtech/common/gui/GT_ContainerVolumetricFlask.java b/src/main/java/gregtech/common/gui/GT_ContainerVolumetricFlask.java deleted file mode 100644 index 2f8fd2a356..0000000000 --- a/src/main/java/gregtech/common/gui/GT_ContainerVolumetricFlask.java +++ /dev/null @@ -1,20 +0,0 @@ -package gregtech.common.gui; - -import gregtech.common.items.GT_VolumetricFlask; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; - -public final class GT_ContainerVolumetricFlask extends Container { - ItemStack flask; - - public GT_ContainerVolumetricFlask(InventoryPlayer inventoryPlayer) { - flask = inventoryPlayer.getCurrentItem(); - } - - @Override - public boolean canInteractWith(EntityPlayer p) { - return (flask != null) && (flask.stackSize > 0) && ((flask.getItem() instanceof GT_VolumetricFlask)); - } -} diff --git a/src/main/java/gregtech/common/gui/GT_Container_AdvDebugStructureWriter.java b/src/main/java/gregtech/common/gui/GT_Container_AdvDebugStructureWriter.java deleted file mode 100644 index 15837364f5..0000000000 --- a/src/main/java/gregtech/common/gui/GT_Container_AdvDebugStructureWriter.java +++ /dev/null @@ -1,213 +0,0 @@ -package gregtech.common.gui; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.common.tileentities.debug.GT_MetaTileEntity_AdvDebugStructureWriter; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_AdvDebugStructureWriter extends GT_ContainerMetaTile_Machine { - public short[] numbers = new short[6]; - public boolean transpose; - public boolean showHighlightBox; - - public Slot printSlot; - public Slot transposeSlot; - public Slot highlightSlot; - - public GT_Container_AdvDebugStructureWriter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 63, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 81, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 8, 99, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 63, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 81, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 26, 99, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 63, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 81, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 152, 99, false, false, 1)); - - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 5, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 23, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 41, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 63, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 81, false, false, 1)); - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 134, 99, false, false, 1)); - - printSlot = addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 12, 129, false, false, 1)); - transposeSlot = addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 33, 129, false, false, 1)); - highlightSlot = addSlotToContainer(new GT_Slot_Holo(mTileEntity, 2, 54, 129, false, false, 1)); - } - - public boolean doesBindPlayerInventory() { - return false; - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 0) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) inventorySlots.get(aSlotIndex); - if (tSlot != null && mTileEntity.getMetaTileEntity() != null) { - GT_MetaTileEntity_AdvDebugStructureWriter dsw = - (GT_MetaTileEntity_AdvDebugStructureWriter) mTileEntity.getMetaTileEntity(); - if (dsw.numbers == null) { - return null; - } - switch (aSlotIndex) { - case 0: - dsw.numbers[0] -= aShifthold == 1 ? 512 : 64; - return null; - case 1: - dsw.numbers[1] -= aShifthold == 1 ? 512 : 64; - return null; - case 2: - dsw.numbers[2] -= aShifthold == 1 ? 512 : 64; - return null; - case 3: - dsw.numbers[3] -= aShifthold == 1 ? 512 : 64; - return null; - case 4: - dsw.numbers[4] -= aShifthold == 1 ? 512 : 64; - return null; - case 5: - dsw.numbers[5] -= aShifthold == 1 ? 512 : 64; - return null; - case 6: - dsw.numbers[0] -= aShifthold == 1 ? 16 : 1; - return null; - case 7: - dsw.numbers[1] -= aShifthold == 1 ? 16 : 1; - return null; - case 8: - dsw.numbers[2] -= aShifthold == 1 ? 16 : 1; - return null; - case 9: - dsw.numbers[3] -= aShifthold == 1 ? 16 : 1; - return null; - case 10: - dsw.numbers[4] -= aShifthold == 1 ? 16 : 1; - return null; - case 11: - dsw.numbers[5] -= aShifthold == 1 ? 16 : 1; - return null; - case 12: - dsw.numbers[0] += aShifthold == 1 ? 512 : 64; - return null; - case 13: - dsw.numbers[1] += aShifthold == 1 ? 512 : 64; - return null; - case 14: - dsw.numbers[2] += aShifthold == 1 ? 512 : 64; - return null; - case 15: - dsw.numbers[3] += aShifthold == 1 ? 512 : 64; - return null; - case 16: - dsw.numbers[4] += aShifthold == 1 ? 512 : 64; - return null; - case 17: - dsw.numbers[5] += aShifthold == 1 ? 512 : 64; - return null; - case 18: - dsw.numbers[0] += aShifthold == 1 ? 16 : 1; - return null; - case 19: - dsw.numbers[1] += aShifthold == 1 ? 16 : 1; - return null; - case 20: - dsw.numbers[2] += aShifthold == 1 ? 16 : 1; - return null; - case 21: - dsw.numbers[3] += aShifthold == 1 ? 16 : 1; - return null; - case 22: - dsw.numbers[4] += aShifthold == 1 ? 16 : 1; - return null; - case 23: - dsw.numbers[5] += aShifthold == 1 ? 16 : 1; - return null; - - case 24: - if (dsw.getBaseMetaTileEntity().isServerSide()) { - dsw.printStructure(aPlayer); - } - return null; - case 25: - dsw.transpose = !dsw.transpose; - return null; - case 26: - dsw.showHighlightBox = !dsw.showHighlightBox; - return null; - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if (mTileEntity.isClientSide() || mTileEntity.getMetaTileEntity() == null) { - return; - } - GT_MetaTileEntity_AdvDebugStructureWriter dsw = - (GT_MetaTileEntity_AdvDebugStructureWriter) mTileEntity.getMetaTileEntity(); - if (numbers != null) { - System.arraycopy(dsw.numbers, 0, numbers, 0, dsw.numbers.length); - } - - transpose = dsw.transpose; - showHighlightBox = dsw.showHighlightBox; - - for (Object crafter : crafters) { - ICrafting var1 = (ICrafting) crafter; - if (numbers != null) { - var1.sendProgressBarUpdate(this, 100, numbers[0]); - var1.sendProgressBarUpdate(this, 101, numbers[1]); - var1.sendProgressBarUpdate(this, 102, numbers[2]); - var1.sendProgressBarUpdate(this, 103, numbers[3]); - var1.sendProgressBarUpdate(this, 104, numbers[4]); - var1.sendProgressBarUpdate(this, 105, numbers[5]); - var1.sendProgressBarUpdate(this, 106, transpose ? 1 : 0); - var1.sendProgressBarUpdate(this, 107, showHighlightBox ? 1 : 0); - } - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int par1, int par2) { - super.updateProgressBar(par1, par2); - if (par1 == 106) { - transpose = par2 > 0; - } else if (par1 == 107) { - showHighlightBox = par2 > 0; - } else { - if (numbers != null && par1 >= 100 && par1 <= 105) { - numbers[par1 - 100] = (short) par2; - } - } - } -} diff --git a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java b/src/main/java/gregtech/common/gui/GT_Container_Boiler.java deleted file mode 100644 index a29e732f07..0000000000 --- a/src/main/java/gregtech/common/gui/GT_Container_Boiler.java +++ /dev/null @@ -1,99 +0,0 @@ -package gregtech.common.gui; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.common.tileentities.boilers.GT_MetaTileEntity_Boiler; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.Slot; - -public class GT_Container_Boiler extends GT_ContainerMetaTile_Machine { - public int mWaterAmount = 0; - public int mSteamAmount = 0; - public int mProcessingEnergy = 0; - public int mTemperature = 2; - - public GT_Container_Boiler(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(this.mTileEntity, 2, 116, 62)); - addSlotToContainer(new Slot(this.mTileEntity, 0, 44, 26)); - addSlotToContainer(new Slot(this.mTileEntity, 1, 44, 62)); - addSlotToContainer(new Slot(this.mTileEntity, 3, 116, 26)); - } - - @Override - public int getSlotCount() { - return 4; - } - - @Override - public int getShiftClickSlotCount() { - return 1; - } - - @Override - public void detectAndSendChanges() { - super.detectAndSendChanges(); - if ((this.mTileEntity.isClientSide()) || (this.mTileEntity.getMetaTileEntity() == null)) { - return; - } - - // GT_MetaTileEntity_Boiler.getCapacity() is used for both water and steam capacity. - int capacity = ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).getCapacity(); - - this.mTemperature = ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mTemperature; - this.mProcessingEnergy = ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mProcessingEnergy; - this.mSteamAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam == null - ? 0 - : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mSteam.amount); - this.mWaterAmount = (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid == null - ? 0 - : ((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).mFluid.amount); - - this.mTemperature = Math.min( - 54, - Math.max( - 0, - this.mTemperature - * 54 - / (((GT_MetaTileEntity_Boiler) this.mTileEntity.getMetaTileEntity()).maxProgresstime() - - 10))); - this.mSteamAmount = Math.min(54, Math.max(0, this.mSteamAmount * 54 / (capacity - 100))); - this.mWaterAmount = Math.min(54, Math.max(0, this.mWaterAmount * 54 / (capacity - 100))); - this.mProcessingEnergy = - Math.min(14, Math.max(this.mProcessingEnergy > 0 ? 1 : 0, this.mProcessingEnergy * 14 / 1000)); - - for (Object crafter : this.crafters) { - ICrafting player = (ICrafting) crafter; - player.sendProgressBarUpdate(this, 100, this.mTemperature); - player.sendProgressBarUpdate(this, 101, this.mProcessingEnergy); - player.sendProgressBarUpdate(this, 102, this.mSteamAmount); - player.sendProgressBarUpdate(this, 103, this.mWaterAmount); - } - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int id, int value) { - super.updateProgressBar(id, value); - switch (id) { - case 100: - this.mTemperature = value; - break; - case 101: - this.mProcessingEnergy = value; - break; - case 102: - this.mSteamAmount = value; - break; - case 103: - this.mWaterAmount = value; - } - } -} diff --git a/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java b/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java deleted file mode 100644 index ac2f18f561..0000000000 --- a/src/main/java/gregtech/common/gui/GT_Container_BronzeBlastFurnace.java +++ /dev/null @@ -1,31 +0,0 @@ -package gregtech.common.gui; - -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Output; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; - -public class GT_Container_BronzeBlastFurnace extends GT_ContainerMetaTile_Machine { - public GT_Container_BronzeBlastFurnace(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(this.mTileEntity, 0, 34, 16)); - addSlotToContainer(new Slot(this.mTileEntity, 1, 34, 34)); - addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 2, 86, 25)); - addSlotToContainer(new GT_Slot_Output(this.mTileEntity, 3, 104, 25)); - } - - @Override - public int getSlotCount() { - return 4; - } - - @Override - public int getShiftClickSlotCount() { - return 2; - } -} diff --git a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java b/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java deleted file mode 100644 index afa22a738b..0000000000 --- a/src/main/java/gregtech/common/gui/GT_Container_ChestBuffer.java +++ /dev/null @@ -1,102 +0,0 @@ -package gregtech.common.gui; - -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.automation.GT_MetaTileEntity_ChestBuffer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_ChestBuffer extends GT_ContainerMetaTile_Machine { - public GT_Container_ChestBuffer(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - for (int y = 0; y < 3; y++) { - for (int x = 0; x < 9; x++) { - addSlotToContainer(new Slot(this.mTileEntity, x + y * 9, 8 + x * 18, 5 + y * 18)); - } - } - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 8, 63, false, true, 1)); - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 26, 63, false, true, 1)); - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 44, 63, false, true, 1)); - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 27, 62, 63, false, true, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 27) { - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - Slot tSlot = (Slot) this.inventorySlots.get(aSlotIndex); - if (tSlot != null) { - if (this.mTileEntity.getMetaTileEntity() == null) { - return null; - } - if (aSlotIndex == 27) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput = - (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput); - if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bOutput) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("116", "Emit Energy to Outputside")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("117", "Don't emit Energy")); - } - return null; - } - if (aSlotIndex == 28) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = - (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); - if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("118", "Emit Redstone if no Slot is free")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("119", "Don't emit Redstone")); - } - return null; - } - if (aSlotIndex == 29) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert = - (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert); - if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bInvert) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("120", "Invert Redstone")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("121", "Don't invert Redstone")); - } - return null; - } - if (aSlotIndex == 30) { - ((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode = - (!((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode); - if (((GT_MetaTileEntity_ChestBuffer) this.mTileEntity.getMetaTileEntity()).bStockingMode) { - GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans( - "217", - "Stocking mode. Keeps this many items in destination input slots. This mode can be server unfriendly.")); - } else { - GT_Utility.sendChatToPlayer( - aPlayer, - GT_Utility.trans( - "218", - "Transfer size mode. Add exactly this many items in destination input slots as long as there is room.")); - } - return null; - } - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public int getSlotCount() { - return 27; - } - - @Override - public int getShiftClickSlotCount() { - return 27; - } -} diff --git a/src/main/java/gregtech/common/gui/GT_Container_Filter.java b/src/main/java/gregtech/common/gui/GT_Container_Filter.java deleted file mode 100644 index d4aabe0cb4..0000000000 --- a/src/main/java/gregtech/common/gui/GT_Container_Filter.java +++ /dev/null @@ -1,138 +0,0 @@ -package gregtech.common.gui; - -import gregtech.api.gui.GT_ContainerMetaTile_Machine; -import gregtech.api.gui.GT_Slot_Holo; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.automation.GT_MetaTileEntity_Filter; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; - -public class GT_Container_Filter extends GT_ContainerMetaTile_Machine { - public GT_Container_Filter(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(this.mTileEntity, 0, 98, 5)); - addSlotToContainer(new Slot(this.mTileEntity, 1, 116, 5)); - addSlotToContainer(new Slot(this.mTileEntity, 2, 134, 5)); - addSlotToContainer(new Slot(this.mTileEntity, 3, 98, 23)); - addSlotToContainer(new Slot(this.mTileEntity, 4, 116, 23)); - addSlotToContainer(new Slot(this.mTileEntity, 5, 134, 23)); - addSlotToContainer(new Slot(this.mTileEntity, 6, 98, 41)); - addSlotToContainer(new Slot(this.mTileEntity, 7, 116, 41)); - addSlotToContainer(new Slot(this.mTileEntity, 8, 134, 41)); - - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 9, |
