diff options
author | Alkalus <draknyte1@hotmail.com> | 2018-01-30 01:20:49 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-30 01:20:49 +1000 |
commit | d7ea68e8ed45dd782003b8598e22990b7793be9a (patch) | |
tree | b9d5fca50da1f302cce34b55f0a8393bd6abd26d | |
parent | 76391c77a4c3babe31518e8f233f9062d8932912 (diff) | |
parent | 92194518d60c18f7cd653ab9e9bdc4438d97bccc (diff) | |
download | GT5-Unofficial-d7ea68e8ed45dd782003b8598e22990b7793be9a.tar.gz GT5-Unofficial-d7ea68e8ed45dd782003b8598e22990b7793be9a.tar.bz2 GT5-Unofficial-d7ea68e8ed45dd782003b8598e22990b7793be9a.zip |
Merge pull request #201 from codewarrior0/checkwater-only-fills-basin
Change IndustrialWashPlant.checkWater() to only fill the basin
-rw-r--r-- | src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java | 77 |
1 files changed, 29 insertions, 48 deletions
diff --git a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java index 7fd8ce871a..3bdfd53983 100644 --- a/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java +++ b/src/Java/gtPlusPlus/xmod/gregtech/common/tileentities/machines/multi/GregtechMetaTileEntity_IndustrialWashPlant.java @@ -257,60 +257,41 @@ extends GregtechMeta_MultiBlockBase { final int zDir = ForgeDirection.getOrientation(aBaseMetaTileEntity.getBackFacing()).offsetZ * mCurrentDirectionZ; int tAmount = 0; - for (int i = mOffsetX_Lower; i <=mOffsetX_Upper; ++i) { - for (int j = mOffsetZ_Lower; j <= mOffsetZ_Upper; ++j) { - for (int h = -1; h < 2; ++h) { - if ((h != 0) || ((((xDir + i != 0) || (zDir + j != 0))) && (((i != 0) || (j != 0))))) { - IGregTechTileEntity tTileEntity = aBaseMetaTileEntity.getIGregTechTileEntityOffset(xDir + i, h, - zDir + j); - if (!addToMachineList(tTileEntity)) { - Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); - byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); - if ((tBlock != getCasingBlock()) && (tMeta != getCasingMeta())) { - if ((i != mOffsetX_Lower && j != mOffsetZ_Lower - && i != mOffsetX_Upper && j != mOffsetZ_Upper) && (h == 0 || h == 1)){ - if (tBlock == Blocks.air || tBlock == Blocks.flowing_water || tBlock == Blocks.water){ - if (this.getStoredFluids() != null){ - for (FluidStack stored : this.getStoredFluids()){ - if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))){ - if (stored.amount >= 1000){ - //Utils.LOG_WARNING("Going to try swap an air block for water from inut bus."); - stored.amount -= 1000; - Block fluidUsed = null; - if (tBlock == Blocks.air || tBlock == Blocks.flowing_water){ - fluidUsed = Blocks.water; - } - if (tBlock == Blocks.water){ - fluidUsed = BlocksItems.getFluidBlock(InternalName.fluidDistilledWater); - } - aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord()+xDir + i, aBaseMetaTileEntity.getYCoord()+h, aBaseMetaTileEntity.getZCoord()+zDir + j, fluidUsed); - - - - } - } - } + for (int i = mOffsetX_Lower + 1; i <= mOffsetX_Upper - 1; ++i) { + for (int j = mOffsetZ_Lower + 1; j <= mOffsetZ_Upper - 1; ++j) { + for (int h = 0; h < 2; ++h) { + Block tBlock = aBaseMetaTileEntity.getBlockOffset(xDir + i, h, zDir + j); + byte tMeta = aBaseMetaTileEntity.getMetaIDOffset(xDir + i, h, zDir + j); + if (tBlock == Blocks.air || tBlock == Blocks.flowing_water || tBlock == Blocks.water) { + if (this.getStoredFluids() != null) { + for (FluidStack stored : this.getStoredFluids()) { + if (stored.isFluidEqual(FluidUtils.getFluidStack("water", 1))) { + if (stored.amount >= 1000) { + //Utils.LOG_WARNING("Going to try swap an air block for water from inut bus."); + stored.amount -= 1000; + Block fluidUsed = null; + if (tBlock == Blocks.air || tBlock == Blocks.flowing_water) { + fluidUsed = Blocks.water; } - } - if (tBlock == Blocks.water){ - ++tAmount; - //Utils.LOG_WARNING("Found Water"); - } - else if (tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)){ - ++tAmount; - ++tAmount; - //Utils.LOG_WARNING("Found Distilled Water"); + if (tBlock == Blocks.water) { + fluidUsed = BlocksItems.getFluidBlock(InternalName.fluidDistilledWater); + } + aBaseMetaTileEntity.getWorld().setBlock(aBaseMetaTileEntity.getXCoord() + xDir + i, aBaseMetaTileEntity.getYCoord() + h, aBaseMetaTileEntity.getZCoord() + zDir + j, fluidUsed); + + } } - else { - //Utils.LOG_WARNING("[x] Did not form - Found: "+tBlock.getLocalizedName() + " | "+tBlock.getDamageValue(aBaseMetaTileEntity.getWorld(), aBaseMetaTileEntity.getXCoord()+ i, aBaseMetaTileEntity.getYCoord(), aBaseMetaTileEntity.getZCoord() + j)); - //Utils.LOG_WARNING("[x] Did not form - Found: "+(aBaseMetaTileEntity.getXCoord()+xDir + i) +" | "+ aBaseMetaTileEntity.getYCoord()+" | "+ (aBaseMetaTileEntity.getZCoord()+zDir + j)); - return false; - } - } } } + if (tBlock == Blocks.water) { + ++tAmount; + //Utils.LOG_WARNING("Found Water"); + } else if (tBlock == BlocksItems.getFluidBlock(InternalName.fluidDistilledWater)) { + ++tAmount; + ++tAmount; + //Utils.LOG_WARNING("Found Distilled Water"); + } } } } |