mirror of
https://github.com/5vl/DeathBan.git
synced 2025-07-09 03:26:58 +00:00
added config
This commit is contained in:
parent
0ecf3efec0
commit
f6cdb00c29
20
src/main/java/me/fivevl/deathban/Listener.kt
Normal file
20
src/main/java/me/fivevl/deathban/Listener.kt
Normal file
@ -0,0 +1,20 @@
|
||||
package me.fivevl.deathban
|
||||
|
||||
import org.bukkit.event.EventHandler
|
||||
import org.bukkit.event.entity.PlayerDeathEvent
|
||||
|
||||
class Listener(instance: Main) : org.bukkit.event.Listener {
|
||||
private var permission = ""
|
||||
private var message = ""
|
||||
private var time = 0
|
||||
|
||||
init {
|
||||
this.permission = instance.config.getString("bypass-permission")!!
|
||||
this.time = instance.config.getInt("deathban-time")
|
||||
this.message = instance.config.getString("deathban-message")!!.replace("%time%", time.toString())
|
||||
}
|
||||
@EventHandler
|
||||
fun onDeath(e: PlayerDeathEvent) {
|
||||
|
||||
}
|
||||
}
|
@ -1,10 +1,13 @@
|
||||
package me.fivevl.deathban
|
||||
|
||||
import org.bukkit.Bukkit
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
|
||||
class Main : JavaPlugin() {
|
||||
override fun onEnable() {
|
||||
// Plugin startup logic
|
||||
logger.info("Deathban plugin by 5vl for u/SkiryHatesEmoji")
|
||||
saveDefaultConfig()
|
||||
Bukkit.getPluginManager().registerEvents(Listener(this), this)
|
||||
}
|
||||
|
||||
override fun onDisable() {
|
||||
|
3
src/main/resources/config.yml
Normal file
3
src/main/resources/config.yml
Normal file
@ -0,0 +1,3 @@
|
||||
deathban-time: 90 #This is in minutes.
|
||||
deathban-message: "You have been deathbanned for %time% minutes." #Message shown to the player when they are deathbanned. %time% is replaced with the time the player is deathbanned for.
|
||||
bypass-permission: "deathban.bypass" #Permission required to bypass deathban.
|
Loading…
x
Reference in New Issue
Block a user