Fix that the main facing of basic machines can be set to top/bottom (#1354)

This commit is contained in:
Antifluxfield 2018-02-11 02:25:29 +08:00 committed by Blood-Asp
parent d1c2477ea9
commit 38d150a90b

View file

@ -109,11 +109,16 @@ public abstract class GT_MetaTileEntity_BasicMachine extends GT_MetaTileEntity_B
mGUIName = aGUIName; mGUIName = aGUIName;
mNEIName = aNEIName; mNEIName = aNEIName;
} }
protected boolean isValidMainFacing(byte aSide) {
return aSide > 1;
}
public boolean setMainFacing(byte aDirection){ public boolean setMainFacing(byte aSide){
mMainFacing = aDirection; if (!isValidMainFacing(aSide)) return false;
mMainFacing = aSide;
if(getBaseMetaTileEntity().getFrontFacing() == mMainFacing){ if(getBaseMetaTileEntity().getFrontFacing() == mMainFacing){
getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aDirection)); getBaseMetaTileEntity().setFrontFacing(GT_Utility.getOppositeSide(aSide));
} }
onFacingChange(); onFacingChange();
onMachineBlockUpdate(); onMachineBlockUpdate();