add isEnabled check before registering additional listeners

This commit is contained in:
Skyslycer
2021-09-16 21:02:21 +02:00
parent 618c8285a8
commit db3dc0d0f6
2 changed files with 5 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val githubRepo = "jakobkmar/KSpigot"
group = "net.axay"
version = "1.17.3"
version = "1.17.4"
description = "A Kotlin API for the Minecraft Server Software \"Spigot\"."

View File

@@ -66,7 +66,10 @@ abstract class KSpigot : JavaPlugin() {
final override fun onEnable() {
startup()
BrigardierSupport.registerAll()
// Only register the listeners, when the plugin is still enabled and didn't get disabled in the shutdown method
if (this.isEnabled) {
BrigardierSupport.registerAll()
}
}
final override fun onDisable() {