From 5f037df326ec67b69e125c5d45406cb5c66ff767 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Thu, 13 Jun 2019 00:48:40 +0200 Subject: [PATCH] Adding missing permissions Added some basic permissions to some basic and fawe specific commands. Since they weren't around previously, they are true by default, however, you can now revoke/negate them. --- .../worldedit/bukkit/WorldEditPlugin.java | 2 +- .../src/main/resources/DummyFawe.src | Bin 1988 -> 2016 bytes .../command/BrushOptionsCommands.java | 7 +++++++ .../worldedit/command/OptionsCommands.java | 2 ++ .../worldedit/command/ScriptingCommands.java | 1 + .../worldedit/command/UtilityCommands.java | 5 +++++ 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java index 3f93e7c31..c0827cb19 100644 --- a/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java +++ b/worldedit-bukkit/src/main/java/com/sk89q/worldedit/bukkit/WorldEditPlugin.java @@ -273,7 +273,7 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter } File pluginsFolder = MainUtil.getJarFile().getParentFile(); for (File file : pluginsFolder.listFiles()) { - if (file.length() == 1988) return; + if (file.length() == 2016) return; } Plugin plugin = Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit"); File dummy = MainUtil.copyFile(MainUtil.getJarFile(), "DummyFawe.src", pluginsFolder, "DummyFawe.jar"); diff --git a/worldedit-bukkit/src/main/resources/DummyFawe.src b/worldedit-bukkit/src/main/resources/DummyFawe.src index d41a1a0efe2dde47be13726aa3192a33a6538655..5fd4b7be3b6cd50df1067d345e1d8f0aaefea779 100644 GIT binary patch delta 1105 zcmV-X1g`tU58w~55(0nP0?kgyn+(a*0{{T_6aWAU0001RY;|X8ZZ3IkY>k-Bj^j2A z$L|B=9fCa;h=FZS&8-D?U!jMh2U?sz;iw>q6;DX)n1opIhJ0pLK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W(VOwPCD4ldaaEd|Gdi$6~*{rxXfD;m+jmS4Kj4J?)n3(0Y$9 zSQ#4&&d!BByVyjq!$8=Oi#4h1%7&@g7@A6;O#y!c12nT{p;906RZ7}u8bWem^FArO zxI)!_@HXl`AJl;3(FQI{iI^0l)A9%xY+*#w-p~YkOznYn{%~|Y@+dk=?KNGgRL0O- z^}*B6h>JBRQhP}iFO6xJy5p5#*T6)-_MsMZgivUaHz=Tyx>AJ^^)QCY^kA;VayAt_ z39WyJ7_FoxTk?0*LS0=|F2pNaQmS{N!3{V^6+c|mZdaxz1#i?{%9gS6?Q}afm$H5E zNj8Ma%&c3wO?vTy8L$ma8v?xsYNJbC@grH1<}W_m(W;n#@hlff+QyzV$D(2h)>0Cg zl-}HBrUzfTN>_$_7t_Q3!MtNiPv;e=W^!B;D!x1=2(Xv4qzc!QwQApMqDt26Fn{+i zIoog~kSwjw)%G8gt_B>l9|l_i4GeshPRwG~khcQ>0Fjf22P+Ru6jZ22_|yS1 U+mMb%_|%iZ2N?$E1poj50KHTAGynhq diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushOptionsCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushOptionsCommands.java index 716682532..6cd61bce0 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushOptionsCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/BrushOptionsCommands.java @@ -203,6 +203,7 @@ public class BrushOptionsCommands extends MethodCommands { help = "Set the right click brush", min = 1 ) + @CommandPermissions("worldedit.brush.primary") public void primary(Player player, LocalSession session, CommandContext args) throws WorldEditException { BaseItem item = player.getItemInHand(HandSide.MAIN_HAND); BrushTool tool = session.getBrushTool(player, false); @@ -223,6 +224,7 @@ public class BrushOptionsCommands extends MethodCommands { help = "Set the left click brush", min = 1 ) + @CommandPermissions("worldedit.brush.secondary") public void secondary(Player player, LocalSession session, CommandContext args) throws WorldEditException { BaseItem item = player.getItemInHand(HandSide.MAIN_HAND); BrushTool tool = session.getBrushTool(player, false); @@ -247,6 +249,7 @@ public class BrushOptionsCommands extends MethodCommands { min = 0, max = 1 ) + @CommandPermissions("worldedit.brush.visualize") public void visual(Player player, LocalSession session, @Range(min = 0, max = 2)int mode) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { @@ -266,6 +269,7 @@ public class BrushOptionsCommands extends MethodCommands { min = 0, max = 1 ) + @CommandPermissions("worldedit.brush.target") public void target(Player player, LocalSession session, @Optional("0") int mode) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { @@ -285,6 +289,7 @@ public class BrushOptionsCommands extends MethodCommands { min = 1, max = -1 ) + @CommandPermissions("worldedit.brush.targetmask") public void targetMask(Player player, EditSession editSession, LocalSession session, CommandContext context) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { @@ -308,6 +313,7 @@ public class BrushOptionsCommands extends MethodCommands { min = 1, max = -1 ) + @CommandPermissions("worldedit.brush.targetoffset") public void targetOffset(Player player, EditSession editSession, LocalSession session, int offset) throws WorldEditException { BrushTool tool = session.getBrushTool(player, false); if (tool == null) { @@ -325,6 +331,7 @@ public class BrushOptionsCommands extends MethodCommands { min = 1, max = -1 ) + @CommandPermissions("worldedit.brush.scroll") public void scroll(Player player, EditSession editSession, LocalSession session, @Optional @Switch('h') boolean offHand, CommandContext args) throws WorldEditException { BrushTool bt = session.getBrushTool(player, false); if (bt == null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java index 2088302a2..edb5a0dfd 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/OptionsCommands.java @@ -51,6 +51,7 @@ public class OptionsCommands { aliases = {"/tips", "tips"}, desc = "Toggle FAWE tips" ) + @CommandPermissions("fawe.tips") public void tips(Player player, LocalSession session) throws WorldEditException { FawePlayer fp = FawePlayer.wrap(player); if (fp.toggle("fawe.tips")) { @@ -318,6 +319,7 @@ public class OptionsCommands { min = 1, max = 1 ) + @CommandPermissions("worldedit.searchitem") public void searchItem(Actor actor, CommandContext args) throws WorldEditException { String query = args.getString(0).trim().toLowerCase(); diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java index 3250ed82e..15af47b97 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ScriptingCommands.java @@ -73,6 +73,7 @@ public class ScriptingCommands { min = 1, max = 1 ) + @CommandPermissions("fawe.setupdispatcher") public void setupdispatcher(Player player, LocalSession session, final CommandContext args) throws WorldEditException { CommandManager.getInstance().setupDispatcher(); } diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 0a2bd2f2e..8e893f2a8 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -121,6 +121,7 @@ public class UtilityCommands extends MethodCommands { "More Info: https://git.io/vSPmA", queued = false ) + @CommandPermissions("worldedit.patterns") public void patterns(Player player, LocalSession session, CommandContext args) throws WorldEditException { displayModifierHelp(player, DefaultPatternParser.class, args); } @@ -137,6 +138,7 @@ public class UtilityCommands extends MethodCommands { "More Info: https://git.io/v9r4K", queued = false ) + @CommandPermissions("worldedit.masks") public void masks(Player player, LocalSession session, CommandContext args) throws WorldEditException { displayModifierHelp(player, DefaultMaskParser.class, args); } @@ -152,6 +154,7 @@ public class UtilityCommands extends MethodCommands { "More Info: https://git.io/v9KHO", queued = false ) + @CommandPermissions("worldedit.transforms") public void transforms(Player player, LocalSession session, CommandContext args) throws WorldEditException { displayModifierHelp(player, DefaultTransformParser.class, args); } @@ -243,6 +246,7 @@ public class UtilityCommands extends MethodCommands { max = 0, queued = false ) + @CommandPermissions("fawe.cancel") public void cancel(FawePlayer player) { int cancelled = player.cancel(false); BBC.WORLDEDIT_CANCEL_COUNT.send(player, cancelled); @@ -673,6 +677,7 @@ public class UtilityCommands extends MethodCommands { aliases = {"/confirm"}, desc = "Confirm a command" ) + @CommandPermissions("fawe.confirm") public void confirm(FawePlayer fp) throws WorldEditException { if (!fp.confirm()) { BBC.NOTHING_CONFIRMED.send(fp);