fix quarries dropping a frame block

This commit is contained in:
asiekierka 2014-12-09 20:34:05 +01:00
parent 016109efcf
commit 3dfb66ea86
3 changed files with 16 additions and 5 deletions

View file

@ -44,7 +44,11 @@ public class BlockFrame extends Block implements IFramePipeConnection {
if (world.isRemote) { if (world.isRemote) {
return; return;
} }
removeNeighboringFrames(world, x, y, z);
}
protected void removeNeighboringFrames(World world, int x, int y, int z) {
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) { for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
Block nBlock = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ); Block nBlock = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
if (nBlock == this) { if (nBlock == this) {
@ -52,6 +56,7 @@ public class BlockFrame extends Block implements IFramePipeConnection {
} }
} }
} }
@Override @Override
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;

View file

@ -145,7 +145,7 @@ public class BlockQuarry extends BlockBuildCraft {
return; return;
} }
BuildCraftFactory.frameBlock.breakBlock(world, i, j, k, block, metadata); BuildCraftFactory.frameBlock.removeNeighboringFrames(world, i, j, k);
super.breakBlock(world, i, j, k, block, metadata); super.breakBlock(world, i, j, k, block, metadata);
} }

View file

@ -39,6 +39,7 @@ import buildcraft.core.Box;
import buildcraft.core.Box.Kind; import buildcraft.core.Box.Kind;
import buildcraft.core.CoreConstants; import buildcraft.core.CoreConstants;
import buildcraft.core.DefaultAreaProvider; import buildcraft.core.DefaultAreaProvider;
import buildcraft.core.IDropControlInventory;
import buildcraft.core.blueprints.Blueprint; import buildcraft.core.blueprints.Blueprint;
import buildcraft.core.blueprints.BptBuilderBase; import buildcraft.core.blueprints.BptBuilderBase;
import buildcraft.core.blueprints.BptBuilderBlueprint; import buildcraft.core.blueprints.BptBuilderBlueprint;
@ -48,7 +49,7 @@ import buildcraft.core.proxy.CoreProxy;
import buildcraft.core.utils.BlockUtils; import buildcraft.core.utils.BlockUtils;
import buildcraft.core.utils.Utils; import buildcraft.core.utils.Utils;
public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedInventory { public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedInventory, IDropControlInventory {
private static enum Stage { private static enum Stage {
BUILDING, BUILDING,
@ -842,16 +843,21 @@ public class TileQuarry extends TileAbstractBuilder implements IHasWork, ISidedI
@Override @Override
public int[] getAccessibleSlotsFromSide(int side) { public int[] getAccessibleSlotsFromSide(int side) {
return new int[] {0}; return new int[] {};
} }
@Override @Override
public boolean canInsertItem(int p1, ItemStack p2, int p3) { public boolean canInsertItem(int p1, ItemStack p2, int p3) {
return true; return false;
} }
@Override @Override
public boolean canExtractItem(int p1, ItemStack p2, int p3) { public boolean canExtractItem(int p1, ItemStack p2, int p3) {
return false; return false;
} }
@Override
public boolean doDrop() {
return false;
}
} }