Skip to content

Commit

Permalink
feat: add PlayerLoginListener
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucky3028 committed Sep 3, 2022
1 parent 26a8733 commit a7e90d9
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package click.seichi.timetogo.presenter.listener

import click.seichi.timetogo.presenter.TimeToGo.useCase
import org.bukkit.event.player.PlayerJoinEvent
import org.bukkit.event.{EventHandler, Listener}

object PlayerLoginListener extends Listener {
@EventHandler
def onPlayerLogin(event: PlayerJoinEvent): Unit = {
useCase.enabledModeTime match {
case Some(modeTime) => event.getPlayer.setGameMode(modeTime.gameMode.asBukkit)
case _ =>
}
}
}

0 comments on commit a7e90d9

Please sign in to comment.