get tool from player

This commit is contained in:
Jesse Boyd 2019-06-29 04:27:46 +10:00
parent d6280ec945
commit 8b9a2ff18c
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
3 changed files with 7 additions and 7 deletions

View File

@ -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 ======");

View File

@ -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.");
}
}

View File

@ -72,7 +72,7 @@ public class ShapedBrushCommand extends SimpleCommand<Object> {
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);