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 2aedd13df..dfb84eaaf 100644 --- a/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java +++ b/src/main/java/com/plotsquared/bukkit/listeners/worldedit/WESubscriber.java @@ -4,6 +4,7 @@ import java.lang.reflect.Field; import java.util.HashSet; import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; import com.intellectualcrafters.plot.PS; import com.intellectualcrafters.plot.config.C; @@ -14,10 +15,11 @@ import com.intellectualcrafters.plot.util.MainUtil; import com.intellectualcrafters.plot.util.Permissions; import com.intellectualcrafters.plot.util.UUIDHandler; import com.plotsquared.bukkit.BukkitMain; +import com.plotsquared.bukkit.object.BukkitPlayer; import com.sk89q.worldedit.EditSession; import com.sk89q.worldedit.EditSession.Stage; import com.sk89q.worldedit.LocalSession; -import com.sk89q.worldedit.bukkit.BukkitPlayer; +import com.sk89q.worldedit.command.tool.BrushTool; import com.sk89q.worldedit.event.extent.EditSessionEvent; import com.sk89q.worldedit.extension.platform.Actor; import com.sk89q.worldedit.extent.AbstractDelegateExtent; @@ -67,6 +69,14 @@ public class WESubscriber { try { LocalSession session = ((BukkitMain) PS.get().IMP).worldEdit.getWorldEdit().getSession(name); boolean hasMask = session.getMask() != null; + Player objPlayer = ((BukkitPlayer) player).player; + ItemStack item = objPlayer.getItemInHand(); + if (item != null && !hasMask) { + BrushTool tool = session.getBrushTool(item.getTypeId()); + if (tool != null) { + hasMask = tool.getMask() != null; + } + } AbstractDelegateExtent extent = (AbstractDelegateExtent) event.getExtent(); ChangeSetExtent history = null; MultiStageReorder reorder = null; diff --git a/target/PlotSquared-Bukkit.jar b/target/PlotSquared-Bukkit.jar index 0b6874202..3358da330 100644 Binary files a/target/PlotSquared-Bukkit.jar and b/target/PlotSquared-Bukkit.jar differ diff --git a/target/PlotSquared-Sponge.jar b/target/PlotSquared-Sponge.jar index 27e6a06f3..d700dae9b 100644 Binary files a/target/PlotSquared-Sponge.jar and b/target/PlotSquared-Sponge.jar differ