diff --git a/common/buildcraft/core/robots/EntityRobot.java b/common/buildcraft/core/robots/EntityRobot.java index d5b2bf41..cbaa8792 100755 --- a/common/buildcraft/core/robots/EntityRobot.java +++ b/common/buildcraft/core/robots/EntityRobot.java @@ -84,16 +84,14 @@ public class EntityRobot extends EntityRobotBase implements board = (RedstoneBoardRobot) RedstoneBoardRegistry.instance.getRedstoneBoard(boardNBT).create(boardNBT, this); dataWatcher.updateObject(16, board.getNBTHandler().getID()); - if (world.isRemote) { - RPCHandler.rpcServer(this, "requestInitialization", itemInUse); - } else { + if (!world.isRemote) { mainAI = new AIRobotMain(this); mainAI.start(); } } - public EntityRobot(World par1World) { - super(par1World); + public EntityRobot(World world) { + super(world); motionX = 0; motionY = 0; @@ -153,7 +151,9 @@ public class EntityRobot extends EntityRobotBase implements } protected void init() { - + if (worldObj.isRemote) { + RPCHandler.rpcServer(this, "requestInitialization"); + } } public void setLaserDestination (float x, float y, float z) { @@ -459,7 +459,13 @@ public class EntityRobot extends EntityRobotBase implements @RPC(RPCSide.SERVER) public void requestInitialization(RPCMessageInfo info) { - RPCHandler.rpcPlayer(info.sender, this, "clientSetItemInUse", itemInUse); + RPCHandler.rpcPlayer(info.sender, this, "rpcInitialize", itemInUse, itemActive); + } + + @RPC(RPCSide.CLIENT) + private void rpcInitialize(ItemStack stack, boolean active) { + itemInUse = stack; + itemActive = active; } @Override @@ -539,4 +545,9 @@ public class EntityRobot extends EntityRobotBase implements } } + @Override + protected boolean canDespawn() { + return false; + } + } diff --git a/common/buildcraft/core/robots/boards/AIRobotCutWood.java b/common/buildcraft/core/robots/boards/AIRobotCutWood.java index e8860906..b2664b9f 100755 --- a/common/buildcraft/core/robots/boards/AIRobotCutWood.java +++ b/common/buildcraft/core/robots/boards/AIRobotCutWood.java @@ -75,8 +75,6 @@ public class AIRobotCutWood extends AIRobot { woodToChop.y, woodToChop.z, -1); blockDamage = 0; BlockUtil.breakBlock((WorldServer) robot.worldObj, woodToChop.x, woodToChop.y, woodToChop.z, 6000); - // robot.worldObj.setBlockToAir(woodToChop.x, woodToChop.y, - // woodToChop.z); robot.getItemInUse().getItem().onBlockDestroyed(robot.getItemInUse(), robot.worldObj, block, woodToChop.x, woodToChop.y, woodToChop.z, robot); @@ -94,6 +92,8 @@ public class AIRobotCutWood extends AIRobot { @Override public void end() { robot.setItemActive(false); + robot.worldObj.destroyBlockInWorldPartially(robot.getEntityId(), woodToChop.x, + woodToChop.y, woodToChop.z, -1); } private float getBreakSpeed(EntityRobotBase robot, ItemStack usingItem, Block block, int meta) {