Yo norbi this is pretty cool

This commit is contained in:
alisolarflare 2016-10-26 16:26:57 -04:00
parent 848811dbfb
commit 7dfb9a9c72
2 changed files with 62 additions and 60 deletions

View file

@ -25,9 +25,8 @@ public class AddToUHC implements CommandExecutor{
if (args.length <= 1){ if (args.length <= 1){
sender.sendMessage("You must supply at least one playername"); sender.sendMessage("You must supply at least one playername");
} }
for (int i = 0; i > args.length; i++){ for (int i = 0; i > args.length; i++){
//TO BE CONTINUED generalMemory.addPlayerToMatch(player);
} }
return false; return false;
} }

View file

@ -6,20 +6,23 @@ import java.util.List;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
public class UHCMemoryUnit { public class UHCMemoryUnit {
private List<Player> matchPlayers = new ArrayList<Player>(); private List<String> matchPlayerUsernames = new ArrayList<String>();
public void addPlayerToMatch(String playername){
matchPlayerUsernames.add(playername);
}
public void addPlayerToMatch(Player player){ public void addPlayerToMatch(Player player){
matchPlayers.add(player); matchPlayerUsernames.add(player.toString());
} }
public void removePlayerFromMatch(Player player){ public void removePlayerFromMatch(Player player){
if (matchPlayers.contains(player)){ if (matchPlayerUsernames.contains(player)){
matchPlayers.remove(player); matchPlayerUsernames.remove(player.toString());
} }
} }
public void removeAllPlayersFromMatch(){ public void removeAllPlayersFromMatch(){
matchPlayers.clear(); matchPlayerUsernames.clear();
} }
public void endMatch(){ public void endMatch(){
matchPlayers.clear(); matchPlayerUsernames.clear();
} }
} }