@Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { if (args.length != 1) { return false; } Player player = FOPMR_Rank.getPlayer(args[0]); if (player == null) { sender.sendMessage("Player is not online."); return true; } if (FOPMR_Rank.isEqualOrHigher(FOPMR_Rank.getRank(player), FOPMR_Rank.getRank(sender))) { sender.sendMessage( "You can only block the commands of a player with lower clearance than yourself."); return true; } Bukkit.broadcastMessage( ChatColor.AQUA + sender.getName() + " - toggling command blockage for " + player.getName() + "."); try { FOPMR_DatabaseInterface.updateInTable( "UUID", player.getUniqueId().toString(), !(FOPMR_DatabaseInterface.getBooleanFromTable( "UUID", player.getUniqueId().toString(), "CMDBLOCK", "PLAYERS")), "CMDBLOCK", "PLAYERS"); } catch (Exception ex) { FreedomOpModRemastered.plugin.handleException(ex); } return true; }
public static void loadWorldsFromConfig() { try { ArrayList<Object> results = FOPMR_DatabaseInterface.getAsArrayList(null, null, "NAME", "WORLDS"); for (Object result : results) { String worldName = (String) result; if (!FOPMR_DatabaseInterface.getBooleanFromTable("NAME", worldName, "ONENABLE", "WORLDS")) { continue; } if (((String) FOPMR_DatabaseInterface.getFromTable("NAME", worldName, "GENERATOR", "WORLDS")) .equalsIgnoreCase("flat")) { createNewWorld( worldName, new FOPMR_FlatGenerator(), FOPMR_Rank.getFromName( ((String) FOPMR_DatabaseInterface.getFromTable("NAME", worldName, "RANK", "WORLDS")))); } else if (((String) FOPMR_DatabaseInterface.getFromTable("NAME", worldName, "GENERATOR", "WORLDS")) .equalsIgnoreCase("default")) { createNewWorld( worldName, FOPMR_Rank.getFromName( ((String) FOPMR_DatabaseInterface.getFromTable("NAME", worldName, "RANK", "WORLDS")))); } else if (((String) FOPMR_DatabaseInterface.getFromTable("NAME", worldName, "GENERATOR", "WORLDS")) .equalsIgnoreCase("empty")) { createNewWorld( worldName, new FOPMR_EmptyGenerator(), FOPMR_Rank.getFromName( ((String) FOPMR_DatabaseInterface.getFromTable("NAME", worldName, "RANK", "WORLDS")))); } else if (((String) FOPMR_DatabaseInterface.getFromTable("NAME", worldName, "GENERATOR", "WORLDS")) .equalsIgnoreCase("rollinghills")) { createNewWorld( worldName, new FOPMR_RollinghillsGenerator(), FOPMR_Rank.getFromName( ((String) FOPMR_DatabaseInterface.getFromTable("NAME", worldName, "RANK", "WORLDS")))); } else { Bukkit.broadcastMessage( ChatColor.RED + "The world: " + worldName + " could not be loaded because its generator was invalid!"); } } } catch (Exception ex) { FreedomOpModRemastered.plugin.handleException(ex); } }