diff options
| author | miozune <miozune@gmail.com> | 2022-11-26 01:45:28 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-11-25 17:45:28 +0100 |
| commit | 9a2741128a78bb52eba50a631126e090a5a2abd8 (patch) | |
| tree | a90f47aa94951acb4050e45dc3ed60698e79cf32 /src/main/java/gregtech/api/gui | |
| parent | 51537482fefc4f9c6d3fbd93d119c333a63dcd7b (diff) | |
| download | GT5-Unofficial-9a2741128a78bb52eba50a631126e090a5a2abd8.tar.gz GT5-Unofficial-9a2741128a78bb52eba50a631126e090a5a2abd8.tar.bz2 GT5-Unofficial-9a2741128a78bb52eba50a631126e090a5a2abd8.zip | |
Rewrite GUIs with ModularUI (#1381)
* Base work for ModularUI compat
* Remove useless interface
* Add almost all the widgets
* Invert method
* Refactor NEI stack placement positions
* NEI handlers on ModularUI
* Add some more docs
* AdvDebugStructureWriter
* Fix NEI progressbar not working
* PrimitiveBlastFurnace
* clean
* derp
* clean
* spotlessApply
* Boilers
* Buffers
* clean
* N by N slots containers
* Fix boilers not having bucket interaction
Put opening UI to individual MetaTEs
* Maintenance Hatch
* clean
* spotlessApply
* Add dependency
* IndustrialApiary
* Adapt to ModularUI change
* Base work for covers & fix crash with MP
* Fix crash with server
* Rewrite base work for covers
* Send initial cover data on cover GUI open
so that the time of showing incorrect data will be eliminated
* Covers part 1
* Rename package: ModularUI -> modularui
* Rename class: GT_UIInfo -> GT_UIInfos
* Fix build
* Covers part2
* Fix missing client check with tile UI & fix title overlap
* CoverTabLine
* Move cover window creators to inner class
* Fix crash with null base TE
* Close GUI when tile is broken
* Color cover window with tile colorization
* Change signature of addUIWidgets
* FluidFilter cover, FluidDisplaySlotWidget, BasicTank, BasicGenerator, Output Hatch, MicrowaveEnergyTransmitter, Teleporter, DigitalChest, DigitalTank
* Add title tab
* Move package: modularui -> modularui/widget
* Programmed circuit + IConfigurationCircuitSupport
* clean
* VolumetricFlask
* Remove integrated circuit overlay from recipe input slots
* Input Hatch & Quadruple Input Hatch
* Multiblock
* Deprecate old cover GUI
* BasicMachines
* Finish BasicMachine & NEI
* Expand DTPF NEI to 9 slots
* Fix ME input bus on MP
* Move AESlotWidget to public class
* Move GT_Recipe_Map constructors with mNEIUnificateOutput to setter method
* Move SteamTexture.Variant to outer enum
* Switch to remote repository
* oops
* Update MUI
* Update MUI
* Minor refactor for change amount buttons
* Display items and fluids that exceed usual count
* blah
* use +=, why didn't I do this
* Update MUI
* Move ModularUI to Base (#1510)
* Move ModularUI to Base
* Move most of the ModularUI functionality to `BaseTileEntity` (and `CoverableTileEntity`)
* `CommonMetaTileEntity` delegates ato the MetaTileEntity
* Added several interfaces (with defaults) to indicate if a tile/metatile override/implement certain behaviors.
* Moved `IConfigurationCircuitSupport` interface such that it will work with BaseTileEntity or a MetaTileEntity
* Address reviews
Co-authored-by: miozune <miozune@gmail.com>
* Update MUI
* Minor changes to NEI
* Return :facepalm:
* IGetTabIconSet override
* Some more changes to NEI
* Merge texture getter interfaces to new class GUITextureSet
* Remove BBF structure picture as it's auto-buildable now
* Make unified title tab style of texture angular
* Expose some boiler texture getters for addon
* Fix crash with cover GUI on pipe
* Lower the number of recipe per page for DTPF & update MUI
* Update MUI
* Fix crash with middle-clicking slot on circuit selection GUI
* Fix circuit selection window not syncing item from base machine
* Merge GT_NEI_AssLineHandler into GT_NEI_DefaultHandler
* Update MUI
* Add in TecTech multi message
* Allow changing the way of binding player inventory
* Update MUI
* Update MUI
* Update MUI
* Update MUI
* Update MUI
* Make MUI non-transitive to allow addons to use their own version
* Force enable mixin
* Format fluid amount tooltip
* Add GUITextureSet.STEAM
* Add guard against null ModularWindow creation
* Add constructors for Muffler Hatch with inventory
* Fix output slot on digital chest and tank allowing insertion
* Don't log null ModularWindow
* Add default implementation for IHasWorldObjectAndCoords#openGUI
* Make openGTTileEntityUI accept MultiTE & cleanup
Co-authored-by: Jason Mitchell <mitchej@gmail.com>
Diffstat (limited to 'src/main/java/gregtech/api/gui')
33 files changed, 913 insertions, 646 deletions
diff --git a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java index f2774bbd38..588fb415c2 100644 --- a/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java +++ b/src/main/java/gregtech/api/gui/GT_ContainerMetaTile_Machine.java @@ -2,7 +2,7 @@ package gregtech.api.gui; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.interfaces.metatileentity.IConfigurationCircuitSupport; +import gregtech.api.interfaces.IConfigurationCircuitSupport; import gregtech.api.interfaces.metatileentity.IMetaTileEntity; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.util.GT_Utility; diff --git a/src/main/java/gregtech/api/gui/GT_Container_1by1.java b/src/main/java/gregtech/api/gui/GT_Container_1by1.java index 3c65c5e590..882b4d0502 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_1by1.java +++ b/src/main/java/gregtech/api/gui/GT_Container_1by1.java @@ -4,6 +4,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; +@Deprecated public class GT_Container_1by1 extends GT_ContainerMetaTile_Machine { public GT_Container_1by1(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { diff --git a/src/main/java/gregtech/api/gui/GT_Container_2by2.java b/src/main/java/gregtech/api/gui/GT_Container_2by2.java index 92d50b3aae..4267423b75 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_2by2.java +++ b/src/main/java/gregtech/api/gui/GT_Container_2by2.java @@ -4,6 +4,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; +@Deprecated public class GT_Container_2by2 extends GT_ContainerMetaTile_Machine { public GT_Container_2by2(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { diff --git a/src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java b/src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java deleted file mode 100644 index d2d6249e5b..0000000000 --- a/src/main/java/gregtech/api/gui/GT_Container_2by2_Fluid.java +++ /dev/null @@ -1,97 +0,0 @@ -package gregtech.api.gui; - -import gregtech.api.interfaces.IFluidAccess; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_MultiInput; -import gregtech.api.util.GT_Utility; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -public class GT_Container_2by2_Fluid extends GT_ContainerMetaTile_Machine { - - public GT_Container_2by2_Fluid(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - /** - * Subclasses must ensure third slot (aSlotIndex==2) is drainable fluid display item slot. - * Otherwise, subclasses must intercept the appropriate the slotClick event and call super.slotClick(2, xxx) if necessary - */ - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Render(mTileEntity, 0, 71, 26)); - addSlotToContainer(new GT_Slot_Render(mTileEntity, 1, 89, 26)); - addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 71, 44)); - addSlotToContainer(new GT_Slot_Render(mTileEntity, 3, 89, 44)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 4 && aSlotIndex >= 0 && aMouseclick < 2) { - GT_MetaTileEntity_Hatch_MultiInput tTank = - (GT_MetaTileEntity_Hatch_MultiInput) mTileEntity.getMetaTileEntity(); - if (mTileEntity.isClientSide()) { - /* - * See comment in gregtech.api.gui.GT_Container_BasicTank.slotClick on why this is necessary - */ - Slot slot = (Slot) inventorySlots.get(aSlotIndex); - tTank.setFluid(GT_Utility.getFluidFromDisplayStack(slot.getStack()), aSlotIndex); - } - MultiFluidAccess tDrainableAccess = MultiFluidAccess.from(tTank, aSlotIndex); - ItemStack tStackHeld = aPlayer.inventory.getItemStack(); - FluidStack tFluidHeld = GT_Utility.getFluidForFilledItem(tStackHeld, true); - if (tDrainableAccess.isMatch(tFluidHeld, aSlotIndex)) - return handleFluidSlotClick( - tDrainableAccess, aPlayer, aMouseclick == 0, true, !tTank.isDrainableStackSeparate()); - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public int getSlotCount() { - return 0; - } - - @Override - public int getShiftClickSlotCount() { - return 0; - } - - static class MultiFluidAccess implements IFluidAccess { - private final GT_MetaTileEntity_Hatch_MultiInput mTank; - private final int mSlot; - - public MultiFluidAccess(GT_MetaTileEntity_Hatch_MultiInput aTank, int aSlot) { - this.mTank = aTank; - this.mSlot = aSlot; - } - - public boolean isMatch(FluidStack stack, int slot) { - if (!mTank.hasFluid(stack)) return true; - if (stack == null) return true; - return stack.equals(mTank.getFluid(slot)); - } - - @Override - public void set(FluidStack stack) { - mTank.setFluid(stack, mSlot); - } - - @Override - public FluidStack get() { - return mTank.getFluid(mSlot); - } - - @Override - public int getCapacity() { - return mTank.getCapacity(); - } - - static MultiFluidAccess from(GT_MetaTileEntity_Hatch_MultiInput aTank, int aSlot) { - return new MultiFluidAccess(aTank, aSlot); - } - } -} diff --git a/src/main/java/gregtech/api/gui/GT_Container_3by3.java b/src/main/java/gregtech/api/gui/GT_Container_3by3.java index 282d740347..80f3e213d6 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_3by3.java +++ b/src/main/java/gregtech/api/gui/GT_Container_3by3.java @@ -4,6 +4,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; +@Deprecated public class GT_Container_3by3 extends GT_ContainerMetaTile_Machine { public GT_Container_3by3(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { diff --git a/src/main/java/gregtech/api/gui/GT_Container_4by4.java b/src/main/java/gregtech/api/gui/GT_Container_4by4.java index 0b38a265a6..6aa0717a11 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_4by4.java +++ b/src/main/java/gregtech/api/gui/GT_Container_4by4.java @@ -4,6 +4,7 @@ import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; +@Deprecated public class GT_Container_4by4 extends GT_ContainerMetaTile_Machine { public GT_Container_4by4(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { diff --git a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java index dc306ec223..bc0ac72a8b 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java +++ b/src/main/java/gregtech/api/gui/GT_Container_BasicTank.java @@ -6,7 +6,6 @@ import gregtech.api.interfaces.IFluidAccess; import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.storage.GT_MetaTileEntity_DigitalTankBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; @@ -123,8 +122,6 @@ public class GT_Container_BasicTank extends GT_ContainerMetaTile_Machine { public void set(FluidStack stack) { if (mIsFillableStack) mTank.setFillableStack(stack); else mTank.setDrainableStack(stack); - if (mTank instanceof GT_MetaTileEntity_DigitalTankBase) - ((GT_MetaTileEntity_DigitalTankBase) mTank).onEmptyingContainerWhenEmpty(); } @Override diff --git a/src/main/java/gregtech/api/gui/GT_Container_DigitalTank.java b/src/main/java/gregtech/api/gui/GT_Container_DigitalTank.java deleted file mode 100644 index f12f2a2ad0..0000000000 --- a/src/main/java/gregtech/api/gui/GT_Container_DigitalTank.java +++ /dev/null @@ -1,185 +0,0 @@ -package gregtech.api.gui; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import gregtech.api.interfaces.IFluidAccess; -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_BasicTank; -import gregtech.api.util.GT_Utility; -import gregtech.common.tileentities.storage.GT_MetaTileEntity_DigitalTankBase; -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_DigitalTank extends GT_Container_BasicTank { - - public boolean outputFluid = false; - public boolean mLockFluid = false; - public boolean mVoidFluidPart = false; - public boolean mVoidFluidFull = false; - public boolean mAllowInputFromOutputSide = false; - - public Slot slotAutoOutput; - public Slot slotLockFLuid; - public Slot slotVoidOverFlow; - public Slot slotVoidFull; - public Slot slotInputFromOutput; - - public GT_Container_DigitalTank(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new Slot(mTileEntity, 0, 81, 17)); - addSlotToContainer(new GT_Slot_Output(mTileEntity, 1, 81, 44)); - addSlotToContainer(new GT_Slot_Render(mTileEntity, 2, 59, 42)); - addSlotToContainer(slotAutoOutput = new GT_Slot_Holo(mTileEntity, 3, 8, 64, false, true, 1)); - addSlotToContainer(slotLockFLuid = new GT_Slot_Holo(mTileEntity, 4, 26, 64, false, true, 1)); - addSlotToContainer(slotVoidOverFlow = new GT_Slot_Holo(mTileEntity, 5, 152, 8, false, true, 1)); - addSlotToContainer(slotVoidFull = new GT_Slot_Holo(mTileEntity, 6, 152, 26, false, true, 1)); - addSlotToContainer(slotInputFromOutput = new GT_Slot_Holo(mTileEntity, 7, 44, 64, false, true, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - - GT_MetaTileEntity_DigitalTankBase mte = ((GT_MetaTileEntity_DigitalTankBase) mTileEntity.getMetaTileEntity()); - - if (aSlotIndex == 3) { - mte.mOutputFluid = !mte.mOutputFluid; - if (!mte.mOutputFluid) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("262", "Fluid Auto Output Disabled")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("263", "Fluid Auto Output Enabled")); - } - return null; - } - if (aSlotIndex == 4) { - String inBrackets; - mte.mLockFluid = !mte.mLockFluid; - if (mte.mLockFluid) { - if (mte.mFluid == null) { - mte.setLockedFluidName(null); - inBrackets = GT_Utility.trans("264", "currently none, will be locked to the next that is put in"); - } else { - mte.setLockedFluidName(mte.getDrainableStack().getFluid().getName()); - inBrackets = mte.getDrainableStack().getLocalizedName(); - } - GT_Utility.sendChatToPlayer( - aPlayer, String.format("%s (%s)", GT_Utility.trans("265", "1 specific Fluid"), inBrackets)); - } else { - mte.setLockedFluidName(null); - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("266", "Lock Fluid Mode Disabled")); - } - return null; - } - if (aSlotIndex == 5) { - mte.mVoidFluidPart = !mte.mVoidFluidPart; - if (!mte.mVoidFluidPart) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("267", "Overflow Voiding Mode Disabled")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("268", "Overflow Voiding Mode Enabled")); - } - return null; - } - if (aSlotIndex == 6) { - mte.mVoidFluidFull = !mte.mVoidFluidFull; - if (!mte.mVoidFluidFull) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("269", "Void Full Mode Disabled")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("270", "Void Full Mode Enabled")); - return null; - } - } - if (aSlotIndex == 7) { - mte.mAllowInputFromOutputSide = !mte.mAllowInputFromOutputSide; - if (!mte.mAllowInputFromOutputSide) { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.getTrans("096")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.getTrans("095")); - } - return null; - } - return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - } - - @Override - public void sendProgressBar() { - GT_MetaTileEntity_DigitalTankBase mte = ((GT_MetaTileEntity_DigitalTankBase) mTileEntity.getMetaTileEntity()); - - for (Object crafter : this.crafters) { - ICrafting player = (ICrafting) crafter; - if (mContent != oContent) { - player.sendProgressBarUpdate(this, 100, mContent & 65535); - player.sendProgressBarUpdate(this, 101, mContent >>> 16); - } - if (outputFluid != mte.mOutputFluid) { - player.sendProgressBarUpdate(this, 103, mte.mOutputFluid ? 1 : 0); - } - if (mLockFluid != mte.mLockFluid) { - player.sendProgressBarUpdate(this, 104, mte.mLockFluid ? 1 : 0); - } - if (mVoidFluidPart != mte.mVoidFluidPart) { - player.sendProgressBarUpdate(this, 105, mte.mVoidFluidPart ? 1 : 0); - } - if (mVoidFluidFull != mte.mVoidFluidFull) { - player.sendProgressBarUpdate(this, 106, mte.mVoidFluidFull ? 1 : 0); - } - if (mAllowInputFromOutputSide != mte.mAllowInputFromOutputSide) { - player.sendProgressBarUpdate(this, 107, mte.mAllowInputFromOutputSide ? 1 : 0); - } - } - - outputFluid = mte.mOutputFluid; - mLockFluid = mte.mLockFluid; - mVoidFluidPart = mte.mVoidFluidPart; - mVoidFluidFull = mte.mVoidFluidFull; - mAllowInputFromOutputSide = mte.mAllowInputFromOutputSide; - } - - @Override - @SideOnly(Side.CLIENT) - public void updateProgressBar(int id, int value) { - super.updateProgressBar(id, value); - switch (id) { - case 103: - outputFluid = (value != 0); - break; - case 104: - mLockFluid = (value != 0); - break; - case 105: - mVoidFluidPart = (value != 0); - break; - case 106: - mVoidFluidFull = (value != 0); - break; - case 107: - mAllowInputFromOutputSide = (value != 0); - break; - } - } - - @Override - protected IFluidAccess constructFluidAccess(GT_MetaTileEntity_BasicTank aTank, boolean aIsFillableStack) { - return new DigitalTankFluidAccess(aTank, aIsFillableStack); - } - - static class DigitalTankFluidAccess extends BasicTankFluidAccess { - - public DigitalTankFluidAccess(GT_MetaTileEntity_BasicTank aTank, boolean aIsFillableStack) { - super(aTank, aIsFillableStack); - } - - @Override - public int getRealCapacity() { - return ((GT_MetaTileEntity_DigitalTankBase) mTank).getRealCapacity(); - } - - @Override - public void verifyFluidStack() {} - } -} diff --git a/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java b/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java deleted file mode 100644 index fcaf618b56..0000000000 --- a/src/main/java/gregtech/api/gui/GT_Container_MaintenanceHatch.java +++ /dev/null @@ -1,30 +0,0 @@ -package gregtech.api.gui; - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_Hatch_Maintenance; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; - -public class GT_Container_MaintenanceHatch extends GT_ContainerMetaTile_Machine { - - public GT_Container_MaintenanceHatch(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { - super(aInventoryPlayer, aTileEntity); - } - - @Override - public void addSlots(InventoryPlayer aInventoryPlayer) { - addSlotToContainer(new GT_Slot_Holo(mTileEntity, 0, 80, 35, false, false, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex != 0) return super.slotClick(aSlotIndex, aMouseclick, aShifthold, aPlayer); - ItemStack tStack = aPlayer.inventory.getItemStack(); - if (tStack != null) { - ((GT_MetaTileEntity_Hatch_Maintenance) mTileEntity.getMetaTileEntity()).onToolClick(tStack, aPlayer); - if (tStack.stackSize <= 0) aPlayer.inventory.setItemStack(null); - } - return null; - } -} diff --git a/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java b/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java index 722057950b..4bfc14ad57 100644 --- a/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java +++ b/src/main/java/gregtech/api/gui/GT_Container_MultiMachine.java @@ -9,6 +9,7 @@ import net.minecraft.inventory.Slot; * <p/> * The Container I use for all my Basic Machines */ +@Deprecated public class GT_Container_MultiMachine extends GT_ContainerMetaTile_Machine { public GT_Container_MultiMachine(InventoryPlayer aInventoryPlayer, IGregTechTileEntity aTileEntity) { super(aInventoryPlayer, aTileEntity); diff --git a/src/main/java/gregtech/api/gui/GT_Container_SpecialFilter.java b/src/main/java/gregtech/api/gui/GT_Container_SpecialFilter.java deleted file mode 100644 index 0622f52865..0000000000 --- a/src/main/java/gregtech/api/gui/GT_Container_SpecialFilter.java +++ /dev/null @@ -1,123 +0,0 @@ -package gregtech.api.gui; - -import gregtech.api.interfaces.tileentity.IGregTechTileEntity; -import gregtech.api.metatileentity.implementations.GT_MetaTileEntity_SpecialFilter; -import gregtech.api.util.GT_Utility; -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_SpecialFilter extends GT_ContainerMetaTile_Machine { - - private GT_Slot_Render mSpecialSlot; - - public GT_Container_SpecialFilter(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(mSpecialSlot = new GT_Slot_Render(this.mTileEntity, 9, 35, 23)); - - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 8, 63, false, true, 1)); - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 26, 63, false, true, 1)); - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 44, 63, false, true, 1)); - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 62, 63, false, true, 1)); - addSlotToContainer(new GT_Slot_Holo(this.mTileEntity, 10, 80, 63, false, true, 1)); - } - - @Override - public ItemStack slotClick(int aSlotIndex, int aMouseclick, int aShifthold, EntityPlayer aPlayer) { - if (aSlotIndex < 9) { - 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 == 9) { - ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()) - .clickTypeIcon(aMouseclick != 0, aPlayer.inventory.getItemStack()); - return null; - } - if (aSlotIndex == 10) { - ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bOutput = - (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bOutput); - if (((GT_MetaTileEntity_SpecialFilter) 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 == 11) { - ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull = - (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull); - if (((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bRedstoneIfFull) { - GT_Utility.sendChatToPlayer( - aPlayer, GT_Utility.trans("122", "Emit Redstone if slots contain something")); - } else { - GT_Utility.sendChatToPlayer(aPlayer, GT_Utility.trans("123", "Don't emit Redstone")); - } - return null; - } - if (aSlotIndex == 12) { - ((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvert = - (!((GT_MetaTileEntity_SpecialFilter) this.mTileEntity.getMetaTileEntity()).bInvert); - if (((GT_MetaTileEntity_SpecialFilter) 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 (aSlotIn |
