Exemplo n.º 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());
   }
 }
Exemplo n.º 2
0
 public static JumpPort getPort(Location loc) {
   Collection<JumpPort> jports = ports.values();
   int x = loc.getBlockX();
   int y = loc.getBlockY();
   int z = loc.getBlockZ();
   for (JumpPort port : jports) {
     if (port.hasBlock(x, y, z)) {
       return port;
     }
   }
   return null;
 }
Exemplo n.º 3
0
 public static boolean isInPort(Location loc) {
   Collection<JumpPort> jports = ports.values();
   int x = loc.getBlockX();
   int y = loc.getBlockY();
   int z = loc.getBlockZ();
   for (JumpPort port : jports) {
     if (port.hasBlock(x, y, z)) {
       return true;
     }
   }
   return false;
 }
Exemplo n.º 4
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);
     }
   }
 }
Exemplo n.º 5
0
 public static void removePort(String name) {
   JumpPort port = ports.get(name);
   port.delete();
   ports.remove(name);
 }
Exemplo n.º 6
0
 public static void addPort(JumpPort port) {
   ports.put(port.getName(), port);
 }