Merge pull request #2305 from hea3ven/6.3.x

allow robots to break blocks with hardness 0, fix #2198
This commit is contained in:
Adrian Siekierka 2014-12-14 15:22:45 +01:00
commit fb18a492e4

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);