package de.viper.survivalplus;

import org.bukkit.GameMode;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerJoinEvent;

public class ForceSurvivalListener implements Listener {

    private final SurvivalPlus plugin;

    public ForceSurvivalListener(SurvivalPlus plugin) {
        this.plugin = plugin;
    }

    @EventHandler
    public void onPlayerJoin(PlayerJoinEvent event) {
        Player player = event.getPlayer();
        // Spieler in Survival setzen
        if (player.getGameMode() != GameMode.SURVIVAL) {
            player.setGameMode(GameMode.SURVIVAL);
            player.sendMessage(plugin.getMessage("force-survival.join-message"));
        }
    }
}
