Seems to work (random points) with the exceptionof newfriend mode, which does not yet appear to function.

This commit is contained in:
Daniel Boston
2016-05-07 02:45:56 -04:00
parent 47451093fc
commit c02f5599a0
7 changed files with 130 additions and 28 deletions

View File

@@ -261,14 +261,16 @@ public class RandomSpawn extends JavaPlugin{
if( yamlHandler.worlds.contains( worldName + ".spawnblacklist") )
blacklist = yamlHandler.worlds.getIntegerList(worldName + ".spawnblacklist");
// find all spawnpoint data
List<ConfigurationSection> spawnpoints = (List<ConfigurationSection>) yamlHandler.worlds.getList(worldName + ".spawnpoints");
// reserve list of online players : TODO make sure this is just online players
List<Player> playersOnline = world.getPlayers();
// For each potential spawn location ...
for (ConfigurationSection spawnpoint : spawnpoints) {
// For each potential spawn location ...
ConfigurationSection spawnpoints = yamlHandler.worlds.getConfigurationSection(worldName + ".spawnpoints");
if (spawnpoints == null) {
return new ArrayList<Location>(0);
}
for (String spawnpointlabel : spawnpoints.getKeys(false)) {
ConfigurationSection spawnpoint = spawnpoints.getConfigurationSection(spawnpointlabel);
Location location = new Location(world, spawnpoint.getDouble("x"),
spawnpoint.getDouble("y"), spawnpoint.getDouble("z"));
boolean skip = true;