Skip to content

Instantly share code, notes, and snippets.

@effective-light
Last active June 19, 2017 21:11
Show Gist options
  • Select an option

  • Save effective-light/fd433b361e941b25b59d4384bc3e9c10 to your computer and use it in GitHub Desktop.

Select an option

Save effective-light/fd433b361e941b25b59d4384bc3e9c10 to your computer and use it in GitHub Desktop.
import org.bukkit.Location;
public class SkyWarsIsland
{
private Location[] spawnLocations;
public SkyWarsIsland(Location[] spawnLocations)
{
this.spawnLocations = spawnLocations;
}
public Location[] getSpawnLocations()
{
return spawnLocations;
}
// TODO: more relevant methods
}
import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import java.util.*;
public class SkyWarsTeam
{
private Set<UUID> players;
private SkyWarsIsland island;
public SkyWarsTeam(SkyWarsIsland island)
{
this.island = island;
this.players = new HashSet<>();
}
public Collection<Player> getPlayers()
{
Set<Player> players = new HashSet<>();
getPlayers0().forEach( player -> players.add( Bukkit.getPlayer( player ) ) );
return Collections.unmodifiableSet( players );
}
private Set<UUID> getPlayers0()
{
return players;
}
public SkyWarsIsland getIsland()
{
return island;
}
public void addPlayer(Player player)
{
getPlayers0().add( player.getUniqueId() );
}
public void removePlayer(Player player)
{
getPlayers0().remove( player.getUniqueId() );
}
// TODO: impl relevent methods
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment