Dateien nach "src/main/java/de/viper/survivalplus/listeners" hochladen
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user