package uk.co.eluinhost.ultrahardcore.features.playerfreeze;

import uk.co.eluinhost.ultrahardcore.features.UHCFeature;

import java.util.HashSet;
import java.util.Set;

public class PlayerFreezeFeature extends UHCFeature {

    private Set<String> m_players = new HashSet<String>();

    /**
     * handles frozen players
     */
    public PlayerFreezeFeature() {
        super("PlayerFreeze", "Allows for freezing players in place");
    }

    /**
     * @param playerName the player name to freeze
     */
    public void addPlayer(String playerName){
        m_players.add(playerName);
        //TODO stop movement
    }

    /**
     * @param playerName the player name
     */
    public void removePlayer(String playerName){
        m_players.remove(playerName);
        //TODO allow movement
    }

    /**
     * Remove all from the frozen list
     */
    public void unfreezeAll(){
        //TODO allow movement for all
        m_players.clear();
    }
}

@@ -51,24 +51,110 @@
 yerfreeze;%0A%0A
+import org.bukkit.event.EventHandler;%0Aimport org.bukkit.event.player.PlayerJoinEvent;%0A
 import uk.co
@@ -1044,11 +1044,534 @@
 );%0A    %7D
+%0A%0A    /**%0A     * Whenever a player joins%0A     * @param pje the player join event%0A     */%0A    @EventHandler%0A    public void onPlayerJoinEvent(PlayerJoinEvent pje)%7B%0A        //TODO check whether to reapply freeze%0A    %7D%0A%0A    /**%0A     * Called when the feature is being enabled%0A     */%0A    @Override%0A    protected void enableCallback()%7B%0A        //TODO reapply freezes?%0A    %7D%0A%0A    /**%0A     * Called when the feature is being disabled%0A     */%0A    @Override%0A    protected void disableCallback()%7B%0A        //TODO remove freezes%0A    %7D
 %0A%7D%0A

add callbacks