Fix for multiple quarry arms.

This commit is contained in:
Kyprus 2012-06-06 09:47:15 -04:00
parent 65895a1cfc
commit 1c2c729c36
2 changed files with 17 additions and 6 deletions

View file

@ -12,6 +12,7 @@ package net.minecraft.src.buildcraft.factory;
import net.minecraft.src.BuildCraftFactory;
import net.minecraft.src.Entity;
import net.minecraft.src.NBTTagCompound;
import net.minecraft.src.TileEntity;
import net.minecraft.src.World;
import net.minecraft.src.buildcraft.core.EntityBlock;
@ -32,12 +33,13 @@ public class EntityMechanicalArm extends Entity {
boolean inProgressionXZ = false;
boolean inProgressionY = false;
protected TileEntity parent;
public EntityMechanicalArm(World world) {
super(world);
}
public EntityMechanicalArm(World world, double i, double j, double k,
double width, double height) {
public EntityMechanicalArm(World world, double i, double j, double k, double width, double height, TileEntity parent) {
super(world);
setPosition(i, j, k);
@ -79,6 +81,8 @@ public class EntityMechanicalArm extends Entity {
head.shadowSize = 1.0F;
updatePosition();
this.parent = parent;
}
@Override
@ -186,6 +190,12 @@ public class EntityMechanicalArm extends Entity {
@Override
public void onUpdate() {
if (parent != null && worldObj.getBlockTileEntity(parent.xCoord, parent.yCoord, parent.zCoord) != parent) {
setDead();
return;
}
if (speed > 0) {
doMove(speed);
}

View file

@ -120,7 +120,7 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine,
yCoord + bluePrintBuilder.bluePrint.sizeY - 1
+ Utils.pipeMinPos, box.zMin + Utils.pipeMaxPos,
bluePrintBuilder.bluePrint.sizeX - 2 + Utils.pipeMinPos * 2,
bluePrintBuilder.bluePrint.sizeZ - 2 + Utils.pipeMinPos * 2);
bluePrintBuilder.bluePrint.sizeZ - 2 + Utils.pipeMinPos * 2, this);
arm.listener = this;
loadArm = true;
@ -456,8 +456,9 @@ public class TileQuarry extends TileMachine implements IArmListener, IMachine,
}
@Override
public void invalidate() {
destroy();
public void invalidate () {
System.out.println("hi");
destroy ();
}
@Override