Dateien nach "src/main/java/de/viper/survivalplus/listeners" hochladen

This commit is contained in:
2025-08-04 05:08:39 +00:00
parent 7700c588ff
commit c237f2b8c3

View File

@@ -0,0 +1,28 @@
package de.viper.survivalplus.listeners;
import de.viper.survivalplus.commands.FriendCommand;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
public class PlayerJoinListener implements Listener {
private final FriendCommand friendCommand;
public PlayerJoinListener(FriendCommand friendCommand) {
this.friendCommand = friendCommand;
}
@EventHandler
public void onPlayerJoin(PlayerJoinEvent event) {
Player player = event.getPlayer();
friendCommand.notifyFriendsOfJoin(player);
}
@EventHandler
public void onPlayerQuit(PlayerQuitEvent event) {
Player player = event.getPlayer();
friendCommand.updateLastOnline(player);
}
}