From 9fa82387653ac80fb1ba9234869a65110a4fae60 Mon Sep 17 00:00:00 2001 From: Dimach Date: Wed, 8 Mar 2017 01:22:45 +0200 Subject: [PATCH 1/2] Resolve #917. --- .../multi/GT_MetaTileEntity_Cleanroom.java | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 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 bbaf8e3b..c5ba53f2 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 @@ -56,6 +56,8 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a int mDoorCount=0; int mHullCount=0; int mPlascreteCount=0; + boolean doorState=false; + mUpdate = 100; for(int i = 1;i<8;i++){ Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); int tMeta = aBaseMetaTileEntity.getMetaIDOffset(i, 0, 0); @@ -85,19 +87,22 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a if(y==0){ if(dX==-x||dX==x||dZ==-z||dZ==z){ if(tBlock!=GregTech_API.sBlockReinforced||tMeta!=2){return false;} - }else if(dX==0&&dZ==0){ + }else if(dX==0&&dZ==0){ }else { if(tBlock!=GregTech_API.sBlockCasings3||tMeta!=11){return false;} - } + } }else if(tBlock==GregTech_API.sBlockReinforced&&tMeta==2){ mPlascreteCount++; }else{ IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); if((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))){ if(tBlock instanceof ic2.core.block.BlockIC2Door){ - mDoorCount++; + if((tMeta&8)==0){ + doorState=(Math.abs(dX)>Math.abs(dZ)==((tMeta&1)!=0))!=((tMeta&4)!=0); + } + mDoorCount++; }else{ - if (tTileEntity == null) { + if (tTileEntity == null) { {return false;} } IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); @@ -108,8 +113,8 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a } } }else{ - - } + + } } } } @@ -124,17 +129,21 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a ((GT_MetaTileEntity_BasicMachine_GT_Recipe)aMetaTileEntity).mCleanroom = this; } } - } + } } } - mUpdate = 100; + + if(doorState){ + mEfficiency=0; + } + return true; } public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { if (aSide == 0 || aSide == 1) { return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE), new GT_RenderedTexture(aActive ? Textures.BlockIcons.OVERLAY_TOP_CLEANROOM_ACTIVE : Textures.BlockIcons.OVERLAY_TOP_CLEANROOM)}; - + } return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE)}; } From d6c321883e93b05b12518ac1ee32687baa0f0d75 Mon Sep 17 00:00:00 2001 From: Dimach Date: Wed, 8 Mar 2017 02:28:41 +0200 Subject: [PATCH 2/2] Cleanness now decrease slow. --- .../machines/multi/GT_MetaTileEntity_Cleanroom.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c5ba53f2..100149a9 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 @@ -134,7 +134,7 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a } if(doorState){ - mEfficiency=0; + mEfficiency=Math.max(0,mEfficiency-200); } return true;