Fix Engine dupe

Closes #1361
This commit is contained in:
CovertJaguar 2013-12-08 16:56:40 -08:00
parent 0a4193b72e
commit 5be3a5c6a0
3 changed files with 7 additions and 28 deletions

View file

@ -77,16 +77,6 @@ public class BlockEngine extends BlockBuildCraft {
return false;
}
@Override
public void breakBlock(World world, int x, int y, int z, int par5, int par6) {
TileEngine engine = ((TileEngine) world.getBlockTileEntity(x, y, z));
if (engine != null) {
engine.delete();
}
super.breakBlock(world, x, y, z, par5, par6);
}
@Override
public boolean rotateBlock(World world, int x, int y, int z, ForgeDirection axis) {
TileEntity tile = world.getBlockTileEntity(x, y, z);

View file

@ -360,9 +360,6 @@ public abstract class TileEngine extends TileBuildCraft implements IPowerRecepto
iCrafting.sendProgressBarUpdate(containerEngine, 3, Math.round(heat * 100));
}
public void delete() {
}
/* STATE INFORMATION */
public abstract boolean isBurning();

View file

@ -7,16 +7,15 @@ import net.minecraft.nbt.NBTTagCompound;
import buildcraft.core.inventory.InvUtils;
import buildcraft.core.inventory.SimpleInventory;
public abstract class TileEngineWithInventory extends TileEngine implements IInventory{
public abstract class TileEngineWithInventory extends TileEngine implements IInventory {
private final SimpleInventory inv;
public TileEngineWithInventory(int invSize) {
inv = new SimpleInventory(invSize, "Engine", 64);
}
/* IINVENTORY IMPLEMENTATION */
/* IINVENTORY IMPLEMENTATION */
@Override
public int getSizeInventory() {
return inv.getSizeInventory();
@ -46,7 +45,7 @@ public abstract class TileEngineWithInventory extends TileEngine implements IInv
public boolean isItemValidForSlot(int i, ItemStack itemstack) {
return true;
}
@Override
public String getInvName() {
return "Engine";
@ -61,7 +60,7 @@ public abstract class TileEngineWithInventory extends TileEngine implements IInv
public boolean isUseableByPlayer(EntityPlayer entityplayer) {
return worldObj.getBlockTileEntity(xCoord, yCoord, zCoord) == this;
}
@Override
public void openChest() {
}
@ -69,23 +68,16 @@ public abstract class TileEngineWithInventory extends TileEngine implements IInv
@Override
public void closeChest() {
}
@Override
public void readFromNBT(NBTTagCompound data) {
super.readFromNBT(data);
inv.readFromNBT(data);
}
@Override
public void writeToNBT(NBTTagCompound data) {
super.writeToNBT(data);
inv.writeToNBT(data);
}
@Override
public void delete() {
super.delete();
InvUtils.dropItems(worldObj, inv, xCoord, yCoord, zCoord);
}
}