Merge pull request #27 from Skyslycer/patch/enabled-check-before-registering

add isEnabled check before registering additional listeners
This commit is contained in:
Jakob K
2021-09-16 21:04:42 +02:00
committed by GitHub
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() {