Skip to content

Commit

Permalink
Merge pull request #27 from Skyslycer/patch/enabled-check-before-regi…
Browse files Browse the repository at this point in the history
…stering

add isEnabled check before registering additional listeners
  • Loading branch information
jakobkmar committed Sep 16, 2021
2 parents 618c828 + db3dc0d commit cf1492c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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\"."

Expand Down
5 changes: 4 additions & 1 deletion src/main/kotlin/net/axay/kspigot/main/KSpigot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit cf1492c

Please sign in to comment.