Loading arenas

Discussion in 'Plugin Development' started by AcePilot10, Jul 19, 2015.

Thread Status:
Not open for further replies.
  1. Offline

    AcePilot10

    So basically I have a method that saves the arenas to config, which works fine. But then when onEnable runs it's supposed to call the method load();. It's throwing no errors in the console either.

    Here's the method:
    Code:
        public void load() {
            if(config.contains("Arenas")) {
                for(String s : config.getConfigurationSection("Arenas").getKeys(false)) {
                    for(int i = 1; i > 10; i++) {
                        String w = config.getString("Arenas." + s + ".Spawn." + i + "World");
                        int x = config.getInt("Arenas." + s + ".Spawn." + i + "X");
                        int y = config.getInt("Arenas." + s + ".Spawn." + i + "Y");
                        int z = config.getInt("Arenas." + s + ".Spawn." + i + "Z");
                        Location loc = new Location(Bukkit.getWorld(w), x, y, z);
                        Main.getArenaManager().getArenas().put(s, new Arena(s));
                        Main.getArenaManager().getArena(s).getSpawns().put(Main.getArenaManager().getArena(s).getSpawns().size() + 1, loc);
                        String w2 = config.getString("Arenas." + s + ".Crystal." + i + "World");
                        int x2 = config.getInt("Arenas." + s + ".Crystal." + i + "X");
                        int y2 = config.getInt("Arenas." + s + ".Crystal." + i + "Y");
                        int z2 = config.getInt("Arenas." + s + ".Crystal." + i + "Z");
                        Location loc2 = new Location(Bukkit.getWorld(w2), x2, y2, z2);
                        Main.getArenaManager().getArena(s).getCrystals().put(Main.getArenaManager().getArena(s).getCrystals().size() + 1, loc2);
                        Main.plugin.getLogger().info("Importing:" + s + "," + x + "," + y + "," + z);
                        Main.plugin.getLogger().info("The arena " + s + " has been loaded");
    Woops, it was just inside of my for loop.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 11, 2016
Thread Status:
Not open for further replies.

Share This Page