Merge pull request #947 from Dimach/unstable

Resolve #917.
This commit is contained in:
Blood-Asp 2017-03-08 12:57:15 +01:00 committed by GitHub
commit c314d8a21c

View file

@ -56,6 +56,8 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
int mDoorCount=0; int mDoorCount=0;
int mHullCount=0; int mHullCount=0;
int mPlascreteCount=0; int mPlascreteCount=0;
boolean doorState=false;
mUpdate = 100;
for(int i = 1;i<8;i++){ for(int i = 1;i<8;i++){
Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0); Block tBlock = aBaseMetaTileEntity.getBlockOffset(i, 0, 0);
int tMeta = aBaseMetaTileEntity.getMetaIDOffset(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(y==0){
if(dX==-x||dX==x||dZ==-z||dZ==z){ if(dX==-x||dX==x||dZ==-z||dZ==z){
if(tBlock!=GregTech_API.sBlockReinforced||tMeta!=2){return false;} if(tBlock!=GregTech_API.sBlockReinforced||tMeta!=2){return false;}
}else if(dX==0&&dZ==0){ }else if(dX==0&&dZ==0){
}else { }else {
if(tBlock!=GregTech_API.sBlockCasings3||tMeta!=11){return false;} if(tBlock!=GregTech_API.sBlockCasings3||tMeta!=11){return false;}
} }
}else if(tBlock==GregTech_API.sBlockReinforced&&tMeta==2){ }else if(tBlock==GregTech_API.sBlockReinforced&&tMeta==2){
mPlascreteCount++; mPlascreteCount++;
}else{ }else{
IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ); IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(dX, dY, dZ);
if((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))){ if((!addMaintenanceToMachineList(tTileEntity, 82)) && (!addEnergyInputToMachineList(tTileEntity, 82))){
if(tBlock instanceof ic2.core.block.BlockIC2Door){ 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{ }else{
if (tTileEntity == null) { if (tTileEntity == null) {
{return false;} {return false;}
} }
IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity(); IMetaTileEntity aMetaTileEntity = tTileEntity.getMetaTileEntity();
@ -108,8 +113,8 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
} }
} }
}else{ }else{
} }
} }
} }
} }
@ -124,17 +129,21 @@ public boolean checkMachine(IGregTechTileEntity aBaseMetaTileEntity, ItemStack a
((GT_MetaTileEntity_BasicMachine_GT_Recipe)aMetaTileEntity).mCleanroom = this; ((GT_MetaTileEntity_BasicMachine_GT_Recipe)aMetaTileEntity).mCleanroom = this;
} }
} }
} }
} }
} }
mUpdate = 100;
if(doorState){
mEfficiency=Math.max(0,mEfficiency-200);
}
return true; return true;
} }
public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) { public ITexture[] getTexture(IGregTechTileEntity aBaseMetaTileEntity, byte aSide, byte aFacing, byte aColorIndex, boolean aActive, boolean aRedstone) {
if (aSide == 0 || aSide == 1) { 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), 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)}; return new ITexture[]{new GT_RenderedTexture(Textures.BlockIcons.BLOCK_PLASCRETE)};
} }