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

View file

@ -145,7 +145,7 @@ public class BlockQuarry extends BlockBuildCraft {
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);
}

View file

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