fix loading break ai from nbt

This commit is contained in:
Hea3veN 2015-07-27 19:46:35 -03:00
parent 9a36844a6b
commit d339d708b3
2 changed files with 16 additions and 2 deletions

View file

@ -31,7 +31,8 @@ Improvements:
* Zone Planners now have a dynamic texture (asie)
* Requesters now support the Comparator (asie)
* Add events for robot interaction and removal (asie)
* fix robots not using the correct sides when accessing inventories/tanks (hea3ven)
* Fix robots not using the correct sides when accessing inventories/tanks (hea3ven)
* Fix loading break ai from nbt (hea3ven)
* Transport:
* Filtered Buffers now support the Comparator (asie)
* Lenses do not require Iron Ingots anymore (asie)

View file

@ -55,8 +55,21 @@ public class AIRobotBreak extends AIRobot {
@Override
public void update() {
if (block == null || block.isAir(robot.worldObj, blockToBreak.x, blockToBreak.y, blockToBreak.z)) {
if (block == null) {
block = robot.worldObj.getBlock(blockToBreak.x, blockToBreak.y, blockToBreak.z);
if (block == null) {
setSuccess(false);
terminate();
return;
}
meta = robot.worldObj.getBlockMetadata(blockToBreak.x, blockToBreak.y, blockToBreak.z);
hardness = block.getBlockHardness(robot.worldObj, blockToBreak.x, blockToBreak.y, blockToBreak.z);
speed = getBreakSpeed(robot, robot.getHeldItem(), block, meta);
}
if (block.isAir(robot.worldObj, blockToBreak.x, blockToBreak.y, blockToBreak.z)) {
setSuccess(false);
terminate();
return;
}
if (hardness != 0) {