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

This commit is contained in:
Hea3veN 2014-12-14 10:09:16 -03:00
parent da923944de
commit efaeb9018d

View file

@ -55,14 +55,13 @@ 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;
}
blockDamage += speed / hardness / 30F;
if (blockDamage > 1.0F) {
robot.worldObj.destroyBlockInWorldPartially(robot.getEntityId(), blockToBreak.x,
blockToBreak.y, blockToBreak.z, -1);