diff --git a/README.md b/README.md index 5cf93b8..8dd2ec8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,19 @@ -# Staff - +I made this plugin by request of a friend, and because I didn't have anything to do. + +# Features: +- PlaceholderAPI support +- Staffmode +- Freezing (through command or freeze wand in staffmode) +- Open inventory (through command or inventory wand in staffmode) +- Knockback Stick (in staffmode) + +# Commands and permissions: +- /staffmode - staff.staffmode +- /freeze - staff.freeze +- /openinv - staff.openinv + +# Staff mode items: +- Disable staffmode - staff.staffmode +- Freeze wand - staff.freeze.wand +- Inventory wand - staff.openinv.wand +- Knockback Stick - staff.kbstick \ No newline at end of file diff --git a/src/main/java/me/fivevl/staff/Config.kt b/src/main/java/me/fivevl/staff/Config.kt index 3f33d58..b559c7a 100644 --- a/src/main/java/me/fivevl/staff/Config.kt +++ b/src/main/java/me/fivevl/staff/Config.kt @@ -4,4 +4,6 @@ import org.bukkit.configuration.file.FileConfiguration object Config { var config: FileConfiguration? = null + val mustBePlayer = config?.getString("must-be-player") + val noPermission = config?.getString("no-permission") } \ No newline at end of file diff --git a/src/main/java/me/fivevl/staff/commands/StaffModeCommand.kt b/src/main/java/me/fivevl/staff/commands/StaffModeCommand.kt index 69e98fc..069a63e 100644 --- a/src/main/java/me/fivevl/staff/commands/StaffModeCommand.kt +++ b/src/main/java/me/fivevl/staff/commands/StaffModeCommand.kt @@ -1,5 +1,6 @@ package me.fivevl.staff.commands +import me.fivevl.staff.Config import me.fivevl.staff.Utils import org.bukkit.command.Command import org.bukkit.command.CommandExecutor @@ -9,10 +10,14 @@ import org.bukkit.entity.Player class StaffModeCommand : CommandExecutor { override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array): Boolean { if (sender !is Player) { - sender.sendMessage(Utils.hex(Utils.getPlaceholders(null, "&cYou must be a player to use this command!"))) + sender.sendMessage(Utils.hex(Utils.getPlaceholders(null, Config.mustBePlayer!!))) + return true + } + val p = sender.player!! + if (!p.hasPermission("staff.staffmode")) { + p.sendMessage(Utils.hex(Utils.getPlaceholders(p, Config.noPermission!!))) return true } - val p = sender.player return true } } \ No newline at end of file diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index fb97945..48d330a 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -1 +1,2 @@ -must-be-player: "&cYou must be a player to use this command!" \ No newline at end of file +must-be-player: "&cYou must be a player to use this command!" +no-permission: "&cYou don't have permission to use this command!" \ No newline at end of file