-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: game mode change logger listener
- Loading branch information
1 parent
36c45cf
commit 50b621b
Showing
3 changed files
with
22 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/com/github/mori01231/lifecore/listener/GameModeChangeLoggerListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package com.github.mori01231.lifecore.listener; | ||
|
||
import com.github.mori01231.lifecore.LifeCore; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerGameModeChangeEvent; | ||
|
||
public class GameModeChangeLoggerListener implements Listener { | ||
private final LifeCore plugin; | ||
|
||
public GameModeChangeLoggerListener(LifeCore plugin) { | ||
this.plugin = plugin; | ||
} | ||
|
||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) | ||
public void onGameModeChange(PlayerGameModeChangeEvent e) { | ||
plugin.getLogger().info("Game mode of " + e.getPlayer().getName() + " changed from " + e.getPlayer().getGameMode().name() + " to " + e.getNewGameMode().name()); | ||
} | ||
} |