1.0 #7
@ -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 :(")
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user