diff options
author | moller21 <42100910+moller21@users.noreply.github.com> | 2020-05-03 17:40:33 +0200 |
---|---|---|
committer | moller21 <42100910+moller21@users.noreply.github.com> | 2020-05-03 17:40:33 +0200 |
commit | b7cc73979867bbb18b937857aa072a91d87dac75 (patch) | |
tree | b14b5840c24abb51966379ff2923cc7a01eafdcc /src | |
parent | 0d59868a668a62d0d05c3ea6efbbeb3e9fc80c59 (diff) | |
download | GT5-Unofficial-b7cc73979867bbb18b937857aa072a91d87dac75.tar.gz GT5-Unofficial-b7cc73979867bbb18b937857aa072a91d87dac75.tar.bz2 GT5-Unofficial-b7cc73979867bbb18b937857aa072a91d87dac75.zip |
Why it haff to be square
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java index d6e31418f5..b57f0396a8 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java @@ -71,7 +71,7 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas int mGlassCount = 0; boolean doorState = false; this.mUpdate = 100; - + if (debugCleanroom) { GT_Log.out.println( "Cleanroom: Checking machine" @@ -83,13 +83,25 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { x = i; + break; + } else { + if (debugCleanroom) { + GT_Log.out.println("Cleanroom: Unable to detect room X edge?"); + } + return false; + } + } + } + for (int i = 1; i < 8; i++) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(0, 0, i); + int tMeta = aBaseMetaTileEntity.getMetaIDOffset(0, 0, i); + if (tBlock != GregTech_API.sBlockCasings3 || tMeta != 11) { + if (tBlock == GregTech_API.sBlockReinforced || tMeta == 2) { z = i; break; } else { if (debugCleanroom) { - GT_Log.out.println( - "Cleanroom: Unable to detect room edge?" - ); + GT_Log.out.println("Cleanroom: Unable to detect room Z edge?"); } return false; } @@ -147,7 +159,10 @@ public class GT_MetaTileEntity_Cleanroom extends GT_MetaTileEntity_MultiBlockBas if ((!this.addMaintenanceToMachineList(tTileEntity, 82)) && (!this.addEnergyInputToMachineList(tTileEntity, 82))) { if (tBlock instanceof ic2.core.block.BlockIC2Door) { if ((tMeta & 8) == 0) { - doorState = (Math.abs(dX) > Math.abs(dZ) == ((tMeta & 1) != 0)) != ((tMeta & 4) != 0); + if (Math.abs(dY) < y) //x - side + doorState = (tMeta & 0x5) == 0x4 || (tMeta & 0x5) == 0x1; + else if (Math.abs(dX) < x) //y-side, corners ignored. + doorState = (tMeta & 0x5) == 0x5 || (tMeta & 0x5) == 0x0; } mDoorCount++; } else { |