From 38d150a90b46d8d72bb954b7ff4ce2917baaa3a1 Mon Sep 17 00:00:00 2001 From: Antifluxfield Date: Sun, 11 Feb 2018 02:25:29 +0800 Subject: [PATCH] Fix that the main facing of basic machines can be set to top/bottom (#1354) --- .../GT_MetaTileEntity_BasicMachine.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java index f1fad63e..dbab45ce 100644 --- a/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java +++ b/src/main/java/gregtech/api/metatileentity/implementations/GT_MetaTileEntity_BasicMachine.java @@ -109,11 +109,16 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B mGUIName = aGUIName; mNEIName = aNEIName; } + + protected boolean isValidMainFacing(byte aSide) { + return aSide > 1; + } - public boolean setMainFacing(byte aDirection){ - mMainFacing = aDirection; + public boolean setMainFacing(byte aSide){ + if (!isValidMainFacing(aSide)) return false; + mMainFacing = aSide; if(getBaseMetaTileEntity().getFrontFacing() == mMainFacing){ - getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aDirection)); + getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aSide)); } onFacingChange(); onMachineBlockUpdate();