public static void savePorts() { Collection<JumpPort> jports = ports.values(); for (JumpPort port : jports) { port.save(); JumpPortsPlugin.log(Lang.get("plugin.saved") + ": " + port.getName()); } }
public static void loadPorts() { File[] files = new File("plugins/JumpPorts/ports").listFiles(); for (File file : files) { String name = file.getName(); int pos = name.lastIndexOf('.'); String ext = name.substring(pos + 1); if (ext.equalsIgnoreCase("yml")) { name = name.replaceAll(".yml", ""); JumpPort port = new JumpPort(name); port.load(); ports.put(name, port); JumpPortsPlugin.log(Lang.get("plugin.loaded") + ": " + name); } } }