diff --git a/common/mekanism/common/multipart/PartMechanicalPipe.java b/common/mekanism/common/multipart/PartMechanicalPipe.java index 7eda465c4..4a7c255a1 100644 --- a/common/mekanism/common/multipart/PartMechanicalPipe.java +++ b/common/mekanism/common/multipart/PartMechanicalPipe.java @@ -3,13 +3,12 @@ package mekanism.common.multipart; import java.util.Arrays; import java.util.Set; -import mekanism.api.Object3D; import mekanism.api.transmitters.ITransmitter; import mekanism.api.transmitters.TransmissionType; import mekanism.client.render.PartTransmitterIcons; import mekanism.client.render.RenderPartTransmitter; import mekanism.common.FluidNetwork; -import mekanism.common.PipeUtils; +import mekanism.common.util.PipeUtils; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; diff --git a/common/mekanism/common/tileentity/TileEntityDigitalMiner.java b/common/mekanism/common/tileentity/TileEntityDigitalMiner.java index 239d10e4d..6848597c2 100644 --- a/common/mekanism/common/tileentity/TileEntityDigitalMiner.java +++ b/common/mekanism/common/tileentity/TileEntityDigitalMiner.java @@ -32,6 +32,7 @@ import mekanism.common.util.InventoryUtils; import mekanism.common.util.MekanismUtils; import mekanism.common.util.MinerUtils; import mekanism.common.util.TransporterUtils; +import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; @@ -144,6 +145,11 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I for(Object3D obj : oresToMine) { + if(!obj.exists(worldObj)) + { + continue; + } + int id = obj.getBlockId(worldObj); int meta = obj.getMetadata(worldObj); @@ -255,12 +261,18 @@ public class TileEntityDigitalMiner extends TileEntityElectricBlock implements I } public void setReplace(Object3D obj) - { + { ItemStack stack = getReplace(); if(stack != null) { worldObj.setBlock(obj.xCoord, obj.yCoord, obj.zCoord, replaceStack.itemID, replaceStack.getItemDamage(), 3); + + if(Block.blocksList[obj.getBlockId(worldObj)] != null && !Block.blocksList[obj.getBlockId(worldObj)].canBlockStay(worldObj, obj.xCoord, obj.yCoord, obj.zCoord)) + { + Block.blocksList[obj.getBlockId(worldObj)].dropBlockAsItem(worldObj, obj.xCoord, obj.yCoord, obj.zCoord, obj.getMetadata(worldObj), 1); + worldObj.setBlockToAir(obj.xCoord, obj.yCoord, obj.zCoord); + } } else { worldObj.setBlockToAir(obj.xCoord, obj.yCoord, obj.zCoord);