Fix side location + fix brushtool mask

This commit is contained in:
boy0001 2015-09-01 10:23:46 +10:00
parent 6671fd7e6d
commit f22874970f
2 changed files with 5 additions and 4 deletions

View File

@ -487,7 +487,7 @@ public class MainUtil {
final int z = bot.getZ(); final int z = bot.getZ();
PlotManager manager = PS.get().getPlotManager(plot.world); 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()); 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) { public static boolean teleportPlayer(final PlotPlayer player, final Location from, final Plot plot) {

View File

@ -23,6 +23,7 @@ import com.sk89q.worldedit.EditSession.Stage;
import com.sk89q.worldedit.LocalSession; import com.sk89q.worldedit.LocalSession;
import com.sk89q.worldedit.bukkit.WorldEditPlugin; import com.sk89q.worldedit.bukkit.WorldEditPlugin;
import com.sk89q.worldedit.command.tool.BrushTool; 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.event.extent.EditSessionEvent;
import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extension.platform.Actor;
import com.sk89q.worldedit.extent.AbstractDelegateExtent; import com.sk89q.worldedit.extent.AbstractDelegateExtent;
@ -82,9 +83,9 @@ public class WESubscriber {
ItemStack item = objPlayer.getItemInHand(); ItemStack item = objPlayer.getItemInHand();
if (item != null && !hasMask) { if (item != null && !hasMask) {
try { try {
BrushTool tool = session.getBrushTool(item.getTypeId()); Tool tool = session.getTool(item.getTypeId());
if (tool != null) { if (tool != null && tool instanceof BrushTool) {
hasMask = tool.getMask() != null; hasMask = ((BrushTool) tool).getMask() != null;
} }
} }
catch (Exception e) {} catch (Exception e) {}