Fix super pickaxe region restrictions

This commit is contained in:
Jesse Boyd 2017-08-22 13:35:27 +10:00
parent e395c11572
commit 3f0fe44f72
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
2 changed files with 7 additions and 4 deletions

View File

@ -804,7 +804,10 @@ public class EditSession extends AbstractWorld implements HasFaweQueue, Lighting
if (survivalExtent != null) {
return survivalExtent.get();
} else {
return (SurvivalModeExtent) (this.extent = new SurvivalModeExtent(this.extent, getWorld()));
AbstractDelegateExtent bypass = this.bypassAll;
SurvivalModeExtent survival = new SurvivalModeExtent(bypass.getExtent(), getWorld());
new ExtentTraverser(bypass).setNext(survival);
return survival;
}
}

View File

@ -51,14 +51,14 @@ public class SinglePickaxe implements BlockTool {
editSession.getSurvivalExtent().setToolUse(config.superPickaxeDrop);
try {
editSession.setBlock(clicked.getBlockX(), clicked.getBlockY(), clicked.getBlockZ(), EditSession.nullBlock);
if (editSession.setBlock(clicked.getBlockX(), clicked.getBlockY(), clicked.getBlockZ(), EditSession.nullBlock)) {
world.playEffect(clicked.toVector(), 2001, blockType);
}
} finally {
editSession.flushQueue();
session.remember(editSession);
}
world.playEffect(clicked.toVector(), 2001, blockType);
return true;
}