Stop machines

This commit is contained in:
Blood-Asp 2016-11-02 23:14:40 +01:00 committed by Technus
parent c410fce3de
commit 7396eb70c7
2 changed files with 8 additions and 1 deletions

View file

@ -128,6 +128,7 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas
moveOneDown();
}
}else{
stopMachine();
return false;
}
}
@ -201,19 +202,23 @@ public class GT_MetaTileEntity_AdvMiner2 extends GT_MetaTileEntity_MultiBlockBas
private boolean moveOneDown() {
if ((this.mInventory[1] == null) || (this.mInventory[1].stackSize < 1)
|| (!GT_Utility.areStacksEqual(this.mInventory[1], GT_ModHandler.getIC2Item("miningPipe", 1L)))) {
stopMachine();
return false;
}
int xDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX;
int zDir = ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ;
int yHead = getYOfPumpHead();
if (yHead <= 0) {
stopMachine();
return false;
}
if (getBaseMetaTileEntity().getBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir) == Blocks.bedrock) {
stopMachine();
return false;
}
if (!(getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead - 1, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipeTip", 1L))))) {
return false;
stopMachine();
return false;
}
if (yHead != getBaseMetaTileEntity().getYCoord()) {
getBaseMetaTileEntity().getWorld().setBlock(getBaseMetaTileEntity().getXCoord() + xDir, yHead, getBaseMetaTileEntity().getZCoord() + zDir, GT_Utility.getBlockFromStack(GT_ModHandler.getIC2Item("miningPipe", 1L)));

View file

@ -81,6 +81,7 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase
FluidStack tFluid = GT_Utility.undergroundOil(getBaseMetaTileEntity().getWorld(), getBaseMetaTileEntity().getXCoord()>>4, getBaseMetaTileEntity().getZCoord()>>4,false,0);
if (tFluid == null){
extractionSpeed=0;
stopMachine();
return false;//impossible
}
if (getBaseMetaTileEntity().getBlockOffset(ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetX, getYOfPumpHead() - 1 - getBaseMetaTileEntity().getYCoord(), ForgeDirection.getOrientation(getBaseMetaTileEntity().getBackFacing()).offsetZ) != Blocks.bedrock) {
@ -92,6 +93,7 @@ public class GT_MetaTileEntity_OilDrill extends GT_MetaTileEntity_MultiBlockBase
completedCycle = true;
} else if (tFluid.amount == 0) {//no fluid remaining
extractionSpeed=0;
stopMachine();
return false;//stops processing??
} else {
int minExtraction= (int)Math.pow((float)GT_Utility.getTier(getMaxInputVoltage()),3F);//tier^3