allow robots to break blocks with hardness 0, fix #2198

This commit is contained in:
Hea3veN 2014-12-14 10:09:16 -03:00 committed by asiekierka
parent 516c680b91
commit 3913cb0f7c

View file

@ -55,13 +55,12 @@ public class AIRobotBreak extends AIRobot {
@Override
public void update() {
if (hardness == 0) {
// defensive code
terminate();
return;
}
if (hardness != 0) {
blockDamage += speed / hardness / 30F;
} else {
// Instantly break the block
blockDamage = 1.1F;
}
if (blockDamage > 1.0F) {
robot.worldObj.destroyBlockInWorldPartially(robot.getEntityId(), blockToBreak.x,