diff options
author | Jason Mitchell <mitchej@gmail.com> | 2023-04-22 22:33:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-23 07:33:35 +0200 |
commit | 56f2269f4af6d2130bdb2b6e6ac6e13bce89e47b (patch) | |
tree | 745e6d92025ec4ef449fc59fa5fdd741200b0489 /src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java | |
parent | ac0b7a7da46646d325def36eed811941dbfc5950 (diff) | |
download | GT5-Unofficial-56f2269f4af6d2130bdb2b6e6ac6e13bce89e47b.tar.gz GT5-Unofficial-56f2269f4af6d2130bdb2b6e6ac6e13bce89e47b.tar.bz2 GT5-Unofficial-56f2269f4af6d2130bdb2b6e6ac6e13bce89e47b.zip |
Forge direction (#1895)
* ForgeDirection
Also refactor the clusterfuck that was `getCoordinateScan`
Co-authored by: Jason Mitchell <mitchej@gmail.com>
* Fix rendering of Frame Boxes
Frame boxes needed their own implementation of getTexture with int connexion mask,
which is returning an error texture for the MetaTileEntity, because pipes (FrameBox
**is** a pipe) do use this method to return different textures based on connexion
status.
---------
Co-authored-by: Léa Gris <lea.gris@noiraude.net>
Diffstat (limited to 'src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java')
-rw-r--r-- | src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java index 76d3f56e74..0c2c5ebf28 100644 --- a/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java +++ b/src/main/java/gregtech/api/interfaces/metatileentity/IMetaTileEntityItemPipe.java @@ -1,14 +1,13 @@ package gregtech.api.interfaces.metatileentity; -import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; - import java.util.Map; +import net.minecraftforge.common.util.ForgeDirection; + import gregtech.api.interfaces.tileentity.IGregTechTileEntity; import gregtech.api.metatileentity.BaseMetaPipeEntity; -import gregtech.api.util.GT_Utility; -public interface IMetaTileEntityItemPipe extends IMetaTileEntity { +public interface IMetaTileEntityItemPipe extends IMetaTileEntityPipe { /** * @return if this Pipe can still be used. @@ -32,10 +31,10 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { * Executes the Sending Code for inserting Stacks into the TileEntities. * * @param aSender the BaseMetaTileEntity sending the Stack. - * @param aSide the Side of the PIPE facing the TileEntity. + * @param side the Side of the PIPE facing the TileEntity. * @return if this Side was allowed to Output into the Block. */ - boolean insertItemStackIntoTileEntity(Object aSender, byte aSide); + boolean insertItemStackIntoTileEntity(Object aSender, ForgeDirection side); /** * Can be used to make flow control Pipes, like Redpowers Restriction Tubes. Every normal Pipe returns a Value of @@ -59,11 +58,10 @@ public interface IMetaTileEntityItemPipe extends IMetaTileEntity { if (aMap.get(aMetaTileEntity) == null || aMap.get(aMetaTileEntity) > aStep) { final IGregTechTileEntity aBaseMetaTileEntity = aMetaTileEntity.getBaseMetaTileEntity(); aMap.put(aMetaTileEntity, aStep); - byte oppositeSide; - for (byte side : ALL_VALID_SIDES) { + for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { if (aMetaTileEntity instanceof IConnectable && !((IConnectable) aMetaTileEntity).isConnectedAtSide(side)) continue; - oppositeSide = GT_Utility.getOppositeSide(side); + final ForgeDirection oppositeSide = side.getOpposite(); if (aSuckItems) { if (aBaseMetaTileEntity.getCoverInfoAtSide(side) .letsItemsIn(-2)) { |