allow robots to break blocks with hardness 0, fix #2198
This commit is contained in:
parent
da923944de
commit
efaeb9018d
1 changed files with 5 additions and 6 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue