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.
Dieser Commit ist enthalten in:
NotMyFault 2019-06-13 00:48:40 +02:00
Ursprung 1f14d4652e
Commit 5f037df326
6 geänderte Dateien mit 16 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -273,7 +273,7 @@ public class WorldEditPlugin extends JavaPlugin { //implements TabCompleter
} }
File pluginsFolder = MainUtil.getJarFile().getParentFile(); File pluginsFolder = MainUtil.getJarFile().getParentFile();
for (File file : pluginsFolder.listFiles()) { for (File file : pluginsFolder.listFiles()) {
if (file.length() == 1988) return; if (file.length() == 2016) return;
} }
Plugin plugin = Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit"); Plugin plugin = Bukkit.getPluginManager().getPlugin("FastAsyncWorldEdit");
File dummy = MainUtil.copyFile(MainUtil.getJarFile(), "DummyFawe.src", pluginsFolder, "DummyFawe.jar"); File dummy = MainUtil.copyFile(MainUtil.getJarFile(), "DummyFawe.src", pluginsFolder, "DummyFawe.jar");

Datei anzeigen

@ -203,6 +203,7 @@ public class BrushOptionsCommands extends MethodCommands {
help = "Set the right click brush", help = "Set the right click brush",
min = 1 min = 1
) )
@CommandPermissions("worldedit.brush.primary")
public void primary(Player player, LocalSession session, CommandContext args) throws WorldEditException { public void primary(Player player, LocalSession session, CommandContext args) throws WorldEditException {
BaseItem item = player.getItemInHand(HandSide.MAIN_HAND); BaseItem item = player.getItemInHand(HandSide.MAIN_HAND);
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
@ -223,6 +224,7 @@ public class BrushOptionsCommands extends MethodCommands {
help = "Set the left click brush", help = "Set the left click brush",
min = 1 min = 1
) )
@CommandPermissions("worldedit.brush.secondary")
public void secondary(Player player, LocalSession session, CommandContext args) throws WorldEditException { public void secondary(Player player, LocalSession session, CommandContext args) throws WorldEditException {
BaseItem item = player.getItemInHand(HandSide.MAIN_HAND); BaseItem item = player.getItemInHand(HandSide.MAIN_HAND);
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
@ -247,6 +249,7 @@ public class BrushOptionsCommands extends MethodCommands {
min = 0, min = 0,
max = 1 max = 1
) )
@CommandPermissions("worldedit.brush.visualize")
public void visual(Player player, LocalSession session, @Range(min = 0, max = 2)int mode) throws WorldEditException { public void visual(Player player, LocalSession session, @Range(min = 0, max = 2)int mode) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
@ -266,6 +269,7 @@ public class BrushOptionsCommands extends MethodCommands {
min = 0, min = 0,
max = 1 max = 1
) )
@CommandPermissions("worldedit.brush.target")
public void target(Player player, LocalSession session, @Optional("0") int mode) throws WorldEditException { public void target(Player player, LocalSession session, @Optional("0") int mode) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
@ -285,6 +289,7 @@ public class BrushOptionsCommands extends MethodCommands {
min = 1, min = 1,
max = -1 max = -1
) )
@CommandPermissions("worldedit.brush.targetmask")
public void targetMask(Player player, EditSession editSession, LocalSession session, CommandContext context) throws WorldEditException { public void targetMask(Player player, EditSession editSession, LocalSession session, CommandContext context) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
@ -308,6 +313,7 @@ public class BrushOptionsCommands extends MethodCommands {
min = 1, min = 1,
max = -1 max = -1
) )
@CommandPermissions("worldedit.brush.targetoffset")
public void targetOffset(Player player, EditSession editSession, LocalSession session, int offset) throws WorldEditException { public void targetOffset(Player player, EditSession editSession, LocalSession session, int offset) throws WorldEditException {
BrushTool tool = session.getBrushTool(player, false); BrushTool tool = session.getBrushTool(player, false);
if (tool == null) { if (tool == null) {
@ -325,6 +331,7 @@ public class BrushOptionsCommands extends MethodCommands {
min = 1, min = 1,
max = -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 { public void scroll(Player player, EditSession editSession, LocalSession session, @Optional @Switch('h') boolean offHand, CommandContext args) throws WorldEditException {
BrushTool bt = session.getBrushTool(player, false); BrushTool bt = session.getBrushTool(player, false);
if (bt == null) { if (bt == null) {

Datei anzeigen

@ -51,6 +51,7 @@ public class OptionsCommands {
aliases = {"/tips", "tips"}, aliases = {"/tips", "tips"},
desc = "Toggle FAWE tips" desc = "Toggle FAWE tips"
) )
@CommandPermissions("fawe.tips")
public void tips(Player player, LocalSession session) throws WorldEditException { public void tips(Player player, LocalSession session) throws WorldEditException {
FawePlayer<Object> fp = FawePlayer.wrap(player); FawePlayer<Object> fp = FawePlayer.wrap(player);
if (fp.toggle("fawe.tips")) { if (fp.toggle("fawe.tips")) {
@ -318,6 +319,7 @@ public class OptionsCommands {
min = 1, min = 1,
max = 1 max = 1
) )
@CommandPermissions("worldedit.searchitem")
public void searchItem(Actor actor, CommandContext args) throws WorldEditException { public void searchItem(Actor actor, CommandContext args) throws WorldEditException {
String query = args.getString(0).trim().toLowerCase(); String query = args.getString(0).trim().toLowerCase();

Datei anzeigen

@ -73,6 +73,7 @@ public class ScriptingCommands {
min = 1, min = 1,
max = 1 max = 1
) )
@CommandPermissions("fawe.setupdispatcher")
public void setupdispatcher(Player player, LocalSession session, final CommandContext args) throws WorldEditException { public void setupdispatcher(Player player, LocalSession session, final CommandContext args) throws WorldEditException {
CommandManager.getInstance().setupDispatcher(); CommandManager.getInstance().setupDispatcher();
} }

Datei anzeigen

@ -121,6 +121,7 @@ public class UtilityCommands extends MethodCommands {
"More Info: https://git.io/vSPmA", "More Info: https://git.io/vSPmA",
queued = false queued = false
) )
@CommandPermissions("worldedit.patterns")
public void patterns(Player player, LocalSession session, CommandContext args) throws WorldEditException { public void patterns(Player player, LocalSession session, CommandContext args) throws WorldEditException {
displayModifierHelp(player, DefaultPatternParser.class, args); displayModifierHelp(player, DefaultPatternParser.class, args);
} }
@ -137,6 +138,7 @@ public class UtilityCommands extends MethodCommands {
"More Info: https://git.io/v9r4K", "More Info: https://git.io/v9r4K",
queued = false queued = false
) )
@CommandPermissions("worldedit.masks")
public void masks(Player player, LocalSession session, CommandContext args) throws WorldEditException { public void masks(Player player, LocalSession session, CommandContext args) throws WorldEditException {
displayModifierHelp(player, DefaultMaskParser.class, args); displayModifierHelp(player, DefaultMaskParser.class, args);
} }
@ -152,6 +154,7 @@ public class UtilityCommands extends MethodCommands {
"More Info: https://git.io/v9KHO", "More Info: https://git.io/v9KHO",
queued = false queued = false
) )
@CommandPermissions("worldedit.transforms")
public void transforms(Player player, LocalSession session, CommandContext args) throws WorldEditException { public void transforms(Player player, LocalSession session, CommandContext args) throws WorldEditException {
displayModifierHelp(player, DefaultTransformParser.class, args); displayModifierHelp(player, DefaultTransformParser.class, args);
} }
@ -243,6 +246,7 @@ public class UtilityCommands extends MethodCommands {
max = 0, max = 0,
queued = false queued = false
) )
@CommandPermissions("fawe.cancel")
public void cancel(FawePlayer player) { public void cancel(FawePlayer player) {
int cancelled = player.cancel(false); int cancelled = player.cancel(false);
BBC.WORLDEDIT_CANCEL_COUNT.send(player, cancelled); BBC.WORLDEDIT_CANCEL_COUNT.send(player, cancelled);
@ -673,6 +677,7 @@ public class UtilityCommands extends MethodCommands {
aliases = {"/confirm"}, aliases = {"/confirm"},
desc = "Confirm a command" desc = "Confirm a command"
) )
@CommandPermissions("fawe.confirm")
public void confirm(FawePlayer fp) throws WorldEditException { public void confirm(FawePlayer fp) throws WorldEditException {
if (!fp.confirm()) { if (!fp.confirm()) {
BBC.NOTHING_CONFIRMED.send(fp); BBC.NOTHING_CONFIRMED.send(fp);