From 8b9a2ff18c447c49ad4911f90e5de2664e4c485d Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Sat, 29 Jun 2019 04:27:46 +1000 Subject: [PATCH] get tool from player --- .../main/java/com/boydti/fawe/bukkit/FaweBukkit.java | 2 +- .../com/sk89q/worldedit/command/ToolUtilCommands.java | 10 +++++----- .../command/composition/ShapedBrushCommand.java | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java index d8abb86c3..dae7cba92 100644 --- a/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java +++ b/worldedit-bukkit/src/main/java/com/boydti/fawe/bukkit/FaweBukkit.java @@ -128,7 +128,7 @@ public class FaweBukkit implements IFawe, Listener { } try { - Class.forName("com.destroystokyo.paper.event.server.AsyncTabCompleteEvent"); + Class.forName("com.destroystokyo.paper.event.server.AsyncTabCompleteEvent"); Bukkit.getPluginManager().registerEvents(new AsyncTabCompleteListener(WorldEditPlugin.getInstance()), plugin); } catch (Throwable ignore) { debug("====== USE PAPER ======"); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java index 1a3df1ab0..bfe93db54 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ToolUtilCommands.java @@ -83,10 +83,10 @@ public class ToolUtilCommands { @CommandPermissions("worldedit.brush.options.mask") public void mask(Player player, LocalSession session, @Optional Mask mask) throws WorldEditException { if (mask == null) { - session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setMask(null); + session.getBrushTool(player).setMask(null); player.print("Brush mask disabled."); } else { - session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setMask(mask); + session.getBrushTool(player).setMask(mask); player.print("Brush mask set."); } } @@ -100,7 +100,7 @@ public class ToolUtilCommands { ) @CommandPermissions("worldedit.brush.options.material") public void material(Player player, LocalSession session, Pattern pattern) throws WorldEditException { - session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setFill(pattern); + session.getBrushTool(player).setFill(pattern); player.print("Brush material set."); } @@ -114,7 +114,7 @@ public class ToolUtilCommands { @CommandPermissions("worldedit.brush.options.range") public void range(Player player, LocalSession session, CommandContext args) throws WorldEditException { int range = args.getInteger(0); - session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setRange(range); + session.getBrushTool(player).setRange(range); player.print("Brush range set."); } @@ -130,7 +130,7 @@ public class ToolUtilCommands { int radius = args.getInteger(0); we.checkMaxBrushRadius(radius); - session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()).setSize(radius); + session.getBrushTool(player).setSize(radius); player.print("Brush size set."); } } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java index 98daedde2..208551c46 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/composition/ShapedBrushCommand.java @@ -72,7 +72,7 @@ public class ShapedBrushCommand extends SimpleCommand { try { WorldEdit.getInstance().checkMaxBrushRadius(radius); - BrushTool tool = session.getBrushTool(player.getItemInHand(HandSide.MAIN_HAND).getType()); + BrushTool tool = session.getBrushTool(player); tool.setSize(radius); tool.setFill(null); tool.setBrush(new OperationFactoryBrush(factory, regionFactory, session), permission);