mirror of
https://github.com/5vl/Staff.git
synced 2025-05-24 10:56:59 +00:00
Did more config stuff and added to readme.md
This commit is contained in:
parent
a9d81942f6
commit
d4332868c4
19
README.md
19
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
|
@ -4,4 +4,6 @@ import org.bukkit.configuration.file.FileConfiguration
|
|||||||
|
|
||||||
object Config {
|
object Config {
|
||||||
var config: FileConfiguration? = null
|
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
|
package me.fivevl.staff.commands
|
||||||
|
|
||||||
|
import me.fivevl.staff.Config
|
||||||
import me.fivevl.staff.Utils
|
import me.fivevl.staff.Utils
|
||||||
import org.bukkit.command.Command
|
import org.bukkit.command.Command
|
||||||
import org.bukkit.command.CommandExecutor
|
import org.bukkit.command.CommandExecutor
|
||||||
@ -9,10 +10,14 @@ import org.bukkit.entity.Player
|
|||||||
class StaffModeCommand : CommandExecutor {
|
class StaffModeCommand : CommandExecutor {
|
||||||
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
|
override fun onCommand(sender: CommandSender, command: Command, label: String, args: Array<out String>): Boolean {
|
||||||
if (sender !is Player) {
|
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
|
return true
|
||||||
}
|
}
|
||||||
val p = sender.player
|
|
||||||
return true
|
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!"
|
Loading…
x
Reference in New Issue
Block a user