From f22874970f90599d88267db724cd87bde9ed1298 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Tue, 1 Sep 2015 10:23:46 +1000 Subject: [PATCH] Fix side location + fix brushtool mask --- .../java/com/intellectualcrafters/plot/util/MainUtil.java | 2 +- .../bukkit/listeners/worldedit/WESubscriber.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java b/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java index 62efdb258..26cc2928e 100644 --- a/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java +++ b/src/main/java/com/intellectualcrafters/plot/util/MainUtil.java @@ -487,7 +487,7 @@ public class MainUtil { final int z = bot.getZ(); PlotManager manager = PS.get().getPlotManager(plot.world); final int y = Math.max(getHeighestBlock(plot.world, x, z), manager.getSignLoc(PS.get().getPlotWorld(plot.world), plot).getY()); - return new Location(plot.world, x, y + 1, z); + return new Location(plot.world, x, y + 1, z - 1); } public static boolean teleportPlayer(final PlotPlayer player, final Location from, final Plot plot) { diff --git a/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java b/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java index 9e2814ce2..6736a1f2c 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java @@ -23,6 +23,7 @@ import com.sk89q.worldedit.EditSession.Stage; import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.command.tool.BrushTool; +import com.sk89q.worldedit.command.tool.Tool; import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.AbstractDelegateExtent; @@ -82,9 +83,9 @@ public class WESubscriber { ItemStack item = objPlayer.getItemInHand(); if (item != null && !hasMask) { try { - BrushTool tool = session.getBrushTool(item.getTypeId()); - if (tool != null) { - hasMask = tool.getMask() != null; + Tool tool = session.getTool(item.getTypeId()); + if (tool != null && tool instanceof BrushTool) { + hasMask = ((BrushTool) tool).getMask() != null; } } catch (Exception e) {}