예제 #1
0
 public static void savePorts() {
   Collection<JumpPort> jports = ports.values();
   for (JumpPort port : jports) {
     port.save();
     JumpPortsPlugin.log(Lang.get("plugin.saved") + ": " + port.getName());
   }
 }
예제 #2
0
 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);
     }
   }
 }