aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimach <dimach2142@gmail.com>2017-03-08 01:22:45 +0200
committerDimach <dimach2142@gmail.com>2017-03-08 01:22:45 +0200
commit9fa82387653ac80fb1ba9234869a65110a4fae60 (patch)
tree513a96b57018773aa1fb4a3e03ca9cfd26e56ca9
parent7d0acb394d3a844acd373c569e0b94cad338dd7c (diff)
downloadGT5-Unofficial-9fa82387653ac80fb1ba9234869a65110a4fae60.tar.gz
GT5-Unofficial-9fa82387653ac80fb1ba9234869a65110a4fae60.tar.bz2
GT5-Unofficial-9fa82387653ac80fb1ba9234869a65110a4fae60.zip
Resolve #917.
-rw-r--r--src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_Cleanroom.java27
1 files 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 bbaf8e3ba0..c5ba53f254 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)};
}