diff options
| author | Jason Mitchell <mitchej@gmail.com> | 2023-01-20 00:30:50 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-01-20 09:30:50 +0100 |
| commit | 7ed516e30ba224b4b8e3fad9c836c22ca00bfcdb (patch) | |
| tree | bea33f6637b929427e9abbe733e19606f8bf9032 /src/main/java/gregtech/api/multitileentity/interfaces | |
| parent | 750a4070af4756e3708e2b2555b9874864bf3cfb (diff) | |
| download | GT5-Unofficial-7ed516e30ba224b4b8e3fad9c836c22ca00bfcdb.tar.gz GT5-Unofficial-7ed516e30ba224b4b8e3fad9c836c22ca00bfcdb.tar.bz2 GT5-Unofficial-7ed516e30ba224b4b8e3fad9c836c22ca00bfcdb.zip | |
MTE Inventory updates (#1496)
* MTE Inventory updates
* Separate Input/Output inventory
* Use a LinkedHashMap to ensure inventory orders are deterministic
* Input/Output work on either Input/Output inventories
* MTE Inventory
* Add GT_Packet_MultiTileEntity
* More dyanmic packet with packetFeatures
* Add IMTE_HasModes for MultiBlockPart
* Help with MTE Inventory (#1613)
* convert inventory to use ItemStackHandler
* Update MUI
* inventories
* move Iteminventory to its own method
Co-authored-by: miozune <miozune@gmail.com>
* Update MUI
* Update MUI
* Add IMultiBlockPart
* Mte fluid inventory (#1639)
* first work on fluid inventory
* make gui work with numbers not dividable by 4
* use math.min
* add outputfluids saving
* actually working
* Update MUI
Co-authored-by: miozune <miozune@gmail.com>
* Ticking Covers!
* Parts now register covers with the controller
* Controllers now tick covers on parts
* Break cover ticking out into `tickCoverAtSide`
Fix some inventory methods on MultiBlockController
* Filter on tickable covers
* Improve GUIs for MTEs (#1650)
* working controller GUI
* locked inventory selection work
* input and output locking of inventories
Co-authored-by: miozune <miozune@gmail.com>
* spotless
* CoverInfo refactor (#1654)
* Add `CoverInfo` and deprecate the old fields to hold cover information
* Disable MTE registration
* Fix NPE - Return EMPTY_INFO for SIDE_UNKNOWN
Temporarily add back old NBT saving in case of a revert so covers aren't lost.
* Actually save the old NBT data, instead of empty
Co-authored-by: BlueWeabo <76872108+BlueWeabo@users.noreply.github.com>
Co-authored-by: miozune <miozune@gmail.com>
Diffstat (limited to 'src/main/java/gregtech/api/multitileentity/interfaces')
5 files changed, 34 insertions, 0 deletions
diff --git a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockController.java b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockController.java index 74d1252eeb..414ba24948 100644 --- a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockController.java +++ b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockController.java @@ -18,4 +18,8 @@ public interface IMultiBlockController boolean isLiquidInput(byte aSide); boolean isLiquidOutput(byte aSide); + + void registerCoveredPartOnSide(final int aSide, IMultiBlockPart part); + + void unregisterCoveredPartOnSide(final int aSide, IMultiBlockPart part); } diff --git a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockFluidHandler.java b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockFluidHandler.java index e5d2e4f691..528c153e05 100644 --- a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockFluidHandler.java +++ b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockFluidHandler.java @@ -5,6 +5,7 @@ import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidTank; public interface IMultiBlockFluidHandler { int fill(MultiBlockPart aPart, ForgeDirection aDirection, FluidStack aFluid, boolean aDoFill); @@ -18,4 +19,6 @@ public interface IMultiBlockFluidHandler { boolean canDrain(MultiBlockPart aPart, ForgeDirection aDirection, Fluid aFluid); FluidTankInfo[] getTankInfo(MultiBlockPart aPart, ForgeDirection aDirection); + + IFluidTank[] getFluidTanksForGUI(MultiBlockPart aPart); } diff --git a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockInventory.java b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockInventory.java index 7e3777fe90..c50addbe67 100644 --- a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockInventory.java +++ b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockInventory.java @@ -1,6 +1,8 @@ package gregtech.api.multitileentity.interfaces; +import com.gtnewhorizons.modularui.api.forge.IItemHandlerModifiable; import gregtech.api.multitileentity.multiblock.base.MultiBlockPart; +import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -44,4 +46,8 @@ public interface IMultiBlockInventory { void closeInventory(MultiBlockPart aPart); boolean isItemValidForSlot(MultiBlockPart aPart, int aSlot, ItemStack aStack); + + IItemHandlerModifiable getInventoryForGUI(MultiBlockPart aPart); + + List<String> getInventoryNames(MultiBlockPart aPart); } diff --git a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockPart.java b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockPart.java new file mode 100644 index 0000000000..027b49ca17 --- /dev/null +++ b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiBlockPart.java @@ -0,0 +1,11 @@ +package gregtech.api.multitileentity.interfaces; + +import net.minecraft.util.ChunkCoordinates; + +public interface IMultiBlockPart extends IMultiTileEntity { + ChunkCoordinates getTargetPos(); + + void setTargetPos(ChunkCoordinates aTargetPos); + + boolean tickCoverAtSide(byte aSide, long aTickTimer); +} diff --git a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiTileEntity.java b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiTileEntity.java index f5278d47b4..8b900ad61c 100644 --- a/src/main/java/gregtech/api/multitileentity/interfaces/IMultiTileEntity.java +++ b/src/main/java/gregtech/api/multitileentity/interfaces/IMultiTileEntity.java @@ -287,4 +287,14 @@ public interface IMultiTileEntity /** Adds ToolTips to the Item. */ void addToolTips(List<String> aList, ItemStack aStack, boolean aF3_H); } + + interface IMTE_HasModes extends IMultiTileEntity { + byte getMode(); + + void setMode(byte aMode); + + int getAllowedModes(); + + void setAllowedModes(int aAllowedModes); + } } |
