Te di una version anterior, porque ya he hecho varios cambios, en esa no carga las arenas, osea tendras que crearlas cada vez que entres al juego, agrega esto a arena manager:
public void loadArenas() {
File arenasFolder = new File(plugin.getDataFolder() + "/Arenas/");
if (!arenasFolder.exists()) {
arenasFolder.mkdirs();
return;
}
File[] arenaFiles = arenasFolder.listFiles();
if (arenaFiles == null || arenaFiles.length == 0) {
return;
}
for (File arenaFile : arenaFiles) {
if (arenaFile.getName().endsWith(".yml")) {
String arenaName = arenaFile.getName().replace(".yml", "");
Config arenaConfig = new Config(arenaFile, Config.YAML);
String worldName = arenaConfig.getString("world");
Level level = plugin.getServer().getLevelByName(worldName);
if (level == null) {
plugin.getServer().loadLevel(worldName);
level = plugin.getServer().getLevelByName(worldName);
}
if (level != null) {
this.arenaWorlds.put(arenaName, level);
this.spawnPoints.put(arenaName, new ArrayList<>());
this.occupiedSpawns.put(arenaName, new HashSet<>());
this.playersInArena.put(arenaName, 0);
this.gameStates.put(arenaName, GameState.WAITING);
ConfigSection spawnsSection = arenaConfig.getRootSection().getSection("spawns");
if (spawnsSection != null) {
for (String spawnKey : spawnsSection.getKeys(false)) {
ConfigSection spawnSection = spawnsSection.getSection(spawnKey);
if (spawnSection != null) {
int x = spawnSection.getInt("x");
int y = spawnSection.getInt("y");
int z = spawnSection.getInt("z");
Block spawnBlock = level.getBlock(x, y, z);
if (spawnBlock != null) {
this.spawnPoints.get(arenaName).add(spawnBlock);
}
}
}
}
}
}
}
}