1.0 #7

Merged
edraft merged 11 commits from 1.0 into master 2023-06-16 10:40:06 +02:00
Showing only changes of commit bc5f7f4d9b - Show all commits

View File

@ -4,6 +4,7 @@ import de.sh_edraft.config.Config
import de.sh_edraft.data.DataService
import de.sh_edraft.events.OnJoinListener
import de.sh_edraft.events.OnLeftListener
import org.bukkit.Bukkit
import org.bukkit.plugin.java.JavaPlugin
open class OntimeHandlerPlugin() : JavaPlugin() {
@ -27,6 +28,16 @@ open class OntimeHandlerPlugin() : JavaPlugin() {
}
override fun onDisable() {
try {
for (player in Bukkit.getOnlinePlayers()) {
logger.info("Logout player" + player.displayName)
val playerId = this.dataService.getPlayerGlobalId(player.player!!.displayName) ?: return
this.dataService.sendLeftPlayer(playerId)
}
} catch (ex: Exception) {
logger.severe(ex.message)
}
logger.info("OntimeHandlerPlugin disabled :(")
}
}