Added BlockInteractEvent to replace handleBlockLeftClick().

Needed quite a shim for tools/brushes for now.
This commit is contained in:
sk89q
2014-06-26 16:56:40 -07:00
parent 0e00f0ac9d
commit 900c9b5258
12 changed files with 248 additions and 53 deletions

View File

@ -125,7 +125,7 @@ public class WorldEditListener implements Listener {
Action action = event.getAction();
if (action == Action.LEFT_CLICK_BLOCK) {
final Block clickedBlock = event.getClickedBlock();
final WorldVector pos = new WorldVector(LocalWorldAdapter.wrap(world), clickedBlock.getX(), clickedBlock.getY(), clickedBlock.getZ());
final WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), clickedBlock.getX(), clickedBlock.getY(), clickedBlock.getZ());
if (we.handleBlockLeftClick(player, pos)) {
event.setCancelled(true);
@ -159,7 +159,7 @@ public class WorldEditListener implements Listener {
} else if (action == Action.RIGHT_CLICK_BLOCK) {
final Block clickedBlock = event.getClickedBlock();
final WorldVector pos = new WorldVector(LocalWorldAdapter.wrap(world), clickedBlock.getX(),
final WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), clickedBlock.getX(),
clickedBlock.getY(), clickedBlock.getZ());
if (we.handleBlockRightClick(player, pos)) {