mirror of
https://github.com/5vl/Staff.git
synced 2025-10-30 21:23:33 +00:00
Did more config stuff and added to readme.md
This commit is contained in:
@@ -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")
|
||||
}
|
||||
@@ -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<out String>): 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
|
||||
}
|
||||
}
|
||||
@@ -1 +1,2 @@
|
||||
must-be-player: "&cYou must be a player to use this command!"
|
||||
must-be-player: "&cYou must be a player to use this command!"
|
||||
no-permission: "&cYou don't have permission to use this command!"
|
||||
Reference in New Issue
Block a user