Last active
June 19, 2017 21:11
-
-
Save effective-light/fd433b361e941b25b59d4384bc3e9c10 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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