mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-24 00:26:16 +02:00
Initial commit
This commit is contained in:
commit
e53f9cc88c
14 changed files with 939 additions and 0 deletions
40
src/main/kotlin/io/delilaheve/UnsafeEnchants.kt
Normal file
40
src/main/kotlin/io/delilaheve/UnsafeEnchants.kt
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
package io.delilaheve
|
||||
|
||||
import io.delilaheve.util.ConfigOptions
|
||||
import org.bukkit.plugin.java.JavaPlugin
|
||||
|
||||
/**
|
||||
* Bukkit/Spigot/Paper plugin to alter enchantment max
|
||||
* levels and allow unsafe enchantment combinations
|
||||
*/
|
||||
class UnsafeEnchants : JavaPlugin() {
|
||||
|
||||
companion object {
|
||||
// Permission string required to use the plugin's features
|
||||
const val unsafePermission = "ue.unsafe"
|
||||
// Current plugin instance
|
||||
lateinit var instance: UnsafeEnchants
|
||||
|
||||
/**
|
||||
* Logging handler
|
||||
*/
|
||||
fun log(message: String) {
|
||||
if (ConfigOptions.debugLog) {
|
||||
instance.logger.info(message)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup plugin for use
|
||||
*/
|
||||
override fun onEnable() {
|
||||
instance = this
|
||||
saveDefaultConfig()
|
||||
server.pluginManager.registerEvents(
|
||||
AnvilEventListener(),
|
||||
this
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue