public void createArenaFromSelection(Player pl, String name) { FileConfiguration c = SettingsManager.getInstance().getSystemConfig(); // SettingsManager s = SettingsManager.getInstance(); WorldEditPlugin we = p.getWorldEdit(); Selection sel = we.getSelection(pl); if (sel == null) { Message.send(pl, ChatColor.RED + "You must make a WorldEdit Selection first!"); return; } Location max = sel.getMaximumPoint(); Location min = sel.getMinimumPoint(); /* if(max.getWorld()!=SettingsManager.getGameWorld() || min.getWorld()!=SettingsManager.getGameWorld()){ Message.send(pl, ChatColor.RED+"Wrong World!"); return; }*/ SettingsManager.getInstance().getSpawns().set(("spawns." + name), null); c.set("system.arenas." + name + ".world", max.getWorld().getName()); c.set("system.arenas." + name + ".x1", max.getBlockX()); c.set("system.arenas." + name + ".y1", max.getBlockY()); c.set("system.arenas." + name + ".z1", max.getBlockZ()); c.set("system.arenas." + name + ".x2", min.getBlockX()); c.set("system.arenas." + name + ".y2", min.getBlockY()); c.set("system.arenas." + name + ".z2", min.getBlockZ()); c.set("system.arenas." + name + ".enabled", false); c.set("system.arenas." + name + ".min", 3); c.set("system.arenas." + name + ".max", 4); SettingsManager.getInstance().saveSystemConfig(); hotAddArena(name); Message.send(pl, ChatColor.GREEN + "Arena " + name.toUpperCase() + " succesfully added"); }
public WorldEditPlugin getWorldEdit() { return p.getWorldEdit(); }