From 7ed516e30ba224b4b8e3fad9c836c22ca00bfcdb Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Fri, 20 Jan 2023 00:30:50 -0800 Subject: 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 * 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 * 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 * 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 --- src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/main/java/gregtech/api/threads') diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java b/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java index 9ae94d1c80..3a2406dfde 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java +++ b/src/main/java/gregtech/api/threads/GT_Runnable_Cable_Update.java @@ -1,5 +1,7 @@ package gregtech.api.threads; +import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; + import gregtech.GT_Mod; import gregtech.api.interfaces.tileentity.IMachineBlockUpdateable; import gregtech.api.metatileentity.BaseMetaPipeEntity; @@ -50,10 +52,10 @@ public class GT_Runnable_Cable_Update extends GT_Runnable_MachineBlockUpdate { if (tTileEntity instanceof BaseMetaPipeEntity && ((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity() instanceof GT_MetaPipeEntity_Cable) { ChunkCoordinates tCoords; - for (byte i = 0; i < 6; i++) { + for (byte tSide : ALL_VALID_SIDES) { if (((GT_MetaPipeEntity_Cable) ((BaseMetaPipeEntity) tTileEntity).getMetaTileEntity()) - .isConnectedAtSide(i)) { - ForgeDirection offset = ForgeDirection.getOrientation(i); + .isConnectedAtSide(tSide)) { + final ForgeDirection offset = ForgeDirection.getOrientation(tSide); if (visited.add( tCoords = new ChunkCoordinates( aCoords.posX + offset.offsetX, -- cgit