Re-added blocks dropping when filler clears them, this also applies to quarries and builders.

This commit is contained in:
Andrew Dudney 2014-04-19 15:01:25 -06:00
parent ee349e00b5
commit 18f4c97f8b

View file

@ -25,6 +25,7 @@ import buildcraft.core.blueprints.BuildingSlotEntity;
import buildcraft.core.blueprints.IBuilder;
import buildcraft.core.network.NetworkData;
import buildcraft.core.utils.Utils;
import buildcraft.core.utils.BlockUtil;
public class BuildingItem implements IBuilder {
@ -183,14 +184,23 @@ public class BuildingItem implements IBuilder {
private void build() {
if (slotToBuild != null) {
Block block = context.world().getBlock((int) destination.x, (int)destination.y, (int)destination.z);
int meta = context.world().getBlockMetadata((int) destination.x, (int)destination.y, (int)destination.z);
Position dest = slotToBuild.getDestination();
int destX = (int)Math.floor(dest.x);
int destY = (int)Math.floor(dest.y);
int destZ = (int)Math.floor(dest.z);
Block block = context.world().getBlock(destX, destY, destZ);
int meta = context.world().getBlockMetadata(destX, destY, destZ);
context.world().playAuxSFXAtEntity(null, 2001,
(int) destination.x, (int) destination.y,
(int) destination.z,
destX, destY, destZ,
Block.getIdFromBlock(block) + (meta << 12));
if (BlockUtil.isToughBlock(context.world(), destX, destY, destZ)) {
BlockUtil.breakBlock(context.world(), destX, destY, destZ, BuildCraftBuilders.fillerLifespanTough);
} else {
BlockUtil.breakBlock(context.world(), destX, destY, destZ, BuildCraftBuilders.fillerLifespanNormal);
}
slotToBuild.writeToWorld(context);
}
}