Mining Well should break pipes when invalidated
This commit is contained in:
parent
922859351c
commit
32bab2251e
2 changed files with 18 additions and 9 deletions
|
@ -64,13 +64,16 @@ public class BlockMiningWell extends BlockMachineRoot {
|
|||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, int id, int meta) {
|
||||
super.breakBlock(world, x, y, z, id, meta);
|
||||
removePipes(world, x, y, z);
|
||||
}
|
||||
|
||||
public void removePipes(World world, int x, int y, int z) {
|
||||
for (int depth = y - 1; depth > 0; depth--) {
|
||||
int pipeID = world.getBlockId(x, depth, z);
|
||||
if (pipeID != BuildCraftFactory.plainPipeBlock.blockID) {
|
||||
break;
|
||||
}
|
||||
world.setBlock(x, depth, z, 0);
|
||||
world.setBlockToAir(x, depth, z);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
/**
|
||||
* Copyright (c) SpaceToad, 2011
|
||||
* http://www.mod-buildcraft.com
|
||||
* Copyright (c) SpaceToad, 2011 http://www.mod-buildcraft.com
|
||||
*
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public
|
||||
* License 1.0, or MMPL. Please check the contents of the license located in
|
||||
* BuildCraft is distributed under the terms of the Minecraft Mod Public License
|
||||
* 1.0, or MMPL. Please check the contents of the license located in
|
||||
* http://www.mod-buildcraft.com/MMPL-1.0.txt
|
||||
*/
|
||||
|
||||
package buildcraft.factory;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -29,7 +27,6 @@ import buildcraft.core.utils.Utils;
|
|||
public class TileMiningWell extends TileMachine implements IMachine, IPowerReceptor, IPipeConnection {
|
||||
|
||||
boolean isDigging = true;
|
||||
|
||||
IPowerProvider powerProvider;
|
||||
|
||||
public TileMiningWell() {
|
||||
|
@ -39,7 +36,8 @@ public class TileMiningWell extends TileMachine implements IMachine, IPowerRecep
|
|||
}
|
||||
|
||||
/**
|
||||
* Dig the next available piece of land if not done. As soon as it reaches bedrock, lava or goes below 0, it's considered done.
|
||||
* Dig the next available piece of land if not done. As soon as it reaches
|
||||
* bedrock, lava or goes below 0, it's considered done.
|
||||
*/
|
||||
@Override
|
||||
public void doWork() {
|
||||
|
@ -102,6 +100,14 @@ public class TileMiningWell extends TileMachine implements IMachine, IPowerRecep
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
if (worldObj != null && yCoord > 2) {
|
||||
BuildCraftFactory.miningWellBlock.removePipes(worldObj, xCoord, yCoord, zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return isDigging;
|
||||
|
|
Loading…
Reference in a new issue