From 56f2269f4af6d2130bdb2b6e6ac6e13bce89e47b Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sat, 22 Apr 2023 22:33:35 -0700 Subject: Forge direction (#1895) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ForgeDirection Also refactor the clusterfuck that was `getCoordinateScan` Co-authored by: Jason Mitchell * 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 --- .../gregtech/api/interfaces/covers/IControlsWorkCover.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/gregtech/api/interfaces/covers') diff --git a/src/main/java/gregtech/api/interfaces/covers/IControlsWorkCover.java b/src/main/java/gregtech/api/interfaces/covers/IControlsWorkCover.java index cef20ac3b7..d4cd1e9ec2 100644 --- a/src/main/java/gregtech/api/interfaces/covers/IControlsWorkCover.java +++ b/src/main/java/gregtech/api/interfaces/covers/IControlsWorkCover.java @@ -1,6 +1,6 @@ package gregtech.api.interfaces.covers; -import static gregtech.api.enums.GT_Values.ALL_VALID_SIDES; +import net.minecraftforge.common.util.ForgeDirection; import gregtech.api.interfaces.tileentity.ICoverable; import gregtech.api.interfaces.tileentity.IMachineProgress; @@ -16,10 +16,11 @@ public interface IControlsWorkCover { * * @return true if the cover is the first (side) one **/ - static boolean makeSureOnlyOne(byte aMySide, ICoverable aTileEntity) { - for (byte tSide : ALL_VALID_SIDES) { - if (aTileEntity.getCoverBehaviorAtSideNew(tSide) instanceof IControlsWorkCover && tSide < aMySide) { - aTileEntity.dropCover(tSide, tSide, true); + static boolean makeSureOnlyOne(ForgeDirection aMySide, ICoverable aTileEntity) { + for (final ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) { + if (aTileEntity.getCoverBehaviorAtSideNew(side) instanceof IControlsWorkCover + && side.ordinal() < aMySide.ordinal()) { + aTileEntity.dropCover(side, side, true); aTileEntity.markDirty(); return false; } -- cgit