added config

This commit is contained in:
5vl 2022-05-05 20:21:38 +02:00
parent 0ecf3efec0
commit f6cdb00c29
No known key found for this signature in database
GPG Key ID: DA8938F22548E4D5
3 changed files with 27 additions and 1 deletions

View 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) {
}
}

View File

@ -1,10 +1,13 @@
package me.fivevl.deathban package me.fivevl.deathban
import org.bukkit.Bukkit
import org.bukkit.plugin.java.JavaPlugin import org.bukkit.plugin.java.JavaPlugin
class Main : JavaPlugin() { class Main : JavaPlugin() {
override fun onEnable() { 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() { override fun onDisable() {

View 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.