Skip to content

Commit

Permalink
Fixed naturalizer to report the correct number of block changes
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkArc committed Jun 11, 2019
1 parent caf0ad9 commit e28cfda
Showing 1 changed file with 15 additions and 12 deletions.
Expand Up @@ -68,21 +68,24 @@ public boolean isGround(Vector position) {
return mask.matches(editSession, position);
}

private boolean makeChangeTo(Vector position, int depth) throws WorldEditException {
switch (depth) {
case 0:
return editSession.setBlock(position, grass);
case 1:
case 2:
case 3:
return editSession.setBlock(position, dirt);
default:
return editSession.setBlock(position, stone);
}
}

@Override
public boolean apply(Vector position, int depth) throws WorldEditException {
if (mask.matches(editSession, position)) {
affected++;
switch (depth) {
case 0:
editSession.setBlock(position, grass);
break;
case 1:
case 2:
case 3:
editSession.setBlock(position, dirt);
break;
default:
editSession.setBlock(position, stone);
if (makeChangeTo(position, depth)) {
++affected;
}
}

Expand Down

0 comments on commit e28cfda

Please sign in to comment.