From 41e5a05f93ce7f6daa8b89f5c4c15276eb0a2864 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Tue, 29 Dec 2015 17:02:53 +0100 Subject: [PATCH] Permissions are now defined in the plugin.yml --- .../dre2n/dungeonsxl/command/ChatCommand.java | 1 + .../dre2n/dungeonsxl/command/EditCommand.java | 1 + .../dungeonsxl/command/EscapeCommand.java | 1 + .../dre2n/dungeonsxl/command/HelpCommand.java | 1 + .../dungeonsxl/command/LeaveCommand.java | 1 + .../dre2n/dungeonsxl/command/ListCommand.java | 1 + .../dungeonsxl/command/LivesCommand.java | 1 + .../dre2n/dungeonsxl/command/MainCommand.java | 1 + src/plugin.yml | 49 ++++++++++++++++++- 9 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/io/github/dre2n/dungeonsxl/command/ChatCommand.java b/src/io/github/dre2n/dungeonsxl/command/ChatCommand.java index dc86e038..3bfa7095 100644 --- a/src/io/github/dre2n/dungeonsxl/command/ChatCommand.java +++ b/src/io/github/dre2n/dungeonsxl/command/ChatCommand.java @@ -14,6 +14,7 @@ public class ChatCommand extends DCommand { setMinArgs(0); setMaxArgs(0); setHelp(dMessages.getMessage(Messages.HELP_CMD_CHAT)); + setPermission("dxl.chat"); setPlayerCommand(true); } diff --git a/src/io/github/dre2n/dungeonsxl/command/EditCommand.java b/src/io/github/dre2n/dungeonsxl/command/EditCommand.java index 8f8722f1..f6cf255c 100644 --- a/src/io/github/dre2n/dungeonsxl/command/EditCommand.java +++ b/src/io/github/dre2n/dungeonsxl/command/EditCommand.java @@ -16,6 +16,7 @@ public class EditCommand extends DCommand { setMinArgs(1); setMaxArgs(1); setHelp(dMessages.getMessage(Messages.HELP_CMD_EDIT)); + setPermission("dxl.edit"); setPlayerCommand(true); } diff --git a/src/io/github/dre2n/dungeonsxl/command/EscapeCommand.java b/src/io/github/dre2n/dungeonsxl/command/EscapeCommand.java index 1855da5f..2b5f05e0 100644 --- a/src/io/github/dre2n/dungeonsxl/command/EscapeCommand.java +++ b/src/io/github/dre2n/dungeonsxl/command/EscapeCommand.java @@ -16,6 +16,7 @@ public class EscapeCommand extends DCommand { setMinArgs(0); setMaxArgs(0); setHelp(dMessages.getMessage(Messages.HELP_CMD_ESCAPE)); + setPermission("dxl.escape"); setPlayerCommand(true); } diff --git a/src/io/github/dre2n/dungeonsxl/command/HelpCommand.java b/src/io/github/dre2n/dungeonsxl/command/HelpCommand.java index 53037aa2..89b670bd 100644 --- a/src/io/github/dre2n/dungeonsxl/command/HelpCommand.java +++ b/src/io/github/dre2n/dungeonsxl/command/HelpCommand.java @@ -16,6 +16,7 @@ public class HelpCommand extends DCommand { setMinArgs(0); setMaxArgs(1); setHelp(dMessages.getMessage(Messages.HELP_CMD_HELP)); + setPermission("dxl.help"); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/io/github/dre2n/dungeonsxl/command/LeaveCommand.java b/src/io/github/dre2n/dungeonsxl/command/LeaveCommand.java index f931c1bb..884da38e 100644 --- a/src/io/github/dre2n/dungeonsxl/command/LeaveCommand.java +++ b/src/io/github/dre2n/dungeonsxl/command/LeaveCommand.java @@ -16,6 +16,7 @@ public class LeaveCommand extends DCommand { setMinArgs(0); setMaxArgs(0); setHelp(dMessages.getMessage(Messages.HELP_CMD_LEAVE)); + setPermission("dxl.leave"); setPlayerCommand(true); } diff --git a/src/io/github/dre2n/dungeonsxl/command/ListCommand.java b/src/io/github/dre2n/dungeonsxl/command/ListCommand.java index eb90a66a..e4c26907 100644 --- a/src/io/github/dre2n/dungeonsxl/command/ListCommand.java +++ b/src/io/github/dre2n/dungeonsxl/command/ListCommand.java @@ -21,6 +21,7 @@ public class ListCommand extends DCommand { setMinArgs(0); setMaxArgs(3); setHelp(dMessages.getMessage(Messages.HELP_CMD_LIST)); + setPermission("dxl.list"); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/io/github/dre2n/dungeonsxl/command/LivesCommand.java b/src/io/github/dre2n/dungeonsxl/command/LivesCommand.java index 7b09e047..4b246124 100644 --- a/src/io/github/dre2n/dungeonsxl/command/LivesCommand.java +++ b/src/io/github/dre2n/dungeonsxl/command/LivesCommand.java @@ -15,6 +15,7 @@ public class LivesCommand extends DCommand { setMinArgs(0); setMaxArgs(1); setHelp(dMessages.getMessage(Messages.HELP_CMD_LIVES)); + setPermission("dxl.lives"); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/io/github/dre2n/dungeonsxl/command/MainCommand.java b/src/io/github/dre2n/dungeonsxl/command/MainCommand.java index 571baeff..47176eff 100644 --- a/src/io/github/dre2n/dungeonsxl/command/MainCommand.java +++ b/src/io/github/dre2n/dungeonsxl/command/MainCommand.java @@ -16,6 +16,7 @@ public class MainCommand extends DCommand { public MainCommand() { setCommand("main"); setHelp(dMessages.getMessage(Messages.HELP_CMD_MAIN)); + setPermission("dxl.main"); setPlayerCommand(true); setConsoleCommand(true); } diff --git a/src/plugin.yml b/src/plugin.yml index ccfe93ec..52d49253 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -3,9 +3,56 @@ main: io.github.dre2n.dungeonsxl.DungeonsXL version: 0.10-SNAPSHOT author: Frank Baumann authors: [Frank Baumann, Milan Albrecht, Tobias Schmitz, Daniel Saukel] -website: http://dre2n.github.io +website: https://dre2n.github.io softdepend: [Vault, MythicMobs, CommandsXL] commands: dungeonsxl: description: Reference command for DungeonsXL. aliases: [dxl,dungeon] +permissions: + dxl.break: + default: op + dxl.chat: + default: true + dxl.chatspy: + default: op + dxl.create: + default: op + dxl.edit: + default: op + dxl.escape: + default: true + dxl.help: + default: true + dxl.invite: + default: op + dxl.leave: + default: true + dxl.list: + default: true + dxl.lives: + default: true + dxl.main: + default: true + dxl.msg: + default: op + dxl.play: + default: op + dxl.portal: + default: op + dxl.reload: + default: op + dxl.save: + default: op + dxl.test: + default: op + dxl.uninvite: + default: op + dxl.ignoretimelimit: + default: op + dxl.sign: + default: op + dxl.bypass: + default: op + dxl.cmdedit: + default: op