예제 #1
0
 public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
   if (args.length != 1) {
     return false;
   }
   if (!FreedomOpModRemastered.configs.getWorlds().getConfig().contains(args[0])) {
     sender.sendMessage(
         ChatColor.RED + "The world does not exist or is not a custom FOPM: R world.");
     return true;
   }
   if (Bukkit.getWorld(args[0]) != null) {
     CUtils_Methods.unloadWorld(Bukkit.getWorld(args[0]));
   }
   FreedomOpModRemastered.configs.getWorlds().getConfig().set(args[0], null);
   FreedomOpModRemastered.configs.getWorlds().saveConfig();
   return true;
 }
 public static void wipeFlatlands() {
   final World flatlands = Bukkit.getWorld("flatlands");
   for (Player player : flatlands.getPlayers()) {
     player.setOp(false);
     player.setWhitelisted(false);
   }
   Bukkit.getServer().setWhitelist(true);
   CUtils_Methods.unloadWorld(flatlands);
   new BukkitRunnable() {
     @Override
     public void run() {
       CUtils_Methods.deleteWorld(flatlands.getWorldFolder());
       Bukkit.getServer().setWhitelist(false);
     }
   }.runTaskLater(FreedomOpModRemastered.plugin, 20L * 5L);
   createNewWorld("flatlands", new FOPMR_FlatGenerator(), Rank.OP);
 }
 public static void unloadWorlds() {
   for (World world : worlds.keySet()) {
     CUtils_Methods.unloadWorld(world);
   }
 }