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

@ -59,7 +59,7 @@ public class ForgePlayer extends LocalPlayer {
}
public WorldVector getPosition() {
return new WorldVector(LocalWorldAdapter.wrap(ForgeWorldEdit.inst.getWorld(this.player.worldObj)), this.player.posX, this.player.posY, this.player.posZ);
return new WorldVector(LocalWorldAdapter.adapt(ForgeWorldEdit.inst.getWorld(this.player.worldObj)), this.player.posX, this.player.posY, this.player.posZ);
}
public com.sk89q.worldedit.world.World getWorld() {

View File

@ -137,7 +137,7 @@ public class ForgeWorldEdit {
Action action = event.action;
switch (action) {
case LEFT_CLICK_BLOCK: {
WorldVector pos = new WorldVector(LocalWorldAdapter.wrap(world), event.x, event.y, event.z);
WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.x, event.y, event.z);
if (we.handleBlockLeftClick(player, pos)) {
event.setCanceled(true);
@ -148,7 +148,7 @@ public class ForgeWorldEdit {
}
}
case RIGHT_CLICK_BLOCK: {
WorldVector pos = new WorldVector(LocalWorldAdapter.wrap(world), event.x, event.y, event.z);
WorldVector pos = new WorldVector(LocalWorldAdapter.adapt(world), event.x, event.y, event.z);
if (we.handleBlockRightClick(player, pos)) {
event.setCanceled(true);