Revert "Added /premium"

This reverts commit 0964871e8b.
This commit is contained in:
StevenLawson 2013-08-14 09:28:19 -04:00
parent 0964871e8b
commit ec6e8431e3
90 changed files with 676 additions and 748 deletions

View File

@ -1,5 +1,5 @@
#Wed, 14 Aug 2013 15:07:06 +0200 #Tue, 13 Aug 2013 16:50:36 -0400
program.VERSION=2.22 program.VERSION=2.22
program.BUILDNUM=467 program.BUILDNUM=458
program.BUILDDATE=08/14/2013 03\:07 PM program.BUILDDATE=08/13/2013 04\:50 PM

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Wed Aug 14 15:07:06 CEST 2013 #Tue Aug 13 16:50:36 EDT 2013
build.number=468 build.number=459

View File

@ -29,11 +29,11 @@ public class Command_adminmode extends TFM_Command
{ {
TotalFreedomMod.adminOnlyMode = true; TotalFreedomMod.adminOnlyMode = true;
TFM_Util.adminAction(sender.getName(), "Closing the server to non-superadmins.", true); TFM_Util.adminAction(sender.getName(), "Closing the server to non-superadmins.", true);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
player.kickPlayer("Server is now closed to non-superadmins."); p.kickPlayer("Server is now closed to non-superadmins.");
} }
} }
return true; return true;

View File

@ -23,9 +23,9 @@ public class Command_blockcmd extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "Unblocking commands for all players", true); TFM_Util.adminAction(sender.getName(), "Unblocking commands for all players", true);
int counter = 0; int counter = 0;
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
if (playerdata.allCommandsBlocked()) if (playerdata.allCommandsBlocked())
{ {
counter += 1; counter += 1;
@ -36,28 +36,28 @@ public class Command_blockcmd extends TFM_Command
return true; return true;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage()); playerMsg(ex.getMessage());
return true; return true;
} }
if (TFM_SuperadminList.isUserSuperadmin(player)) if (TFM_SuperadminList.isUserSuperadmin(p))
{ {
playerMsg(player.getName() + " is a Superadmin, and cannot have their commands blocked."); playerMsg(p.getName() + " is a Superadmin, and cannot have their commands blocked.");
return true; return true;
} }
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.setCommandsBlocked(!playerdata.allCommandsBlocked()); playerdata.setCommandsBlocked(!playerdata.allCommandsBlocked());
TFM_Util.adminAction(sender.getName(), (playerdata.allCommandsBlocked() ? "B" : "Unb") + "locking all commands for " + player.getName(), true); TFM_Util.adminAction(sender.getName(), (playerdata.allCommandsBlocked() ? "B" : "Unb") + "locking all commands for " + p.getName(), true);
playerMsg((playerdata.allCommandsBlocked() ? "B" : "Unb") + "locked all commands."); playerMsg((playerdata.allCommandsBlocked() ? "B" : "Unb") + "locked all commands.");
return true; return true;

View File

@ -21,18 +21,18 @@ public class Command_cage extends TFM_Command
return false; return false;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
Material cage_material_outer = Material.GLASS; Material cage_material_outer = Material.GLASS;
Material cage_material_inner = Material.AIR; Material cage_material_inner = Material.AIR;
@ -40,7 +40,7 @@ public class Command_cage extends TFM_Command
{ {
if (TFM_Util.isStopCommand(args[1])) if (TFM_Util.isStopCommand(args[1]))
{ {
TFM_Util.adminAction(sender.getName(), "Uncaging " + player.getName() + ".", true); TFM_Util.adminAction(sender.getName(), "Uncaging " + p.getName() + ".", true);
playerdata.setCaged(false); playerdata.setCaged(false);
playerdata.regenerateHistory(); playerdata.regenerateHistory();
@ -70,7 +70,7 @@ public class Command_cage extends TFM_Command
} }
} }
Location target_pos = player.getLocation().add(0, 1, 0); Location target_pos = p.getLocation().add(0, 1, 0);
playerdata.setCaged(true, target_pos, cage_material_outer, cage_material_inner); playerdata.setCaged(true, target_pos, cage_material_outer, cage_material_inner);
playerdata.regenerateHistory(); playerdata.regenerateHistory();
playerdata.clearHistory(); playerdata.clearHistory();
@ -78,9 +78,9 @@ public class Command_cage extends TFM_Command
TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.OUTER)); TFM_Util.generateCube(target_pos, 2, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.OUTER));
TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.INNER)); TFM_Util.generateCube(target_pos, 1, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.INNER));
player.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
TFM_Util.adminAction(sender.getName(), "Caging " + player.getName() + ".", true); TFM_Util.adminAction(sender.getName(), "Caging " + p.getName() + ".", true);
return true; return true;
} }

View File

@ -28,14 +28,14 @@ public class Command_cake extends TFM_Command
output.append(ChatColor.COLOR_CHAR).append(color_code).append(word).append(" "); output.append(ChatColor.COLOR_CHAR).append(color_code).append(word).append(" ");
} }
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
ItemStack heldItem = new ItemStack(Material.CAKE, 1); ItemStack heldItem = new ItemStack(Material.CAKE, 1);
player.getInventory().setItem(player.getInventory().firstEmpty(), heldItem); p.getInventory().setItem(p.getInventory().firstEmpty(), heldItem);
player.awardAchievement(Achievement.MINE_WOOD); p.awardAchievement(Achievement.MINE_WOOD);
player.awardAchievement(Achievement.BUILD_WORKBENCH); p.awardAchievement(Achievement.BUILD_WORKBENCH);
player.awardAchievement(Achievement.BUILD_HOE); p.awardAchievement(Achievement.BUILD_HOE);
player.awardAchievement(Achievement.BAKE_CAKE); p.awardAchievement(Achievement.BAKE_CAKE);
} }
TFM_Util.bcastMsg(output.toString()); TFM_Util.bcastMsg(output.toString());

View File

@ -21,9 +21,9 @@ public class Command_cartsit extends TFM_Command
{ {
target_player = getPlayer(args[0]); target_player = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
} }

View File

@ -21,11 +21,11 @@ public class Command_cmdlist extends TFM_Command
{ {
List<String> commands = new ArrayList<String>(); List<String> commands = new ArrayList<String>();
for (Plugin target_plugin : server.getPluginManager().getPlugins()) for (Plugin p : server.getPluginManager().getPlugins())
{ {
try try
{ {
PluginDescriptionFile desc = target_plugin.getDescription(); PluginDescriptionFile desc = p.getDescription();
Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>) desc.getCommands(); Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>) desc.getCommands();
if (map != null) if (map != null)
@ -37,7 +37,7 @@ public class Command_cmdlist extends TFM_Command
} }
} }
} }
catch (Throwable e) catch (Throwable ex)
{ {
} }
} }

View File

@ -24,10 +24,10 @@ public class Command_creative extends TFM_Command
} }
} }
Player target; Player p;
if (args.length == 0) if (args.length == 0)
{ {
target = sender_p; p = sender_p;
} }
else else
{ {
@ -56,19 +56,19 @@ public class Command_creative extends TFM_Command
try try
{ {
target = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
} }
playerMsg("Setting " + target.getName() + " to game mode 'Creative'."); playerMsg("Setting " + p.getName() + " to game mode 'Creative'.");
playerMsg(target, sender.getName() + " set your game mode to 'Creative'."); playerMsg(p, sender.getName() + " set your game mode to 'Creative'.");
target.setGameMode(GameMode.CREATIVE); p.setGameMode(GameMode.CREATIVE);
return true; return true;
} }

View File

@ -18,7 +18,7 @@ public class Command_deafen extends TFM_Command
@Override @Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
for (final Player player: server.getOnlinePlayers()) for (final Player p : server.getOnlinePlayers())
{ {
for (double percent = 0.0; percent <= 1.0; percent += (1.0 / STEPS)) for (double percent = 0.0; percent <= 1.0; percent += (1.0 / STEPS))
{ {
@ -29,7 +29,7 @@ public class Command_deafen extends TFM_Command
@Override @Override
public void run() public void run()
{ {
player.playSound(randomOffset(player.getLocation(), 5.0), Sound.values()[random.nextInt(Sound.values().length)], 100.0f, pitch); p.playSound(randomOffset(p.getLocation(), 5.0), Sound.values()[random.nextInt(Sound.values().length)], 100.0f, pitch);
} }
}.runTaskLater(plugin, Math.round(20.0 * percent * 2.0)); }.runTaskLater(plugin, Math.round(20.0 * percent * 2.0));
} }

View File

@ -34,9 +34,9 @@ public class Command_debug extends TFM_Command
sender.sendMessage("Debug: OK"); sender.sendMessage("Debug: OK");
} }
catch (Exception e) catch (Exception ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
} }
return true; return true;

View File

@ -18,25 +18,25 @@ public class Command_deop extends TFM_Command
return false; return false;
} }
OfflinePlayer player = null; OfflinePlayer p = null;
for (Player onlinePlayer : server.getOnlinePlayers()) for (Player onlinePlayer : server.getOnlinePlayers())
{ {
if (args[0].equalsIgnoreCase(onlinePlayer.getName())) if (args[0].equalsIgnoreCase(onlinePlayer.getName()))
{ {
player = onlinePlayer; p = onlinePlayer;
} }
} }
// if the player is not online // if the player is not online
if (player == null) if (p == null)
{ {
player = server.getOfflinePlayer(args[0]); p = server.getOfflinePlayer(args[0]);
} }
TFM_Util.adminAction(sender.getName(), "De-opping " + player.getName(), false); TFM_Util.adminAction(sender.getName(), "De-opping " + p.getName(), false);
player.setOp(false); p.setOp(false);
return true; return true;
} }

View File

@ -15,10 +15,10 @@ public class Command_deopall extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "De-opping all players on the server", true); TFM_Util.adminAction(sender.getName(), "De-opping all players on the server", true);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
player.setOp(false); p.setOp(false);
player.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP); p.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
} }
return true; return true;

View File

@ -29,7 +29,7 @@ public class Command_dispfill extends TFM_Command
{ {
radius = Math.max(5, Math.min(25, Integer.parseInt(args[0]))); radius = Math.max(5, Math.min(25, Integer.parseInt(args[0])));
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
sender.sendMessage("Invalid radius."); sender.sendMessage("Invalid radius.");
return true; return true;
@ -49,7 +49,7 @@ public class Command_dispfill extends TFM_Command
{ {
is = new ItemStack(Integer.parseInt(search_item), 64); is = new ItemStack(Integer.parseInt(search_item), 64);
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
} }
} }

View File

@ -22,53 +22,53 @@ public class Command_doom extends TFM_Command
return false; return false;
} }
final Player player; final Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
TFM_Util.adminAction(sender.getName(), "Casting oblivion over " + player.getName(), true); TFM_Util.adminAction(sender.getName(), "Casting oblivion over " + p.getName(), true);
TFM_Util.bcastMsg(player.getName() + " will be completely obliviated!", ChatColor.RED); TFM_Util.bcastMsg(p.getName() + " will be completely obliviated!", ChatColor.RED);
final String IP = player.getAddress().getAddress().getHostAddress().trim(); final String IP = p.getAddress().getAddress().getHostAddress().trim();
// remove from superadmin // remove from superadmin
if (TFM_SuperadminList.isUserSuperadmin(player)) if (TFM_SuperadminList.isUserSuperadmin(p))
{ {
TFM_Util.adminAction(sender.getName(), "Removing " + player.getName() + " from the superadmin list.", true); TFM_Util.adminAction(sender.getName(), "Removing " + p.getName() + " from the superadmin list.", true);
TFM_SuperadminList.removeSuperadmin(player); TFM_SuperadminList.removeSuperadmin(p);
} }
// remove from whitelist // remove from whitelist
player.setWhitelisted(false); p.setWhitelisted(false);
// deop // deop
player.setOp(false); p.setOp(false);
// ban IP // ban IP
TFM_ServerInterface.banIP(IP, null, null, null); TFM_ServerInterface.banIP(IP, null, null, null);
// ban name // ban name
TFM_ServerInterface.banUsername(player.getName(), null, null, null); TFM_ServerInterface.banUsername(p.getName(), null, null, null);
// set gamemode to survival // set gamemode to survival
player.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
// clear inventory // clear inventory
player.closeInventory(); p.closeInventory();
player.getInventory().clear(); p.getInventory().clear();
// ignite player // ignite player
player.setFireTicks(10000); p.setFireTicks(10000);
// generate explosion // generate explosion
player.getWorld().createExplosion(player.getLocation(), 4F); p.getWorld().createExplosion(p.getLocation(), 4F);
new BukkitRunnable() new BukkitRunnable()
{ {
@ -76,10 +76,10 @@ public class Command_doom extends TFM_Command
public void run() public void run()
{ {
// strike lightning // strike lightning
player.getWorld().strikeLightning(player.getLocation()); p.getWorld().strikeLightning(p.getLocation());
// kill (if not done already) // kill (if not done already)
player.setHealth(0.0); p.setHealth(0.0);
} }
}.runTaskLater(plugin, 20L * 2L); }.runTaskLater(plugin, 20L * 2L);
@ -89,13 +89,13 @@ public class Command_doom extends TFM_Command
public void run() public void run()
{ {
// message // message
TFM_Util.adminAction(sender.getName(), "Banning " + player.getName() + ", IP: " + IP, true); TFM_Util.adminAction(sender.getName(), "Banning " + p.getName() + ", IP: " + IP, true);
// generate explosion // generate explosion
player.getWorld().createExplosion(player.getLocation(), 4F); p.getWorld().createExplosion(p.getLocation(), 4F);
// kick player // kick player
player.kickPlayer(ChatColor.RED + "FUCKOFF, and get your shit together!"); p.kickPlayer(ChatColor.RED + "FUCKOFF, and get your shit together!");
} }
}.runTaskLater(plugin, 20L * 3L); }.runTaskLater(plugin, 20L * 3L);

View File

@ -68,7 +68,7 @@ public class Command_enchant extends TFM_Command
itemInHand.addEnchantment(ench, ench.getMaxLevel()); itemInHand.addEnchantment(ench, ench.getMaxLevel());
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.info("Error using " + ench.getName() + " on " + itemInHand.getType().name() + " held by " + sender_p.getName() + "."); TFM_Log.info("Error using " + ench.getName() + " on " + itemInHand.getType().name() + " held by " + sender_p.getName() + ".");
} }
@ -98,7 +98,7 @@ public class Command_enchant extends TFM_Command
{ {
ench = Enchantment.getByName(args[1]); ench = Enchantment.getByName(args[1]);
} }
catch (Exception e) catch (Exception ex)
{ {
} }

View File

@ -38,25 +38,25 @@ public class Command_expel extends TFM_Command
} }
Location sender_pos = sender_p.getLocation(); Location sender_pos = sender_p.getLocation();
for (Player player: sender_pos.getWorld().getPlayers()) for (Player p : sender_pos.getWorld().getPlayers())
{ {
if (!player.equals(sender_p)) if (!p.equals(sender_p))
{ {
Location target_pos = player.getLocation(); Location target_pos = p.getLocation();
boolean in_range = false; boolean in_range = false;
try try
{ {
in_range = target_pos.distanceSquared(sender_pos) < (radius * radius); in_range = target_pos.distanceSquared(sender_pos) < (radius * radius);
} }
catch (IllegalArgumentException e) catch (IllegalArgumentException ex)
{ {
} }
if (in_range) if (in_range)
{ {
player.setVelocity(target_pos.clone().subtract(sender_pos).toVector().normalize().multiply(strength)); p.setVelocity(target_pos.clone().subtract(sender_pos).toVector().normalize().multiply(strength));
playerMsg("Pushing " + player.getName() + "."); playerMsg("Pushing " + p.getName() + ".");
} }
} }
} }

View File

@ -24,9 +24,9 @@ public class Command_explosives extends TFM_Command
{ {
TotalFreedomMod.explosiveRadius = Math.max(1.0, Math.min(30.0, Double.parseDouble(args[1]))); TotalFreedomMod.explosiveRadius = Math.max(1.0, Math.min(30.0, Double.parseDouble(args[1])));
} }
catch (NumberFormatException e) catch (NumberFormatException nfex)
{ {
TFM_Util.playerMsg(sender, e.getMessage()); TFM_Util.playerMsg(sender, nfex.getMessage());
return true; return true;
} }
} }

View File

@ -19,18 +19,18 @@ public class Command_findip extends TFM_Command
return false; return false;
} }
final Player player; final Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage()); playerMsg(ex.getMessage());
return true; return true;
} }
playerMsg("Player IPs: " + StringUtils.join(TFM_UserList.getInstance(TotalFreedomMod.plugin).getEntry(player).getIpAddresses(), ", ")); playerMsg("Player IPs: " + StringUtils.join(TFM_UserList.getInstance(TotalFreedomMod.plugin).getEntry(p).getIpAddresses(), ", "));
return true; return true;
} }

View File

@ -62,9 +62,9 @@ public class Command_fr extends TFM_Command
TotalFreedomMod.freezePurgeTask.cancel(); TotalFreedomMod.freezePurgeTask.cancel();
} }
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.setFrozen(false); playerdata.setFrozen(false);
} }
@ -72,22 +72,22 @@ public class Command_fr extends TFM_Command
} }
else else
{ {
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.setFrozen(!playerdata.isFrozen()); playerdata.setFrozen(!playerdata.isFrozen());
playerMsg(player.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + "."); playerMsg(p.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
playerMsg(player, "You have been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".", ChatColor.AQUA); playerMsg(p, "You have been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".", ChatColor.AQUA);
} }
} }

View File

@ -30,7 +30,7 @@ public class Command_fuckoff extends TFM_Command
{ {
fuckoff_range = Math.max(5.0, Math.min(100.0, Double.parseDouble(args[1]))); fuckoff_range = Math.max(5.0, Math.min(100.0, Double.parseDouble(args[1])));
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
} }
} }

View File

@ -30,77 +30,77 @@ public class Command_gadmin extends TFM_Command
playerMsg("[ Real Name ] : [ Display Name ] - Hash:"); playerMsg("[ Real Name ] : [ Display Name ] - Hash:");
} }
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
String hash = player.getUniqueId().toString().substring(0, 4); String hash = p.getUniqueId().toString().substring(0, 4);
if (mode.equals("list")) if (mode.equals("list"))
{ {
sender.sendMessage(ChatColor.GRAY + String.format("[ %s ] : [ %s ] - %s", sender.sendMessage(ChatColor.GRAY + String.format("[ %s ] : [ %s ] - %s",
player.getName(), p.getName(),
ChatColor.stripColor(player.getDisplayName()), ChatColor.stripColor(p.getDisplayName()),
hash)); hash));
} }
else if (hash.equalsIgnoreCase(args[1])) else if (hash.equalsIgnoreCase(args[1]))
{ {
if (mode.equals("kick")) if (mode.equals("kick"))
{ {
TFM_Util.adminAction(sender.getName(), String.format("Kicking: %s.", player.getName()), false); TFM_Util.adminAction(sender.getName(), String.format("Kicking: %s.", p.getName()), false);
player.kickPlayer("Kicked by Administrator"); p.kickPlayer("Kicked by Administrator");
} }
else if (mode.equals("nameban")) else if (mode.equals("nameban"))
{ {
TFM_ServerInterface.banUsername(player.getName(), null, null, null); TFM_ServerInterface.banUsername(p.getName(), null, null, null);
TFM_Util.adminAction(sender.getName(), String.format("Banning Name: %s.", player.getName()), true); TFM_Util.adminAction(sender.getName(), String.format("Banning Name: %s.", p.getName()), true);
player.kickPlayer("Username banned by Administrator."); p.kickPlayer("Username banned by Administrator.");
} }
else if (mode.equals("ipban")) else if (mode.equals("ipban"))
{ {
String user_ip = player.getAddress().getAddress().getHostAddress(); String user_ip = p.getAddress().getAddress().getHostAddress();
String[] ip_parts = user_ip.split("\\."); String[] ip_parts = user_ip.split("\\.");
if (ip_parts.length == 4) if (ip_parts.length == 4)
{ {
user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]); user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]);
} }
TFM_Util.adminAction(sender.getName(), String.format("Banning IP: %s.", player.getName(), user_ip), true); TFM_Util.adminAction(sender.getName(), String.format("Banning IP: %s.", p.getName(), user_ip), true);
TFM_ServerInterface.banIP(user_ip, null, null, null); TFM_ServerInterface.banIP(user_ip, null, null, null);
player.kickPlayer("IP address banned by Administrator."); p.kickPlayer("IP address banned by Administrator.");
} }
else if (mode.equals("ban")) else if (mode.equals("ban"))
{ {
String user_ip = player.getAddress().getAddress().getHostAddress(); String user_ip = p.getAddress().getAddress().getHostAddress();
String[] ip_parts = user_ip.split("\\."); String[] ip_parts = user_ip.split("\\.");
if (ip_parts.length == 4) if (ip_parts.length == 4)
{ {
user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]); user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]);
} }
TFM_Util.adminAction(sender.getName(), String.format("Banning Name: %s, IP: %s.", player.getName(), user_ip), true); TFM_Util.adminAction(sender.getName(), String.format("Banning Name: %s, IP: %s.", p.getName(), user_ip), true);
TFM_ServerInterface.banIP(user_ip, null, null, null); TFM_ServerInterface.banIP(user_ip, null, null, null);
TFM_ServerInterface.banUsername(player.getName(), null, null, null); TFM_ServerInterface.banUsername(p.getName(), null, null, null);
player.kickPlayer("IP and username banned by Administrator."); p.kickPlayer("IP and username banned by Administrator.");
} }
else if (mode.equals("op")) else if (mode.equals("op"))
{ {
TFM_Util.adminAction(sender.getName(), String.format("Opping %s.", player.getName()), false); TFM_Util.adminAction(sender.getName(), String.format("Opping %s.", p.getName()), false);
player.setOp(false); p.setOp(false);
player.sendMessage(TotalFreedomMod.YOU_ARE_OP); p.sendMessage(TotalFreedomMod.YOU_ARE_OP);
} }
else if (mode.equals("deop")) else if (mode.equals("deop"))
{ {
TFM_Util.adminAction(sender.getName(), String.format("Deopping %s.", player.getName()), false); TFM_Util.adminAction(sender.getName(), String.format("Deopping %s.", p.getName()), false);
player.setOp(false); p.setOp(false);
player.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP); p.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
} }
else if (mode.equals("ci")) else if (mode.equals("ci"))
{ {
player.getInventory().clear(); p.getInventory().clear();
} }
else if (mode.equals("fr")) else if (mode.equals("fr"))
{ {
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.setFrozen(!playerdata.isFrozen()); playerdata.setFrozen(!playerdata.isFrozen());
playerMsg(player.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + "."); playerMsg(p.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
player.sendMessage(ChatColor.AQUA + "You have been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + "."); p.sendMessage(ChatColor.AQUA + "You have been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
} }
return true; return true;

View File

@ -17,14 +17,14 @@ public class Command_gcmd extends TFM_Command
return false; return false;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
@ -38,16 +38,16 @@ public class Command_gcmd extends TFM_Command
} }
outcommand = outcommand_bldr.toString().trim(); outcommand = outcommand_bldr.toString().trim();
} }
catch (Throwable e) catch (Throwable ex)
{ {
sender.sendMessage(ChatColor.GRAY + "Error building command: " + e.getMessage()); sender.sendMessage(ChatColor.GRAY + "Error building command: " + ex.getMessage());
return true; return true;
} }
try try
{ {
playerMsg("Sending command as " + player.getName() + ": " + outcommand); playerMsg("Sending command as " + p.getName() + ": " + outcommand);
if (server.dispatchCommand(player, outcommand)) if (server.dispatchCommand(p, outcommand))
{ {
playerMsg("Command sent."); playerMsg("Command sent.");
} }
@ -56,9 +56,9 @@ public class Command_gcmd extends TFM_Command
playerMsg("Unknown error sending command."); playerMsg("Unknown error sending command.");
} }
} }
catch (Throwable e) catch (Throwable ex)
{ {
playerMsg("Error sending command: " + e.getMessage()); playerMsg("Error sending command: " + ex.getMessage());
} }
return true; return true;

View File

@ -51,12 +51,12 @@ public class Command_glist extends TFM_Command
try try
{ {
Player player = getPlayer(args[1]); Player p = getPlayer(args[1]);
username = player.getName(); username = p.getName();
ip_addresses.add(player.getAddress().getAddress().getHostAddress()); ip_addresses.add(p.getAddress().getAddress().getHostAddress());
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
TFM_UserListEntry entry = TFM_UserList.getInstance(plugin).getEntry(args[1]); TFM_UserListEntry entry = TFM_UserList.getInstance(plugin).getEntry(args[1]);
@ -75,11 +75,11 @@ public class Command_glist extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "Banning " + username + " and IPs: " + StringUtils.join(ip_addresses, ","), true); TFM_Util.adminAction(sender.getName(), "Banning " + username + " and IPs: " + StringUtils.join(ip_addresses, ","), true);
Player player = server.getPlayerExact(username); Player p = server.getPlayerExact(username);
if (player != null) if (p != null)
{ {
TFM_ServerInterface.banUsername(player.getName(), null, null, null); TFM_ServerInterface.banUsername(p.getName(), null, null, null);
player.kickPlayer("You have been banned by " + sender.getName() + "\n If you think you have been banned wrongly, appeal here: http://www.totalfreedom.boards.net"); p.kickPlayer("You have been banned by " + sender.getName() + "\n If you think you have been banned wrongly, appeal here: http://www.totalfreedom.boards.net");
} }
else else
{ {

View File

@ -25,14 +25,14 @@ public class Command_gtfo extends TFM_Command
return false; return false;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
@ -42,25 +42,25 @@ public class Command_gtfo extends TFM_Command
ban_reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " "); ban_reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " ");
} }
TFM_Util.bcastMsg(player.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED); TFM_Util.bcastMsg(p.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED);
// Undo WorldEdits: // Undo WorldEdits:
TFM_WorldEditBridge.getInstance().undo(player, 15); TFM_WorldEditBridge.getInstance().undo(p, 15);
// rollback // rollback
TFM_RollbackManager.rollback(player.getName()); TFM_RollbackManager.rollback(p.getName());
// deop // deop
player.setOp(false); p.setOp(false);
// set gamemode to survival: // set gamemode to survival:
player.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
// clear inventory: // clear inventory:
player.getInventory().clear(); p.getInventory().clear();
// strike with lightning effect: // strike with lightning effect:
final Location target_pos = player.getLocation(); final Location target_pos = p.getLocation();
for (int x = -1; x <= 1; x++) for (int x = -1; x <= 1; x++)
{ {
for (int z = -1; z <= 1; z++) for (int z = -1; z <= 1; z++)
@ -71,20 +71,20 @@ public class Command_gtfo extends TFM_Command
} }
// ban IP address: // ban IP address:
String user_ip = player.getAddress().getAddress().getHostAddress(); String user_ip = p.getAddress().getAddress().getHostAddress();
String[] ip_parts = user_ip.split("\\."); String[] ip_parts = user_ip.split("\\.");
if (ip_parts.length == 4) if (ip_parts.length == 4)
{ {
user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]); user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]);
} }
TFM_Util.bcastMsg(String.format("Banning: %s, IP: %s.", player.getName(), user_ip), ChatColor.RED); TFM_Util.bcastMsg(String.format("Banning: %s, IP: %s.", p.getName(), user_ip), ChatColor.RED);
TFM_ServerInterface.banIP(user_ip, ban_reason, null, null); TFM_ServerInterface.banIP(user_ip, ban_reason, null, null);
// ban username: // ban username:
TFM_ServerInterface.banUsername(player.getName(), ban_reason, null, null); TFM_ServerInterface.banUsername(p.getName(), ban_reason, null, null);
// kick Player: // kick Player:
player.kickPlayer(ChatColor.RED + "GTFO" + (ban_reason != null ? ("\nReason: " + ChatColor.YELLOW + ban_reason) : "")); p.kickPlayer(ChatColor.RED + "GTFO" + (ban_reason != null ? ("\nReason: " + ChatColor.YELLOW + ban_reason) : ""));
return true; return true;
} }

View File

@ -23,11 +23,11 @@ public class Command_halt extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "Halting all non-superadmins.", true); TFM_Util.adminAction(sender.getName(), "Halting all non-superadmins.", true);
int counter = 0; int counter = 0;
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
TFM_PlayerData.getPlayerData(player).setHalted(true); TFM_PlayerData.getPlayerData(p).setHalted(true);
counter++; counter++;
} }
} }
@ -39,10 +39,10 @@ public class Command_halt extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "Unhalting all players.", true); TFM_Util.adminAction(sender.getName(), "Unhalting all players.", true);
int counter = 0; int counter = 0;
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
if (TFM_PlayerData.getPlayerData(player).isHalted()) if (TFM_PlayerData.getPlayerData(p).isHalted())
{ {
playerdata.setHalted(false); playerdata.setHalted(false);
counter++; counter++;
@ -76,28 +76,28 @@ public class Command_halt extends TFM_Command
return true; return true;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
if (!playerdata.isHalted()) if (!playerdata.isHalted())
{ {
TFM_Util.adminAction(sender.getName(), "Halting " + player.getName(), true); TFM_Util.adminAction(sender.getName(), "Halting " + p.getName(), true);
playerdata.setHalted(true); playerdata.setHalted(true);
return true; return true;
} }
else else
{ {
TFM_Util.adminAction(sender.getName(), "Unhalting " + player.getName(), true); TFM_Util.adminAction(sender.getName(), "Unhalting " + p.getName(), true);
playerdata.setHalted(false); playerdata.setHalted(false);
return true; return true;
} }

View File

@ -51,9 +51,9 @@ public class Command_health extends TFM_Command
} }
}.runTask(plugin); }.runTask(plugin);
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
}.runTaskAsynchronously(plugin); }.runTaskAsynchronously(plugin);

View File

@ -33,14 +33,14 @@ public class Command_invis extends TFM_Command
List<String> players = new ArrayList<String>(); List<String> players = new ArrayList<String>();
int smites = 0; int smites = 0;
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY)) if (p.hasPotionEffect(PotionEffectType.INVISIBILITY))
{ {
players.add(player.getName()); players.add(p.getName());
if (smite && !TFM_SuperadminList.isUserSuperadmin(player)) if (smite && !TFM_SuperadminList.isUserSuperadmin(p))
{ {
Command_smite.smite(player); Command_smite.smite(p);
smites++; smites++;
} }
} }

View File

@ -68,7 +68,7 @@ public class Command_jumppads extends TFM_Command
{ {
strength = Float.parseFloat(args[1]); strength = Float.parseFloat(args[1]);
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
playerMsg("Invalid Strength"); playerMsg("Invalid Strength");
return true; return true;

View File

@ -16,11 +16,11 @@ public class Command_kicknoob extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "Disconnecting all non-superadmins.", true); TFM_Util.adminAction(sender.getName(), "Disconnecting all non-superadmins.", true);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
player.kickPlayer(ChatColor.RED + "Disconnected by admin."); p.kickPlayer(ChatColor.RED + "Disconnected by admin.");
} }
} }

View File

@ -34,7 +34,7 @@ public class Command_landmine extends TFM_Command
{ {
radius = Math.max(2.0, Math.min(6.0, Double.parseDouble(args[0]))); radius = Math.max(2.0, Math.min(6.0, Double.parseDouble(args[0])));
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
} }
} }

View File

@ -18,18 +18,18 @@ public class Command_lastcmd extends TFM_Command
return false; return false;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
if (playerdata != null) if (playerdata != null)
{ {
@ -38,7 +38,7 @@ public class Command_lastcmd extends TFM_Command
{ {
last_command = "(none)"; last_command = "(none)";
} }
playerMsg(player.getName() + " - Last Command: " + last_command, ChatColor.GRAY); playerMsg(p.getName() + " - Last Command: " + last_command, ChatColor.GRAY);
} }
return true; return true;

View File

@ -25,9 +25,9 @@ public class Command_list extends TFM_Command
if (TFM_Util.isFromHostConsole(sender.getName())) if (TFM_Util.isFromHostConsole(sender.getName()))
{ {
List<String> player_names = new ArrayList<String>(); List<String> player_names = new ArrayList<String>();
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
player_names.add(player.getName()); player_names.add(p.getName());
} }
playerMsg("There are " + player_names.size() + "/" + server.getMaxPlayers() + " players online:\n" + StringUtils.join(player_names, ", "), ChatColor.WHITE); playerMsg("There are " + player_names.size() + "/" + server.getMaxPlayers() + " players online:\n" + StringUtils.join(player_names, ", "), ChatColor.WHITE);
return true; return true;
@ -50,9 +50,9 @@ public class Command_list extends TFM_Command
onlineStats.append(ChatColor.BLUE).append(" players online."); onlineStats.append(ChatColor.BLUE).append(" players online.");
List<String> player_names = new ArrayList<String>(); List<String> player_names = new ArrayList<String>();
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
boolean userSuperadmin = TFM_SuperadminList.isUserSuperadmin(player); boolean userSuperadmin = TFM_SuperadminList.isUserSuperadmin(p);
if (listFilter == ListFilter.SHOW_ADMINS && !userSuperadmin) if (listFilter == ListFilter.SHOW_ADMINS && !userSuperadmin)
{ {
@ -63,7 +63,7 @@ public class Command_list extends TFM_Command
if (userSuperadmin) if (userSuperadmin)
{ {
if (TFM_SuperadminList.isSeniorAdmin(player)) if (TFM_SuperadminList.isSeniorAdmin(p))
{ {
prefix = (ChatColor.LIGHT_PURPLE + "[SrA]"); prefix = (ChatColor.LIGHT_PURPLE + "[SrA]");
} }
@ -72,25 +72,25 @@ public class Command_list extends TFM_Command
prefix = (ChatColor.GOLD + "[SA]"); prefix = (ChatColor.GOLD + "[SA]");
} }
if (TFM_Util.DEVELOPERS.contains(player.getName())) if (TFM_Util.DEVELOPERS.contains(p.getName()))
{ {
prefix = (ChatColor.DARK_PURPLE + "[Dev]"); prefix = (ChatColor.DARK_PURPLE + "[Dev]");
} }
if (player.getName().equals("markbyron")) if (p.getName().equals("markbyron"))
{ {
prefix = (ChatColor.BLUE + "[Owner]"); prefix = (ChatColor.BLUE + "[Owner]");
} }
} }
else else
{ {
if (player.isOp()) if (p.isOp())
{ {
prefix = (ChatColor.RED + "[OP]"); prefix = (ChatColor.RED + "[OP]");
} }
} }
player_names.add(prefix + player.getName() + ChatColor.WHITE); player_names.add(prefix + p.getName() + ChatColor.WHITE);
} }
onlineUsers.append("Connected ").append(listFilter == ListFilter.SHOW_ADMINS ? "admins" : "players").append(": ").append(StringUtils.join(player_names, ", ")); onlineUsers.append("Connected ").append(listFilter == ListFilter.SHOW_ADMINS ? "admins" : "players").append(": ").append(StringUtils.join(player_names, ", "));

View File

@ -23,9 +23,9 @@ public class Command_listsync extends TFM_Command
TotalFreedomMod.loadSuperadminConfig(); TotalFreedomMod.loadSuperadminConfig();
TFM_Util.adminAction(sender.getName(), TotalFreedomMod.SUPERADMIN_FILE + " downloaded.", false); TFM_Util.adminAction(sender.getName(), TotalFreedomMod.SUPERADMIN_FILE + " downloaded.", false);
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
try try
@ -34,9 +34,9 @@ public class Command_listsync extends TFM_Command
TotalFreedomMod.loadPermbanConfig(); TotalFreedomMod.loadPermbanConfig();
TFM_Util.adminAction(sender.getName(), TotalFreedomMod.PERMBAN_FILE + " downloaded.", false); TFM_Util.adminAction(sender.getName(), TotalFreedomMod.PERMBAN_FILE + " downloaded.", false);
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
return true; return true;

View File

@ -21,18 +21,18 @@ public class Command_lockup extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "Locking up all players", true); TFM_Util.adminAction(sender.getName(), "Locking up all players", true);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
startLockup(player); startLockup(p);
} }
playerMsg("Locked up all players."); playerMsg("Locked up all players.");
} }
else if (args[0].equalsIgnoreCase("purge")) else if (args[0].equalsIgnoreCase("purge"))
{ {
TFM_Util.adminAction(sender.getName(), "Unlocking all players", true); TFM_Util.adminAction(sender.getName(), "Unlocking all players", true);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
cancelLockup(player); cancelLockup(p);
} }
playerMsg("Unlocked all players."); playerMsg("Unlocked all players.");
@ -46,37 +46,37 @@ public class Command_lockup extends TFM_Command
{ {
if (args[1].equalsIgnoreCase("on")) if (args[1].equalsIgnoreCase("on"))
{ {
final Player player; final Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
TFM_Util.adminAction(sender.getName(), "Locking up " + player.getName(), true); TFM_Util.adminAction(sender.getName(), "Locking up " + p.getName(), true);
startLockup(player); startLockup(p);
playerMsg("Locked up " + player.getName() + "."); playerMsg("Locked up " + p.getName() + ".");
} }
else if (TFM_Util.isStopCommand(args[1])) else if (TFM_Util.isStopCommand(args[1]))
{ {
final Player player; final Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
TFM_Util.adminAction(sender.getName(), "Unlocking " + player.getName(), true); TFM_Util.adminAction(sender.getName(), "Unlocking " + p.getName(), true);
cancelLockup(player); cancelLockup(p);
playerMsg("Unlocked " + player.getName() + "."); playerMsg("Unlocked " + p.getName() + ".");
} }
else else
{ {
@ -101,14 +101,14 @@ public class Command_lockup extends TFM_Command
} }
} }
private void cancelLockup(final Player player) private void cancelLockup(final Player p)
{ {
cancelLockup(TFM_PlayerData.getPlayerData(player)); cancelLockup(TFM_PlayerData.getPlayerData(p));
} }
private void startLockup(final Player player) private void startLockup(final Player p)
{ {
final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
cancelLockup(playerdata); cancelLockup(playerdata);
@ -117,9 +117,9 @@ public class Command_lockup extends TFM_Command
@Override @Override
public void run() public void run()
{ {
if (player.isOnline()) if (p.isOnline())
{ {
player.openInventory(player.getInventory()); p.openInventory(p.getInventory());
} }
else else
{ {

View File

@ -102,9 +102,9 @@ public class Command_logs extends TFM_Command
}.runTask(TotalFreedomMod.plugin); }.runTask(TotalFreedomMod.plugin);
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
}.runTaskAsynchronously(TotalFreedomMod.plugin); }.runTaskAsynchronously(TotalFreedomMod.plugin);

View File

@ -38,7 +38,7 @@ public class Command_nf extends TFM_Command
{ {
player = getPlayerByDisplayName(displayName); player = getPlayerByDisplayName(displayName);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
} }
if (player == null) if (player == null)
@ -47,7 +47,7 @@ public class Command_nf extends TFM_Command
{ {
player = getPlayerByDisplayNameAlt(displayName); player = getPlayerByDisplayNameAlt(displayName);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(ChatColor.GRAY + "Can't find player by nickname: " + displayName); sender.sendMessage(ChatColor.GRAY + "Can't find player by nickname: " + displayName);
return true; return true;

View File

@ -43,9 +43,9 @@ public class Command_onlinemode extends TFM_Command
if (online_mode) if (online_mode)
{ {
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
player.kickPlayer("Server is activating \"online-mode=true\". Please reconnect."); p.kickPlayer("Server is activating \"online-mode=true\". Please reconnect.");
} }
} }
@ -53,9 +53,9 @@ public class Command_onlinemode extends TFM_Command
server.reload(); server.reload();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }

View File

@ -26,21 +26,21 @@ public class Command_op extends TFM_Command
return true; return true;
} }
OfflinePlayer player = null; OfflinePlayer p = null;
for (Player onlinePlayer : server.getOnlinePlayers()) for (Player onlinePlayer : server.getOnlinePlayers())
{ {
if (args[0].equalsIgnoreCase(onlinePlayer.getName())) if (args[0].equalsIgnoreCase(onlinePlayer.getName()))
{ {
player = onlinePlayer; p = onlinePlayer;
} }
} }
// if the player is not online // if the player is not online
if (player == null) if (p == null)
{ {
if (TFM_SuperadminList.isUserSuperadmin(sender) || senderIsConsole) if (TFM_SuperadminList.isUserSuperadmin(sender) || senderIsConsole)
{ {
player = server.getOfflinePlayer(args[0]); p = server.getOfflinePlayer(args[0]);
} }
else else
{ {
@ -50,8 +50,8 @@ public class Command_op extends TFM_Command
} }
} }
TFM_Util.adminAction(sender.getName(), "Opping " + player.getName(), false); TFM_Util.adminAction(sender.getName(), "Opping " + p.getName(), false);
player.setOp(true); p.setOp(true);
return true; return true;
} }

View File

@ -32,14 +32,14 @@ public class Command_opall extends TFM_Command
} }
} }
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
player.setOp(true); p.setOp(true);
player.sendMessage(TotalFreedomMod.YOU_ARE_OP); p.sendMessage(TotalFreedomMod.YOU_ARE_OP);
if (doSetGamemode) if (doSetGamemode)
{ {
player.setGameMode(targetGamemode); p.setGameMode(targetGamemode);
} }
} }

View File

@ -31,9 +31,9 @@ public class Command_ops extends TFM_Command
int offlineOPs = 0; int offlineOPs = 0;
int totalOPs = 0; int totalOPs = 0;
for (OfflinePlayer player: server.getOperators()) for (OfflinePlayer p : server.getOperators())
{ {
if (player.isOnline()) if (p.isOnline())
{ {
onlineOPs++; onlineOPs++;
} }
@ -61,13 +61,13 @@ public class Command_ops extends TFM_Command
TFM_Util.adminAction(sender.getName(), "Removing all operators", true); TFM_Util.adminAction(sender.getName(), "Removing all operators", true);
for (OfflinePlayer player: server.getOperators()) for (OfflinePlayer p : server.getOperators())
{ {
player.setOp(false); p.setOp(false);
if (player.isOnline()) if (p.isOnline())
{ {
player.getPlayer().sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP); p.getPlayer().sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
} }
} }

View File

@ -21,18 +21,18 @@ public class Command_orbit extends TFM_Command
return false; return false;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
double strength = 10.0; double strength = 10.0;
@ -40,7 +40,7 @@ public class Command_orbit extends TFM_Command
{ {
if (TFM_Util.isStopCommand(args[1])) if (TFM_Util.isStopCommand(args[1]))
{ {
playerMsg("Stopped orbiting " + player.getName()); playerMsg("Stopped orbiting " + p.getName());
playerdata.stopOrbiting(); playerdata.stopOrbiting();
return true; return true;
} }
@ -49,18 +49,18 @@ public class Command_orbit extends TFM_Command
{ {
strength = Math.max(1.0, Math.min(150.0, Double.parseDouble(args[1]))); strength = Math.max(1.0, Math.min(150.0, Double.parseDouble(args[1])));
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
} }
player.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
playerdata.startOrbiting(strength); playerdata.startOrbiting(strength);
player.setVelocity(new Vector(0, strength, 0)); p.setVelocity(new Vector(0, strength, 0));
TFM_Util.adminAction(sender.getName(), "Orbiting " + player.getName() + ".", false); TFM_Util.adminAction(sender.getName(), "Orbiting " + p.getName() + ".", false);
return true; return true;
} }

View File

@ -58,20 +58,20 @@ public class Command_plugincontrol extends TFM_Command
else if (commandMode == CommandMode.RELOAD) else if (commandMode == CommandMode.RELOAD)
{ {
playerMsg("Disabling all plugins."); playerMsg("Disabling all plugins.");
for (Plugin target_plugin : pluginManager.getPlugins()) for (Plugin p : pluginManager.getPlugins())
{ {
if (!target_plugin.getName().toLowerCase().startsWith("totalfreedommod")) if (!p.getName().toLowerCase().startsWith("totalfreedommod"))
{ {
pluginManager.disablePlugin(target_plugin); pluginManager.disablePlugin(p);
} }
} }
playerMsg("Enabling all plugins."); playerMsg("Enabling all plugins.");
for (Plugin target_plugin : pluginManager.getPlugins()) for (Plugin p : pluginManager.getPlugins())
{ {
if (!target_plugin.getName().toLowerCase().startsWith("totalfreedommod")) if (!p.getName().toLowerCase().startsWith("totalfreedommod"))
{ {
pluginManager.enablePlugin(target_plugin); pluginManager.enablePlugin(p);
} }
} }
} }
@ -81,11 +81,11 @@ public class Command_plugincontrol extends TFM_Command
Plugin targetPlugin = null; Plugin targetPlugin = null;
for (Plugin target_plugin : pluginManager.getPlugins()) for (Plugin p : pluginManager.getPlugins())
{ {
if (searchPluginName.equalsIgnoreCase(target_plugin.getName().toLowerCase().trim())) if (searchPluginName.equalsIgnoreCase(p.getName().toLowerCase().trim()))
{ {
targetPlugin = plugin; targetPlugin = p;
break; break;
} }
} }

View File

@ -62,9 +62,9 @@ public class Command_potion extends TFM_Command
{ {
target = getPlayer(args[1]); target = getPlayer(args[1]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
} }
@ -107,9 +107,9 @@ public class Command_potion extends TFM_Command
{ {
target = getPlayer(args[4]); target = getPlayer(args[4]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
} }
@ -140,7 +140,7 @@ public class Command_potion extends TFM_Command
{ {
duration = Integer.parseInt(args[2]); duration = Integer.parseInt(args[2]);
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
playerMsg("Invalid potion duration.", ChatColor.RED); playerMsg("Invalid potion duration.", ChatColor.RED);
return true; return true;
@ -151,7 +151,7 @@ public class Command_potion extends TFM_Command
{ {
amplifier = Integer.parseInt(args[3]); amplifier = Integer.parseInt(args[3]);
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
playerMsg("Invalid potion amplifier.", ChatColor.RED); playerMsg("Invalid potion amplifier.", ChatColor.RED);
return true; return true;

View File

@ -1,72 +0,0 @@
package me.StevenLawson.TotalFreedomMod.Commands;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import me.StevenLawson.TotalFreedomMod.TFM_Log;
import org.apache.commons.lang.exception.ExceptionUtils;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
@CommandPermissions(level = AdminLevel.SUPER, source = SourceType.BOTH)
@CommandParameters(description = "Validates if a given account is premium.", usage = "/<command> <player>", aliases = "prem")
public class Command_premium extends TFM_Command
{
@Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{
if (args.length != 1)
{
return false;
}
String name;
try
{
name = getPlayer(args[0]).getName();
}
catch (PlayerNotFoundException e)
{
name = args[0];
}
final String playername = name;
new BukkitRunnable()
{
@Override
public void run()
{
try
{
final URL getUrl = new URL("https://minecraft.net/haspaid.jsp?user=" + playername);
final URLConnection urlConnection = getUrl.openConnection();
// Read the response
final BufferedReader in = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()));
final String message = ("false".equalsIgnoreCase(in.readLine()) ? ChatColor.RED + "No" : ChatColor.DARK_GREEN + "Yes");
in.close();
new BukkitRunnable()
{
@Override
public void run()
{
playerMsg("Player " + playername + " is premium: " + message);
}
}.runTask(plugin);
}
catch (Exception e)
{
TFM_Log.severe(ExceptionUtils.getStackTrace(e));
playerMsg("There was an error querying the mojang server.", ChatColor.RED);
}
}
}.runTaskAsynchronously(plugin);
return true;
}
}

View File

@ -24,9 +24,9 @@ public class Command_purgeall extends TFM_Command
// Undisguise all players // Undisguise all players
TFM_DisguiseCraftBridge.undisguiseAllPlayers(); TFM_DisguiseCraftBridge.undisguiseAllPlayers();
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
// Unmute all players // Unmute all players
if (playerdata.isMuted()) if (playerdata.isMuted())
@ -59,9 +59,9 @@ public class Command_purgeall extends TFM_Command
} }
// Purge potion effects // Purge potion effects
for (PotionEffect potion_effect : player.getActivePotionEffects()) for (PotionEffect potion_effect : p.getActivePotionEffects())
{ {
player.removePotionEffect(potion_effect.getType()); p.removePotionEffect(potion_effect.getType());
} }
// Uncage // Uncage

View File

@ -28,18 +28,18 @@ public class Command_qdeop extends TFM_Command
String target_name = args[0].toLowerCase(); String target_name = args[0].toLowerCase();
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (player.getName().toLowerCase().indexOf(target_name) != -1 || player.getDisplayName().toLowerCase().indexOf(target_name) != -1) if (p.getName().toLowerCase().indexOf(target_name) != -1 || p.getDisplayName().toLowerCase().indexOf(target_name) != -1)
{ {
matched_player = true; matched_player = true;
if (!silent) if (!silent)
{ {
TFM_Util.adminAction(sender.getName(), "De-opping " + player.getName(), false); TFM_Util.adminAction(sender.getName(), "De-opping " + p.getName(), false);
} }
player.setOp(false); p.setOp(false);
player.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP); p.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
} }
} }

View File

@ -28,18 +28,18 @@ public class Command_qop extends TFM_Command
String target_name = args[0].toLowerCase(); String target_name = args[0].toLowerCase();
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (player.getName().toLowerCase().indexOf(target_name) != -1 || player.getDisplayName().toLowerCase().indexOf(target_name) != -1) if (p.getName().toLowerCase().indexOf(target_name) != -1 || p.getDisplayName().toLowerCase().indexOf(target_name) != -1)
{ {
matched_player = true; matched_player = true;
if (!silent) if (!silent)
{ {
TFM_Util.adminAction(sender.getName(), "Opping " + player.getName(), false); TFM_Util.adminAction(sender.getName(), "Opping " + p.getName(), false);
} }
player.setOp(true); p.setOp(true);
player.sendMessage(TotalFreedomMod.YOU_ARE_OP); p.sendMessage(TotalFreedomMod.YOU_ARE_OP);
} }
} }

View File

@ -21,15 +21,15 @@ public class Command_radar extends TFM_Command
List<TFM_RadarData> radar_data = new ArrayList<TFM_RadarData>(); List<TFM_RadarData> radar_data = new ArrayList<TFM_RadarData>();
for (Player player : sender_pos.getWorld().getPlayers()) for (Player p : sender_pos.getWorld().getPlayers())
{ {
if (!player.equals(sender_p)) if (!p.equals(sender_p))
{ {
try try
{ {
radar_data.add(new TFM_RadarData(player, sender_pos.distance(player.getLocation()), player.getLocation())); radar_data.add(new TFM_RadarData(p, sender_pos.distance(p.getLocation()), p.getLocation()));
} }
catch (IllegalArgumentException e) catch (IllegalArgumentException ex)
{ {
} }
} }

View File

@ -15,9 +15,9 @@ public class Command_rank extends TFM_Command
{ {
if (senderIsConsole && args.length < 1) if (senderIsConsole && args.length < 1)
{ {
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
playerMsg(player.getName() + " is " + TFM_Util.getRank(player)); playerMsg(p.getName() + " is " + TFM_Util.getRank(p));
} }
return true; return true;
} }
@ -33,18 +33,18 @@ public class Command_rank extends TFM_Command
return true; return true;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
playerMsg(player.getName() + " is " + TFM_Util.getRank(player), ChatColor.AQUA); playerMsg(p.getName() + " is " + TFM_Util.getRank(p), ChatColor.AQUA);
return true; return true;
} }

View File

@ -26,7 +26,7 @@ public class Command_ro extends TFM_Command
{ {
from_material = Material.getMaterial(Integer.parseInt(args[0])); from_material = Material.getMaterial(Integer.parseInt(args[0]));
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
} }
@ -44,7 +44,7 @@ public class Command_ro extends TFM_Command
{ {
radius = Math.max(1, Math.min(50, Integer.parseInt(args[1]))); radius = Math.max(1, Math.min(50, Integer.parseInt(args[1])));
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
playerMsg("Invalid radius: " + args[1], ChatColor.RED); playerMsg("Invalid radius: " + args[1], ChatColor.RED);
return true; return true;
@ -58,9 +58,9 @@ public class Command_ro extends TFM_Command
{ {
target_player = getPlayer(args[2]); target_player = getPlayer(args[2]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
} }
@ -70,9 +70,9 @@ public class Command_ro extends TFM_Command
if (target_player == null) if (target_player == null)
{ {
TFM_Util.adminAction(sender.getName(), "Removing all " + from_material.name() + " within " + radius + " blocks of all players. Brace for lag...", senderIsConsole); TFM_Util.adminAction(sender.getName(), "Removing all " + from_material.name() + " within " + radius + " blocks of all players. Brace for lag...", senderIsConsole);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
affected += TFM_Util.replaceBlocks(player.getLocation(), from_material, Material.AIR, radius); affected += TFM_Util.replaceBlocks(p.getLocation(), from_material, Material.AIR, radius);
} }
} }
else else

View File

@ -60,7 +60,7 @@ public class Command_rollback extends TFM_Command
playerName = player.getName(); playerName = player.getName();
} }
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
} }

View File

@ -66,7 +66,7 @@ public class Command_saconfig extends TFM_Command
{ {
superadmin = TFM_SuperadminList.getAdminEntry(getPlayer(args[1]).getName().toLowerCase()); superadmin = TFM_SuperadminList.getAdminEntry(getPlayer(args[1]).getName().toLowerCase());
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
} }
} }
@ -91,14 +91,14 @@ public class Command_saconfig extends TFM_Command
if (args[0].equalsIgnoreCase("add")) if (args[0].equalsIgnoreCase("add"))
{ {
Player player = null; Player p = null;
String admin_name = null; String admin_name = null;
try try
{ {
player = getPlayer(args[1]); p = getPlayer(args[1]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
TFM_Superadmin superadmin = TFM_SuperadminList.getAdminEntry(args[1].toLowerCase()); TFM_Superadmin superadmin = TFM_SuperadminList.getAdminEntry(args[1].toLowerCase());
if (superadmin != null) if (superadmin != null)
@ -107,15 +107,15 @@ public class Command_saconfig extends TFM_Command
} }
else else
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
} }
if (player != null) if (p != null)
{ {
TFM_Util.adminAction(sender.getName(), "Adding " + player.getName() + " to the superadmin list.", true); TFM_Util.adminAction(sender.getName(), "Adding " + p.getName() + " to the superadmin list.", true);
TFM_SuperadminList.addSuperadmin(player); TFM_SuperadminList.addSuperadmin(p);
} }
else if (admin_name != null) else if (admin_name != null)
{ {
@ -137,7 +137,7 @@ public class Command_saconfig extends TFM_Command
{ {
target_name = getPlayer(target_name).getName(); target_name = getPlayer(target_name).getName();
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
} }

View File

@ -27,9 +27,9 @@ public class Command_say extends TFM_Command
{ {
TFM_Util.bcastMsg("Server is going offline.", ChatColor.GRAY); TFM_Util.bcastMsg("Server is going offline.", ChatColor.GRAY);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
player.kickPlayer("Server is going offline, come back in a few minutes."); p.kickPlayer("Server is going offline, come back in a few minutes.");
} }
server.shutdown(); server.shutdown();

View File

@ -15,9 +15,9 @@ public class Command_setl extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "Setting everyone's Worldedit block modification limit to 500.", true); TFM_Util.adminAction(sender.getName(), "Setting everyone's Worldedit block modification limit to 500.", true);
TFM_WorldEditBridge web = TFM_WorldEditBridge.getInstance(); TFM_WorldEditBridge web = TFM_WorldEditBridge.getInstance();
for (final Player player: server.getOnlinePlayers()) for (final Player p : server.getOnlinePlayers())
{ {
web.setLimit(player, 500); web.setLimit(p, 500);
} }
return true; return true;
} }

View File

@ -32,7 +32,7 @@ public class Command_setlevel extends TFM_Command
new_level = 50; new_level = 50;
} }
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
playerMsg("Invalid level.", ChatColor.RED); playerMsg("Invalid level.", ChatColor.RED);
return true; return true;

View File

@ -21,38 +21,38 @@ public class Command_smite extends TFM_Command
return false; return false;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
smite(player); smite(p);
return true; return true;
} }
public static void smite(final Player player) public static void smite(final Player p)
{ {
TFM_Util.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED); TFM_Util.bcastMsg(p.getName() + " has been a naughty, naughty boy.", ChatColor.RED);
//Deop //Deop
player.setOp(false); p.setOp(false);
//Set gamemode to survival: //Set gamemode to survival:
player.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
//Clear inventory: //Clear inventory:
player.getInventory().clear(); p.getInventory().clear();
//Strike with lightning effect: //Strike with lightning effect:
final Location target_pos = player.getLocation(); final Location target_pos = p.getLocation();
final World world = player.getWorld(); final World world = p.getWorld();
for (int x = -1; x <= 1; x++) for (int x = -1; x <= 1; x++)
{ {
for (int z = -1; z <= 1; z++) for (int z = -1; z <= 1; z++)
@ -63,6 +63,6 @@ public class Command_smite extends TFM_Command
} }
//Kill: //Kill:
player.setHealth(0.0); p.setHealth(0.0);
} }
} }

View File

@ -66,11 +66,11 @@ public class Command_stfu extends TFM_Command
TFM_PlayerData playerdata; TFM_PlayerData playerdata;
int counter = 0; int counter = 0;
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
playerdata = TFM_PlayerData.getPlayerData(player); playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.setMuted(true); playerdata.setMuted(true);
counter++; counter++;
} }
@ -87,9 +87,9 @@ public class Command_stfu extends TFM_Command
public void run() public void run()
{ {
TFM_Util.adminAction("MuteTimer", "Unmuting all players", false); TFM_Util.adminAction("MuteTimer", "Unmuting all players", false);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
TFM_PlayerData.getPlayerData(player).setMuted(false); TFM_PlayerData.getPlayerData(p).setMuted(false);
} }
} }
}.runTaskLater(plugin, 20L * 60L * 5L); }.runTaskLater(plugin, 20L * 60L * 5L);
@ -98,35 +98,35 @@ public class Command_stfu extends TFM_Command
} }
else else
{ {
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
sender.sendMessage(e.getMessage()); sender.sendMessage(ex.getMessage());
return true; return true;
} }
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
if (playerdata.isMuted()) if (playerdata.isMuted())
{ {
TFM_Util.adminAction(sender.getName(), "Unmuting " + player.getName(), true); TFM_Util.adminAction(sender.getName(), "Unmuting " + p.getName(), true);
playerdata.setMuted(false); playerdata.setMuted(false);
playerMsg("Unmuted " + player.getName()); playerMsg("Unmuted " + p.getName());
} }
else else
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
TFM_Util.adminAction(sender.getName(), "Muting " + player.getName(), true); TFM_Util.adminAction(sender.getName(), "Muting " + p.getName(), true);
playerdata.setMuted(true); playerdata.setMuted(true);
playerMsg("Muted " + player.getName()); playerMsg("Muted " + p.getName());
} }
else else
{ {
playerMsg(player.getName() + " is a superadmin, and can't be muted."); playerMsg(p.getName() + " is a superadmin, and can't be muted.");
} }
} }
} }

View File

@ -15,9 +15,9 @@ public class Command_stop extends TFM_Command
{ {
TFM_Util.bcastMsg("Server is going offline!", ChatColor.LIGHT_PURPLE); TFM_Util.bcastMsg("Server is going offline!", ChatColor.LIGHT_PURPLE);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
player.kickPlayer("Server is going offline, come back in about 20 seconds."); p.kickPlayer("Server is going offline, come back in about 20 seconds.");
} }
server.shutdown(); server.shutdown();

View File

@ -26,11 +26,11 @@ public class Command_survival extends TFM_Command
} }
} }
Player player; Player p;
if (args.length == 0) if (args.length == 0)
{ {
player = sender_p; p = sender_p;
} }
else else
{ {
@ -42,9 +42,9 @@ public class Command_survival extends TFM_Command
return true; return true;
} }
for (Player target : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {
target.setGameMode(GameMode.SURVIVAL); player.setGameMode(GameMode.SURVIVAL);
} }
TFM_Util.adminAction(sender.getName(), "Changing everyone's gamemode to survival", false); TFM_Util.adminAction(sender.getName(), "Changing everyone's gamemode to survival", false);
@ -55,11 +55,11 @@ public class Command_survival extends TFM_Command
{ {
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
} }
@ -70,9 +70,9 @@ public class Command_survival extends TFM_Command
} }
} }
playerMsg("Setting " + player.getName() + " to game mode 'Survival'."); playerMsg("Setting " + p.getName() + " to game mode 'Survival'.");
player.sendMessage(sender.getName() + " set your game mode to 'Survival'."); p.sendMessage(sender.getName() + " set your game mode to 'Survival'.");
player.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
return true; return true;
} }

View File

@ -35,14 +35,14 @@ public class Command_tag extends TFM_Command
TFM_Util.adminAction(sender.getName(), "Removing all tags", false); TFM_Util.adminAction(sender.getName(), "Removing all tags", false);
int count = 0; int count = 0;
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
if (playerdata.getTag() != null) if (playerdata.getTag() != null)
{ {
count++; count++;
TFM_PlayerData.getPlayerData(player).setTag(null); TFM_PlayerData.getPlayerData(p).setTag(null);
} }
} }
@ -104,19 +104,19 @@ public class Command_tag extends TFM_Command
return true; return true;
} }
final Player player; final Player p;
try try
{ {
player = getPlayer(args[1]); p = getPlayer(args[1]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage()); playerMsg(ex.getMessage());
return true; return true;
} }
TFM_PlayerData.getPlayerData(player).setTag(null); TFM_PlayerData.getPlayerData(p).setTag(null);
playerMsg("Removed " + player.getName() + "'s tag."); playerMsg("Removed " + p.getName() + "'s tag.");
return true; return true;
} }

View File

@ -19,21 +19,21 @@ public class Command_tban extends TFM_Command
return false; return false;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
TFM_Util.adminAction(sender.getName(), "NOPE: " + player.getName(), true); TFM_Util.adminAction(sender.getName(), "NOPE: " + p.getName(), true);
TFM_ServerInterface.banUsername(player.getName(), ChatColor.RED + "You have been temporarily banned for 5 minutes", TFM_ServerInterface.banUsername(p.getName(), ChatColor.RED + "You have been temporarily banned for 5 minutes",
sender.getName(), TFM_Util.parseDateOffset("5m")); sender.getName(), TFM_Util.parseDateOffset("5m"));
player.kickPlayer(ChatColor.RED + "NOPE!\nYou have been temporarily banned for five minutes."); p.kickPlayer(ChatColor.RED + "NOPE!\nYou have been temporarily banned for five minutes.");
return true; return true;
} }

View File

@ -25,18 +25,18 @@ public class Command_tempban extends TFM_Command
return false; return false;
} }
Player player; Player p;
try try
{ {
player = getPlayer(args[0]); p = getPlayer(args[0]);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
playerMsg(e.getMessage(), ChatColor.RED); playerMsg(ex.getMessage(), ChatColor.RED);
return true; return true;
} }
StringBuilder bcast_msg = new StringBuilder("Temporarily banned " + player.getName()); StringBuilder bcast_msg = new StringBuilder("Temporarily banned " + p.getName());
Date ban_duration = TFM_Util.parseDateOffset("30m"); Date ban_duration = TFM_Util.parseDateOffset("30m");
if (args.length >= 2) if (args.length >= 2)
@ -57,9 +57,9 @@ public class Command_tempban extends TFM_Command
} }
TFM_Util.adminAction(sender.getName(), bcast_msg.toString(), true); TFM_Util.adminAction(sender.getName(), bcast_msg.toString(), true);
TFM_ServerInterface.banUsername(player.getName(), ban_reason, sender.getName(), ban_duration); TFM_ServerInterface.banUsername(p.getName(), ban_reason, sender.getName(), ban_duration);
TFM_ServerInterface.banIP(player.getAddress().getAddress().getHostAddress().trim(), ban_reason, sender.getName(), ban_duration); TFM_ServerInterface.banIP(p.getAddress().getAddress().getHostAddress().trim(), ban_reason, sender.getName(), ban_duration);
player.kickPlayer(sender.getName() + " - " + bcast_msg.toString()); p.kickPlayer(sender.getName() + " - " + bcast_msg.toString());
return true; return true;
} }

View File

@ -29,9 +29,9 @@ public class Command_tfbanlist extends TFM_Command
TFM_ServerInterface.wipeNameBans(); TFM_ServerInterface.wipeNameBans();
sender.sendMessage(ChatColor.GRAY + "Ban list has been purged."); sender.sendMessage(ChatColor.GRAY + "Ban list has been purged.");
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
return true; return true;
@ -46,14 +46,14 @@ public class Command_tfbanlist extends TFM_Command
StringBuilder banned_players = new StringBuilder(); StringBuilder banned_players = new StringBuilder();
banned_players.append("Banned Players: "); banned_players.append("Banned Players: ");
boolean first = true; boolean first = true;
for (OfflinePlayer player: server.getBannedPlayers()) for (OfflinePlayer p : server.getBannedPlayers())
{ {
if (!first) if (!first)
{ {
banned_players.append(", "); banned_players.append(", ");
} }
first = false; first = false;
banned_players.append(player.getName().trim()); banned_players.append(p.getName().trim());
} }
playerMsg(banned_players.toString()); playerMsg(banned_players.toString());

View File

@ -29,9 +29,9 @@ public class Command_tfipbanlist extends TFM_Command
TFM_ServerInterface.wipeIpBans(); TFM_ServerInterface.wipeIpBans();
sender.sendMessage(ChatColor.GRAY + "IP ban list has been purged."); sender.sendMessage(ChatColor.GRAY + "IP ban list has been purged.");
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
return true; return true;

View File

@ -57,9 +57,9 @@ public class Command_tfupdate extends TFM_Command
TFM_Util.downloadFile(url, file, true); TFM_Util.downloadFile(url, file, true);
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
}.runTaskAsynchronously(plugin); }.runTaskAsynchronously(plugin);

View File

@ -47,7 +47,7 @@ public class Command_tossmob extends TFM_Command
{ {
creature = TFM_Util.getEntityType(args[0]); creature = TFM_Util.getEntityType(args[0]);
} }
catch (Exception e) catch (Exception ex)
{ {
playerMsg(args[0] + " is not a supported mob type. Using a pig instead.", ChatColor.RED); playerMsg(args[0] + " is not a supported mob type. Using a pig instead.", ChatColor.RED);
playerMsg("By the way, you can type /tossmob list to see all possible mobs.", ChatColor.RED); playerMsg("By the way, you can type /tossmob list to see all possible mobs.", ChatColor.RED);

View File

@ -35,9 +35,9 @@ public class Command_whitelist extends TFM_Command
int offlineWPs = 0; int offlineWPs = 0;
int totalWPs = 0; int totalWPs = 0;
for (OfflinePlayer player: server.getWhitelistedPlayers()) for (OfflinePlayer p : server.getWhitelistedPlayers())
{ {
if (player.isOnline()) if (p.isOnline())
{ {
onlineWPs++; onlineWPs++;
} }
@ -88,18 +88,18 @@ public class Command_whitelist extends TFM_Command
String search_name = args[1].trim().toLowerCase(); String search_name = args[1].trim().toLowerCase();
OfflinePlayer player; OfflinePlayer p;
try try
{ {
player = getPlayer(search_name); p = getPlayer(search_name);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
player = server.getOfflinePlayer(search_name); p = server.getOfflinePlayer(search_name);
} }
TFM_Util.adminAction(sender.getName(), "Adding " + player.getName() + " to the whitelist.", false); TFM_Util.adminAction(sender.getName(), "Adding " + p.getName() + " to the whitelist.", false);
player.setWhitelisted(true); p.setWhitelisted(true);
return true; return true;
} }
@ -113,20 +113,20 @@ public class Command_whitelist extends TFM_Command
String search_name = args[1].trim().toLowerCase(); String search_name = args[1].trim().toLowerCase();
OfflinePlayer player; OfflinePlayer p;
try try
{ {
player = getPlayer(search_name); p = getPlayer(search_name);
} }
catch (PlayerNotFoundException e) catch (PlayerNotFoundException ex)
{ {
player = server.getOfflinePlayer(search_name); p = server.getOfflinePlayer(search_name);
} }
if (player.isWhitelisted()) if (p.isWhitelisted())
{ {
TFM_Util.adminAction(sender.getName(), "Removing " + player.getName() + " from the whitelist.", false); TFM_Util.adminAction(sender.getName(), "Removing " + p.getName() + " from the whitelist.", false);
player.setWhitelisted(false); p.setWhitelisted(false);
return true; return true;
} }
else else
@ -142,11 +142,11 @@ public class Command_whitelist extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "Adding all online players to the whitelist.", false); TFM_Util.adminAction(sender.getName(), "Adding all online players to the whitelist.", false);
int counter = 0; int counter = 0;
for (Player player : server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (!player.isWhitelisted()) if (!p.isWhitelisted())
{ {
player.setWhitelisted(true); p.setWhitelisted(true);
counter++; counter++;
} }
} }

View File

@ -39,7 +39,7 @@ public class Command_whohas extends TFM_Command
{ {
material = Material.getMaterial(Integer.parseInt(args[0])); material = Material.getMaterial(Integer.parseInt(args[0]));
} }
catch (NumberFormatException e) catch (NumberFormatException ex)
{ {
} }
@ -52,14 +52,14 @@ public class Command_whohas extends TFM_Command
List<String> players = new ArrayList<String>(); List<String> players = new ArrayList<String>();
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (player.getInventory().contains(material)) if (p.getInventory().contains(material))
{ {
players.add(player.getName()); players.add(p.getName());
if (smite & !TFM_SuperadminList.isUserSuperadmin(player)) if (smite & !TFM_SuperadminList.isUserSuperadmin(p))
{ {
Command_smite.smite(player); Command_smite.smite(p);
} }
} }
} }

View File

@ -36,9 +36,9 @@ public class Command_wildcard extends TFM_Command
String base_command = StringUtils.join(args, " "); String base_command = StringUtils.join(args, " ");
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
String out_command = base_command.replaceAll("\\x3f", player.getName()); String out_command = base_command.replaceAll("\\x3f", p.getName());
playerMsg("Running Command: " + out_command); playerMsg("Running Command: " + out_command);
server.dispatchCommand(sender, out_command); server.dispatchCommand(sender, out_command);
} }

View File

@ -17,9 +17,9 @@ public class Command_wipeflatlands extends TFM_Command
TFM_Util.bcastMsg("Server is going offline for flatlands wipe.", ChatColor.GRAY); TFM_Util.bcastMsg("Server is going offline for flatlands wipe.", ChatColor.GRAY);
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
player.kickPlayer("Server is going offline for flatlands wipe, come back in a few minutes."); p.kickPlayer("Server is going offline for flatlands wipe, come back in a few minutes.");
} }
server.shutdown(); server.shutdown();

View File

@ -143,11 +143,11 @@ public abstract class TFM_Command
List<Player> matches = server.matchPlayer(partialname); List<Player> matches = server.matchPlayer(partialname);
if (matches.isEmpty()) if (matches.isEmpty())
{ {
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
if (player.getDisplayName().toLowerCase().contains(partialname.toLowerCase())) if (p.getDisplayName().toLowerCase().contains(partialname.toLowerCase()))
{ {
return player; return p;
} }
} }
throw new PlayerNotFoundException(partialname); throw new PlayerNotFoundException(partialname);

View File

@ -103,9 +103,9 @@ public class TFM_CommandLoader
} }
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
@ -176,17 +176,17 @@ public class TFM_CommandLoader
commandList.add(commandInfo); commandList.add(commandInfo);
} }
} }
catch (ClassNotFoundException e) catch (ClassNotFoundException ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
} }
} }
} }
catch (IOException e) catch (IOException ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
return commandList; return commandList;
@ -292,9 +292,9 @@ public class TFM_CommandLoader
{ {
success = getPlugin().onCommand(sender, this, commandLabel, args); success = getPlugin().onCommand(sender, this, commandLabel, args);
} }
catch (Throwable e) catch (Throwable ex)
{ {
throw new CommandException("Unhandled exception executing command '" + commandLabel + "' in plugin " + getPlugin().getDescription().getFullName(), e); throw new CommandException("Unhandled exception executing command '" + commandLabel + "' in plugin " + getPlugin().getDescription().getFullName(), ex);
} }
if (!success && getUsage().length() > 0) if (!success && getUsage().length() > 0)

View File

@ -41,14 +41,14 @@ public class TFM_BlockListener implements Listener
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)
public void onBlockBreak(BlockBreakEvent event) public void onBlockBreak(BlockBreakEvent event)
{ {
Player player = event.getPlayer(); Player p = event.getPlayer();
Location block_pos = event.getBlock().getLocation(); Location block_pos = event.getBlock().getLocation();
if (TotalFreedomMod.nukeMonitor) if (TotalFreedomMod.nukeMonitor)
{ {
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
Location player_pos = player.getLocation(); Location player_pos = p.getLocation();
boolean out_of_range = false; boolean out_of_range = false;
if (!player_pos.getWorld().equals(block_pos.getWorld())) if (!player_pos.getWorld().equals(block_pos.getWorld()))
@ -64,8 +64,8 @@ public class TFM_BlockListener implements Listener
{ {
if (playerdata.incrementAndGetFreecamDestroyCount() > TotalFreedomMod.freecamTriggerCount) if (playerdata.incrementAndGetFreecamDestroyCount() > TotalFreedomMod.freecamTriggerCount)
{ {
TFM_Util.bcastMsg(player.getName() + " has been flagged for possible freecam nuking.", ChatColor.RED); TFM_Util.bcastMsg(p.getName() + " has been flagged for possible freecam nuking.", ChatColor.RED);
TFM_Util.autoEject(player, "Freecam (extended range) block breaking is not permitted on this server."); TFM_Util.autoEject(p, "Freecam (extended range) block breaking is not permitted on this server.");
playerdata.resetFreecamDestroyCount(); playerdata.resetFreecamDestroyCount();
@ -83,8 +83,8 @@ public class TFM_BlockListener implements Listener
{ {
if (playerdata.incrementAndGetBlockDestroyCount() > TotalFreedomMod.nukeMonitorCountBreak) if (playerdata.incrementAndGetBlockDestroyCount() > TotalFreedomMod.nukeMonitorCountBreak)
{ {
TFM_Util.bcastMsg(player.getName() + " is breaking blocks too fast!", ChatColor.RED); TFM_Util.bcastMsg(p.getName() + " is breaking blocks too fast!", ChatColor.RED);
TFM_Util.autoEject(player, "You are breaking blocks too fast. Nukers are not permitted on this server."); TFM_Util.autoEject(p, "You are breaking blocks too fast. Nukers are not permitted on this server.");
playerdata.resetBlockDestroyCount(); playerdata.resetBlockDestroyCount();
@ -96,7 +96,7 @@ public class TFM_BlockListener implements Listener
if (TotalFreedomMod.protectedAreasEnabled) if (TotalFreedomMod.protectedAreasEnabled)
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
if (TFM_ProtectedArea.isInProtectedArea(block_pos)) if (TFM_ProtectedArea.isInProtectedArea(block_pos))
{ {
@ -115,14 +115,14 @@ public class TFM_BlockListener implements Listener
@EventHandler(priority = EventPriority.HIGH) @EventHandler(priority = EventPriority.HIGH)
public void onBlockPlace(BlockPlaceEvent event) public void onBlockPlace(BlockPlaceEvent event)
{ {
Player player = event.getPlayer(); Player p = event.getPlayer();
Location block_pos = event.getBlock().getLocation(); Location block_pos = event.getBlock().getLocation();
if (TotalFreedomMod.nukeMonitor) if (TotalFreedomMod.nukeMonitor)
{ {
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
Location player_pos = player.getLocation(); Location player_pos = p.getLocation();
boolean out_of_range = false; boolean out_of_range = false;
if (!player_pos.getWorld().equals(block_pos.getWorld())) if (!player_pos.getWorld().equals(block_pos.getWorld()))
@ -138,8 +138,8 @@ public class TFM_BlockListener implements Listener
{ {
if (playerdata.incrementAndGetFreecamPlaceCount() > TotalFreedomMod.freecamTriggerCount) if (playerdata.incrementAndGetFreecamPlaceCount() > TotalFreedomMod.freecamTriggerCount)
{ {
TFM_Util.bcastMsg(player.getName() + " has been flagged for possible freecam building.", ChatColor.RED); TFM_Util.bcastMsg(p.getName() + " has been flagged for possible freecam building.", ChatColor.RED);
TFM_Util.autoEject(player, "Freecam (extended range) block building is not permitted on this server."); TFM_Util.autoEject(p, "Freecam (extended range) block building is not permitted on this server.");
playerdata.resetFreecamPlaceCount(); playerdata.resetFreecamPlaceCount();
@ -157,8 +157,8 @@ public class TFM_BlockListener implements Listener
{ {
if (playerdata.incrementAndGetBlockPlaceCount() > TotalFreedomMod.nukeMonitorCountPlace) if (playerdata.incrementAndGetBlockPlaceCount() > TotalFreedomMod.nukeMonitorCountPlace)
{ {
TFM_Util.bcastMsg(player.getName() + " is placing blocks too fast!", ChatColor.RED); TFM_Util.bcastMsg(p.getName() + " is placing blocks too fast!", ChatColor.RED);
TFM_Util.autoEject(player, "You are placing blocks too fast."); TFM_Util.autoEject(p, "You are placing blocks too fast.");
playerdata.resetBlockPlaceCount(); playerdata.resetBlockPlaceCount();
@ -170,7 +170,7 @@ public class TFM_BlockListener implements Listener
if (TotalFreedomMod.protectedAreasEnabled) if (TotalFreedomMod.protectedAreasEnabled)
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
if (TFM_ProtectedArea.isInProtectedArea(block_pos)) if (TFM_ProtectedArea.isInProtectedArea(block_pos))
{ {
@ -187,14 +187,14 @@ public class TFM_BlockListener implements Listener
{ {
if (TotalFreedomMod.allowLavaPlace) if (TotalFreedomMod.allowLavaPlace)
{ {
TFM_Log.info(String.format("%s placed lava @ %s", player.getName(), TFM_Util.formatLocation(event.getBlock().getLocation()))); TFM_Log.info(String.format("%s placed lava @ %s", p.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
player.getInventory().clear(player.getInventory().getHeldItemSlot()); p.getInventory().clear(p.getInventory().getHeldItemSlot());
} }
else else
{ {
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1)); p.getInventory().setItem(p.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
player.sendMessage(ChatColor.GRAY + "Lava placement is currently disabled."); p.sendMessage(ChatColor.GRAY + "Lava placement is currently disabled.");
event.setCancelled(true); event.setCancelled(true);
} }
@ -205,14 +205,14 @@ public class TFM_BlockListener implements Listener
{ {
if (TotalFreedomMod.allowWaterPlace) if (TotalFreedomMod.allowWaterPlace)
{ {
TFM_Log.info(String.format("%s placed water @ %s", player.getName(), TFM_Util.formatLocation(event.getBlock().getLocation()))); TFM_Log.info(String.format("%s placed water @ %s", p.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
player.getInventory().clear(player.getInventory().getHeldItemSlot()); p.getInventory().clear(p.getInventory().getHeldItemSlot());
} }
else else
{ {
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1)); p.getInventory().setItem(p.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
player.sendMessage(ChatColor.GRAY + "Water placement is currently disabled."); p.sendMessage(ChatColor.GRAY + "Water placement is currently disabled.");
event.setCancelled(true); event.setCancelled(true);
} }
@ -222,14 +222,14 @@ public class TFM_BlockListener implements Listener
{ {
if (TotalFreedomMod.allowFirePlace) if (TotalFreedomMod.allowFirePlace)
{ {
TFM_Log.info(String.format("%s placed fire @ %s", player.getName(), TFM_Util.formatLocation(event.getBlock().getLocation()))); TFM_Log.info(String.format("%s placed fire @ %s", p.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
player.getInventory().clear(player.getInventory().getHeldItemSlot()); p.getInventory().clear(p.getInventory().getHeldItemSlot());
} }
else else
{ {
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1)); p.getInventory().setItem(p.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
player.sendMessage(ChatColor.GRAY + "Fire placement is currently disabled."); p.sendMessage(ChatColor.GRAY + "Fire placement is currently disabled.");
event.setCancelled(true); event.setCancelled(true);
} }
@ -239,15 +239,15 @@ public class TFM_BlockListener implements Listener
{ {
if (TotalFreedomMod.allowExplosions) if (TotalFreedomMod.allowExplosions)
{ {
TFM_Log.info(String.format("%s placed TNT @ %s", player.getName(), TFM_Util.formatLocation(event.getBlock().getLocation()))); TFM_Log.info(String.format("%s placed TNT @ %s", p.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
player.getInventory().clear(player.getInventory().getHeldItemSlot()); p.getInventory().clear(p.getInventory().getHeldItemSlot());
} }
else else
{ {
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1)); p.getInventory().setItem(p.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
player.sendMessage(ChatColor.GRAY + "TNT is currently disabled."); p.sendMessage(ChatColor.GRAY + "TNT is currently disabled.");
event.setCancelled(true); event.setCancelled(true);
} }
break; break;

View File

@ -233,7 +233,7 @@ public class TFM_PlayerListener implements Listener
return; return;
} }
} }
catch (IllegalArgumentException e) catch (IllegalArgumentException ex)
{ {
} }
@ -242,21 +242,21 @@ public class TFM_PlayerListener implements Listener
return; return;
} }
Player player = event.getPlayer(); Player p = event.getPlayer();
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
for (Entry<Player, Double> fuckoff : TotalFreedomMod.fuckoffEnabledFor.entrySet()) for (Entry<Player, Double> fuckoff : TotalFreedomMod.fuckoffEnabledFor.entrySet())
{ {
Player fuckoff_player = fuckoff.getKey(); Player fuckoff_player = fuckoff.getKey();
if (fuckoff_player.equals(player) || !fuckoff_player.isOnline()) if (fuckoff_player.equals(p) || !fuckoff_player.isOnline())
{ {
continue; continue;
} }
double fuckoff_range = fuckoff.getValue().doubleValue(); double fuckoff_range = fuckoff.getValue().doubleValue();
Location mover_pos = player.getLocation(); Location mover_pos = p.getLocation();
Location fuckoff_pos = fuckoff_player.getLocation(); Location fuckoff_pos = fuckoff_player.getLocation();
double distanceSquared; double distanceSquared;
@ -264,7 +264,7 @@ public class TFM_PlayerListener implements Listener
{ {
distanceSquared = mover_pos.distanceSquared(fuckoff_pos); distanceSquared = mover_pos.distanceSquared(fuckoff_pos);
} }
catch (IllegalArgumentException e) catch (IllegalArgumentException ex)
{ {
continue; continue;
} }
@ -279,7 +279,7 @@ public class TFM_PlayerListener implements Listener
boolean do_freeze = false; boolean do_freeze = false;
if (TotalFreedomMod.allPlayersFrozen) if (TotalFreedomMod.allPlayersFrozen)
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
do_freeze = true; do_freeze = true;
} }
@ -305,7 +305,7 @@ public class TFM_PlayerListener implements Listener
if (playerdata.isCaged()) if (playerdata.isCaged())
{ {
Location target_pos = player.getLocation().add(0, 1, 0); Location target_pos = p.getLocation().add(0, 1, 0);
boolean out_of_cage; boolean out_of_cage;
if (!target_pos.getWorld().equals(playerdata.getCagePos().getWorld())) if (!target_pos.getWorld().equals(playerdata.getCagePos().getWorld()))
@ -330,9 +330,9 @@ public class TFM_PlayerListener implements Listener
if (playerdata.isOrbiting()) if (playerdata.isOrbiting())
{ {
if (player.getVelocity().length() < playerdata.orbitStrength() * (2.0 / 3.0)) if (p.getVelocity().length() < playerdata.orbitStrength() * (2.0 / 3.0))
{ {
player.setVelocity(new Vector(0, playerdata.orbitStrength(), 0)); p.setVelocity(new Vector(0, playerdata.orbitStrength(), 0));
} }
} }
@ -355,23 +355,23 @@ public class TFM_PlayerListener implements Listener
continue; continue;
} }
if (!landmine.player.equals(player)) if (!landmine.player.equals(p))
{ {
if (player.getWorld().equals(landmine_pos.getWorld())) if (p.getWorld().equals(landmine_pos.getWorld()))
{ {
if (player.getLocation().distanceSquared(landmine_pos) <= (landmine.radius * landmine.radius)) if (p.getLocation().distanceSquared(landmine_pos) <= (landmine.radius * landmine.radius))
{ {
landmine.landmine_pos.getBlock().setType(Material.AIR); landmine.landmine_pos.getBlock().setType(Material.AIR);
TNTPrimed tnt1 = landmine_pos.getWorld().spawn(landmine_pos, TNTPrimed.class); TNTPrimed tnt1 = landmine_pos.getWorld().spawn(landmine_pos, TNTPrimed.class);
tnt1.setFuseTicks(40); tnt1.setFuseTicks(40);
tnt1.setPassenger(player); tnt1.setPassenger(p);
tnt1.setVelocity(new Vector(0.0, 2.0, 0.0)); tnt1.setVelocity(new Vector(0.0, 2.0, 0.0));
TNTPrimed tnt2 = landmine_pos.getWorld().spawn(player.getLocation(), TNTPrimed.class); TNTPrimed tnt2 = landmine_pos.getWorld().spawn(p.getLocation(), TNTPrimed.class);
tnt2.setFuseTicks(1); tnt2.setFuseTicks(1);
player.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
landmines.remove(); landmines.remove();
} }
} }
@ -392,10 +392,10 @@ public class TFM_PlayerListener implements Listener
{ {
try try
{ {
final Player player = event.getPlayer(); final Player p = event.getPlayer();
String message = event.getMessage().trim(); String message = event.getMessage().trim();
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
// Check for spam // Check for spam
Long lastRan = TFM_Heartbeat.getLastRan(); Long lastRan = TFM_Heartbeat.getLastRan();
@ -407,8 +407,8 @@ public class TFM_PlayerListener implements Listener
{ {
if (playerdata.incrementAndGetMsgCount() > MSG_PER_HEARTBEAT) if (playerdata.incrementAndGetMsgCount() > MSG_PER_HEARTBEAT)
{ {
TFM_Util.bcastMsg(player.getName() + " was automatically kicked for spamming chat.", ChatColor.RED); TFM_Util.bcastMsg(p.getName() + " was automatically kicked for spamming chat.", ChatColor.RED);
TFM_Util.autoEject(player, "Kicked for spamming chat."); TFM_Util.autoEject(p, "Kicked for spamming chat.");
playerdata.resetMsgCount(); playerdata.resetMsgCount();
@ -420,7 +420,7 @@ public class TFM_PlayerListener implements Listener
// Check for message repeat // Check for message repeat
if (playerdata.getLastMessage().equalsIgnoreCase(message)) if (playerdata.getLastMessage().equalsIgnoreCase(message))
{ {
TFM_Util.playerMsg(player, "Please do not repeat messages."); TFM_Util.playerMsg(p, "Please do not repeat messages.");
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -429,9 +429,9 @@ public class TFM_PlayerListener implements Listener
// Check for muted // Check for muted
if (playerdata.isMuted()) if (playerdata.isMuted())
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
player.sendMessage(ChatColor.RED + "You are muted, STFU!"); p.sendMessage(ChatColor.RED + "You are muted, STFU!");
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -448,7 +448,7 @@ public class TFM_PlayerListener implements Listener
if (message.length() > 100) if (message.length() > 100)
{ {
message = message.substring(0, 100); message = message.substring(0, 100);
TFM_Util.playerMsg(player, "Message was shortened because it was too long to send."); TFM_Util.playerMsg(p, "Message was shortened because it was too long to send.");
} }
// Check for caps // Check for caps
@ -471,7 +471,7 @@ public class TFM_PlayerListener implements Listener
// Check for adminchat // Check for adminchat
if (playerdata.inAdminChat()) if (playerdata.inAdminChat())
{ {
TFM_Util.adminChatMessage(player, message, false); TFM_Util.adminChatMessage(p, message, false);
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -482,13 +482,13 @@ public class TFM_PlayerListener implements Listener
// Set the tag // Set the tag
if (playerdata.getTag() != null) if (playerdata.getTag() != null)
{ {
player.setDisplayName((playerdata.getTag() + " " + player.getDisplayName().replaceAll(" ", ""))); p.setDisplayName((playerdata.getTag() + " " + p.getDisplayName().replaceAll(" ", "")));
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
@ -496,15 +496,15 @@ public class TFM_PlayerListener implements Listener
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
{ {
String command = event.getMessage(); String command = event.getMessage();
Player player = event.getPlayer(); Player p = event.getPlayer();
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.setLastCommand(command); playerdata.setLastCommand(command);
if (playerdata.incrementAndGetMsgCount() > MSG_PER_HEARTBEAT) if (playerdata.incrementAndGetMsgCount() > MSG_PER_HEARTBEAT)
{ {
TFM_Util.bcastMsg(player.getName() + " was automatically kicked for spamming commands.", ChatColor.RED); TFM_Util.bcastMsg(p.getName() + " was automatically kicked for spamming commands.", ChatColor.RED);
TFM_Util.autoEject(player, "Kicked for spamming commands."); TFM_Util.autoEject(p, "Kicked for spamming commands.");
playerdata.resetMsgCount(); playerdata.resetMsgCount();
@ -516,7 +516,7 @@ public class TFM_PlayerListener implements Listener
if (playerdata.allCommandsBlocked()) if (playerdata.allCommandsBlocked())
{ {
TFM_Util.playerMsg(player, "Your commands have been blocked by an admin.", ChatColor.RED); TFM_Util.playerMsg(p, "Your commands have been blocked by an admin.", ChatColor.RED);
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -524,13 +524,13 @@ public class TFM_PlayerListener implements Listener
// Block commands if player is muted // Block commands if player is muted
if (playerdata.isMuted()) if (playerdata.isMuted())
{ {
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
for (String test_command : BLOCKED_MUTED_CMDS) for (String test_command : BLOCKED_MUTED_CMDS)
{ {
if (Pattern.compile("^/" + test_command.toLowerCase() + " ").matcher(command).find()) if (Pattern.compile("^/" + test_command.toLowerCase() + " ").matcher(command).find())
{ {
player.sendMessage(ChatColor.RED + "That command is blocked while you are muted."); p.sendMessage(ChatColor.RED + "That command is blocked while you are muted.");
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
@ -544,7 +544,7 @@ public class TFM_PlayerListener implements Listener
if (TotalFreedomMod.preprocessLogEnabled) if (TotalFreedomMod.preprocessLogEnabled)
{ {
TFM_Log.info(String.format("[PREPROCESS_COMMAND] %s(%s): %s", player.getName(), ChatColor.stripColor(player.getDisplayName()), command), true); TFM_Log.info(String.format("[PREPROCESS_COMMAND] %s(%s): %s", p.getName(), ChatColor.stripColor(p.getDisplayName()), command), true);
} }
command = command.toLowerCase().trim(); command = command.toLowerCase().trim();
@ -556,13 +556,13 @@ public class TFM_PlayerListener implements Listener
event.setCancelled(true); event.setCancelled(true);
} }
if (!TFM_SuperadminList.isUserSuperadmin(player)) if (!TFM_SuperadminList.isUserSuperadmin(p))
{ {
for (Player pl : Bukkit.getOnlinePlayers()) for (Player pl : Bukkit.getOnlinePlayers())
{ {
if (TFM_SuperadminList.isUserSuperadmin(pl) && TFM_PlayerData.getPlayerData(pl).cmdspyEnabled()) if (TFM_SuperadminList.isUserSuperadmin(pl) && TFM_PlayerData.getPlayerData(pl).cmdspyEnabled())
{ {
TFM_Util.playerMsg(pl, player.getName() + ": " + command); TFM_Util.playerMsg(pl, p.getName() + ": " + command);
} }
} }
} }
@ -587,12 +587,12 @@ public class TFM_PlayerListener implements Listener
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onPlayerKick(PlayerKickEvent event) public void onPlayerKick(PlayerKickEvent event)
{ {
Player player = event.getPlayer(); Player p = event.getPlayer();
if (TotalFreedomMod.fuckoffEnabledFor.containsKey(player)) if (TotalFreedomMod.fuckoffEnabledFor.containsKey(p))
{ {
TotalFreedomMod.fuckoffEnabledFor.remove(player); TotalFreedomMod.fuckoffEnabledFor.remove(p);
} }
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.disarmMP44(); playerdata.disarmMP44();
if (playerdata.isCaged()) if (playerdata.isCaged())
{ {
@ -604,12 +604,12 @@ public class TFM_PlayerListener implements Listener
@EventHandler(priority = EventPriority.MONITOR) @EventHandler(priority = EventPriority.MONITOR)
public void onPlayerQuit(PlayerQuitEvent event) public void onPlayerQuit(PlayerQuitEvent event)
{ {
Player player = event.getPlayer(); Player p = event.getPlayer();
if (TotalFreedomMod.fuckoffEnabledFor.containsKey(player)) if (TotalFreedomMod.fuckoffEnabledFor.containsKey(p))
{ {
TotalFreedomMod.fuckoffEnabledFor.remove(player); TotalFreedomMod.fuckoffEnabledFor.remove(p);
} }
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.disarmMP44(); playerdata.disarmMP44();
if (playerdata.isCaged()) if (playerdata.isCaged())
{ {
@ -623,41 +623,41 @@ public class TFM_PlayerListener implements Listener
{ {
try try
{ {
final Player player = event.getPlayer(); final Player p = event.getPlayer();
final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.setSuperadminIdVerified(null); playerdata.setSuperadminIdVerified(null);
TFM_UserList.getInstance(TotalFreedomMod.plugin).addUser(player); TFM_UserList.getInstance(TotalFreedomMod.plugin).addUser(p);
boolean superadmin_impostor = TFM_SuperadminList.isSuperadminImpostor(player); boolean superadmin_impostor = TFM_SuperadminList.isSuperadminImpostor(p);
if (superadmin_impostor || TFM_SuperadminList.isUserSuperadmin(player)) if (superadmin_impostor || TFM_SuperadminList.isUserSuperadmin(p))
{ {
TFM_Util.bcastMsg(ChatColor.AQUA + player.getName() + " is " + TFM_Util.getRank(player)); TFM_Util.bcastMsg(ChatColor.AQUA + p.getName() + " is " + TFM_Util.getRank(p));
if (superadmin_impostor) if (superadmin_impostor)
{ {
player.getInventory().clear(); p.getInventory().clear();
player.setOp(false); p.setOp(false);
player.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
TFM_Util.bcastMsg("Warning: " + player.getName() + " has been flagged as an impostor!", ChatColor.RED); TFM_Util.bcastMsg("Warning: " + p.getName() + " has been flagged as an impostor!", ChatColor.RED);
} }
else else
{ {
if (TFM_SuperadminList.verifyIdentity(player.getName(), player.getAddress().getAddress().getHostAddress())) if (TFM_SuperadminList.verifyIdentity(p.getName(), p.getAddress().getAddress().getHostAddress()))
{ {
playerdata.setSuperadminIdVerified(Boolean.TRUE); playerdata.setSuperadminIdVerified(Boolean.TRUE);
TFM_SuperadminList.updateLastLogin(player); TFM_SuperadminList.updateLastLogin(p);
} }
else else
{ {
playerdata.setSuperadminIdVerified(Boolean.FALSE); playerdata.setSuperadminIdVerified(Boolean.FALSE);
TFM_Util.bcastMsg("Warning: " + player.getName() + " is an admin, but is using a username not registered to one of their IPs.", ChatColor.RED); TFM_Util.bcastMsg("Warning: " + p.getName() + " is an admin, but is using a username not registered to one of their IPs.", ChatColor.RED);
} }
player.setOp(true); p.setOp(true);
} }
} }
@ -668,12 +668,12 @@ public class TFM_PlayerListener implements Listener
@Override @Override
public void run() public void run()
{ {
player.sendMessage(ChatColor.RED + "Server is currently closed to non-superadmins."); p.sendMessage(ChatColor.RED + "Server is currently closed to non-superadmins.");
} }
}.runTaskLater(TotalFreedomMod.plugin, 20L * 3L); }.runTaskLater(TotalFreedomMod.plugin, 20L * 3L);
} }
} }
catch (Throwable e) catch (Throwable ex)
{ {
} }
} }

View File

@ -158,25 +158,25 @@ public class TFM_ServerListener implements Listener
} }
@Override @Override
public PermissionAttachment addAttachment(Plugin target_plugin, String name, boolean value) public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value)
{ {
return null; return null;
} }
@Override @Override
public PermissionAttachment addAttachment(Plugin target_plugin) public PermissionAttachment addAttachment(Plugin plugin)
{ {
return null; return null;
} }
@Override @Override
public PermissionAttachment addAttachment(Plugin target_plugin, String name, boolean value, int ticks) public PermissionAttachment addAttachment(Plugin plugin, String name, boolean value, int ticks)
{ {
return null; return null;
} }
@Override @Override
public PermissionAttachment addAttachment(Plugin target_plugin, int ticks) public PermissionAttachment addAttachment(Plugin plugin, int ticks)
{ {
return null; return null;
} }

View File

@ -26,9 +26,9 @@ public class TFM_DisguiseCraftBridge
return api.undisguisePlayer(player); return api.undisguisePlayer(player);
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
return false; return false;
@ -53,9 +53,9 @@ public class TFM_DisguiseCraftBridge
} }
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
@ -66,7 +66,7 @@ public class TFM_DisguiseCraftBridge
{ {
pluginEnabled = Bukkit.getPluginManager().isPluginEnabled("DisguiseCraft"); pluginEnabled = Bukkit.getPluginManager().isPluginEnabled("DisguiseCraft");
} }
catch (Exception e) catch (Exception ex)
{ {
} }
return pluginEnabled; return pluginEnabled;

View File

@ -27,9 +27,9 @@ public class TFM_Heartbeat extends BukkitRunnable
{ {
lastRan = System.currentTimeMillis(); lastRan = System.currentTimeMillis();
for (Player player: server.getOnlinePlayers()) for (Player p : server.getOnlinePlayers())
{ {
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player); TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
playerdata.resetMsgCount(); playerdata.resetMsgCount();
playerdata.resetBlockDestroyCount(); playerdata.resetBlockDestroyCount();
playerdata.resetBlockPlaceCount(); playerdata.resetBlockPlaceCount();

View File

@ -48,8 +48,8 @@ public class TFM_Log
TFM_Log.log(Level.SEVERE, message, raw); TFM_Log.log(Level.SEVERE, message, raw);
} }
public static void severe(Throwable e) public static void severe(Throwable ex)
{ {
logger.log(Level.SEVERE, null, e); logger.log(Level.SEVERE, null, ex);
} }
} }

View File

@ -62,9 +62,9 @@ public class TFM_PlayerData
this.player_name = player.getName(); this.player_name = player.getName();
} }
public static TFM_PlayerData getPlayerData(Player player) public static TFM_PlayerData getPlayerData(Player p)
{ {
TFM_PlayerData playerdata = TFM_PlayerData.userinfo.get(player); TFM_PlayerData playerdata = TFM_PlayerData.userinfo.get(p);
if (playerdata == null) if (playerdata == null)
{ {
@ -74,7 +74,7 @@ public class TFM_PlayerData
Entry<Player, TFM_PlayerData> pair = it.next(); Entry<Player, TFM_PlayerData> pair = it.next();
TFM_PlayerData playerdata_test = pair.getValue(); TFM_PlayerData playerdata_test = pair.getValue();
if (playerdata_test.player_name.equalsIgnoreCase(player.getName())) if (playerdata_test.player_name.equalsIgnoreCase(p.getName()))
{ {
if (Bukkit.getOnlineMode()) if (Bukkit.getOnlineMode())
{ {
@ -83,7 +83,7 @@ public class TFM_PlayerData
} }
else else
{ {
if (playerdata_test.ip_address.equalsIgnoreCase(player.getAddress().getAddress().getHostAddress())) if (playerdata_test.ip_address.equalsIgnoreCase(p.getAddress().getAddress().getHostAddress()))
{ {
playerdata = playerdata_test; playerdata = playerdata_test;
break; break;
@ -95,8 +95,8 @@ public class TFM_PlayerData
if (playerdata == null) if (playerdata == null)
{ {
playerdata = new TFM_PlayerData(player); playerdata = new TFM_PlayerData(p);
TFM_PlayerData.userinfo.put(player, playerdata); TFM_PlayerData.userinfo.put(p, playerdata);
} }
return playerdata; return playerdata;

View File

@ -83,9 +83,9 @@ public class TFM_ProtectedArea implements Serializable
oos.close(); oos.close();
fos.close(); fos.close();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
@ -104,12 +104,12 @@ public class TFM_ProtectedArea implements Serializable
fis.close(); fis.close();
} }
} }
catch (Exception e) catch (Exception ex)
{ {
File input_file = new File(TotalFreedomMod.plugin.getDataFolder(), TotalFreedomMod.PROTECTED_AREA_FILE); File input_file = new File(TotalFreedomMod.plugin.getDataFolder(), TotalFreedomMod.PROTECTED_AREA_FILE);
input_file.delete(); input_file.delete();
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }

View File

@ -130,9 +130,9 @@ public class TFM_ServerInterface
final BanList banByIP = player_list.getIPBans(); final BanList banByIP = player_list.getIPBans();
final BanList banByName = player_list.getNameBans(); final BanList banByName = player_list.getNameBans();
final Player player = event.getPlayer(); final Player p = event.getPlayer();
final String player_name = player.getName(); final String player_name = p.getName();
final String player_ip = event.getAddress().getHostAddress().trim().toLowerCase(); final String player_ip = event.getAddress().getHostAddress().trim().toLowerCase();
if (player_name.trim().length() <= 2) if (player_name.trim().length() <= 2)
@ -146,7 +146,7 @@ public class TFM_ServerInterface
return; return;
} }
// not safe to use TFM_Util.isUserSuperadmin for player logging in because player.getAddress() will return a null until after player login. // not safe to use TFM_Util.isUserSuperadmin for player logging in because p.getAddress() will return a null until after player login.
boolean is_superadmin; boolean is_superadmin;
if (server.getOnlineMode()) if (server.getOnlineMode())
{ {
@ -304,7 +304,7 @@ public class TFM_ServerInterface
if (TotalFreedomMod.lockdownEnabled) if (TotalFreedomMod.lockdownEnabled)
{ {
TFM_Util.playerMsg(player, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED); TFM_Util.playerMsg(p, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED);
} }
} }
} }

View File

@ -88,10 +88,10 @@ public class TFM_ServiceChecker
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe("Error updating mojang services from " + TotalFreedomMod.serviceCheckerURL); TFM_Log.severe("Error updating mojang services from " + TotalFreedomMod.serviceCheckerURL);
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
}; };

View File

@ -52,9 +52,9 @@ public class TFM_Superadmin
output.append("- Console Aliases: ").append(StringUtils.join(this.console_aliases, ", ")).append("\n"); output.append("- Console Aliases: ").append(StringUtils.join(this.console_aliases, ", ")).append("\n");
output.append("- Is Activated: ").append(this.is_activated); output.append("- Is Activated: ").append(this.is_activated);
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
return output.toString(); return output.toString();

View File

@ -70,9 +70,9 @@ public class TFM_SuperadminList
updateIndexLists(); updateIndexLists();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
@ -153,9 +153,9 @@ public class TFM_SuperadminList
config.save(new File(TotalFreedomMod.plugin.getDataFolder(), TotalFreedomMod.SUPERADMIN_FILE)); config.save(new File(TotalFreedomMod.plugin.getDataFolder(), TotalFreedomMod.SUPERADMIN_FILE));
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
@ -173,9 +173,9 @@ public class TFM_SuperadminList
} }
} }
public static TFM_Superadmin getAdminEntry(Player player) public static TFM_Superadmin getAdminEntry(Player p)
{ {
return getAdminEntry(player.getName().toLowerCase()); return getAdminEntry(p.getName().toLowerCase());
} }
public static TFM_Superadmin getAdminEntryByIP(String ip) public static TFM_Superadmin getAdminEntryByIP(String ip)
@ -193,9 +193,9 @@ public class TFM_SuperadminList
return null; return null;
} }
public static void updateLastLogin(Player player) public static void updateLastLogin(Player p)
{ {
TFM_Superadmin admin_entry = getAdminEntry(player); TFM_Superadmin admin_entry = getAdminEntry(p);
if (admin_entry != null) if (admin_entry != null)
{ {
admin_entry.setLastLogin(new Date()); admin_entry.setLastLogin(new Date());
@ -260,7 +260,7 @@ public class TFM_SuperadminList
} }
} }
} }
catch (Exception e) catch (Exception ex)
{ {
return false; return false;
} }
@ -309,9 +309,9 @@ public class TFM_SuperadminList
} }
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
return false; return false;
@ -324,11 +324,11 @@ public class TFM_SuperadminList
return false; return false;
} }
Player player = (Player) user; Player p = (Player) user;
if (superadminNames.contains(player.getName().toLowerCase())) if (superadminNames.contains(p.getName().toLowerCase()))
{ {
return !isUserSuperadmin(player); return !isUserSuperadmin(p);
} }
return false; return false;
@ -360,16 +360,16 @@ public class TFM_SuperadminList
saveSuperadminList(); saveSuperadminList();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
public static void addSuperadmin(Player player) public static void addSuperadmin(Player p)
{ {
String admin_name = player.getName().toLowerCase(); String admin_name = p.getName().toLowerCase();
List<String> ips = Arrays.asList(player.getAddress().getAddress().getHostAddress()); List<String> ips = Arrays.asList(p.getAddress().getAddress().getHostAddress());
addSuperadmin(admin_name, ips); addSuperadmin(admin_name, ips);
} }
@ -393,15 +393,15 @@ public class TFM_SuperadminList
saveSuperadminList(); saveSuperadminList();
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
public static void removeSuperadmin(Player player) public static void removeSuperadmin(Player p)
{ {
removeSuperadmin(player.getName()); removeSuperadmin(p.getName());
} }
public static void cleanSuperadminList(boolean verbose) public static void cleanSuperadminList(boolean verbose)
@ -433,9 +433,9 @@ public class TFM_SuperadminList
} }
saveSuperadminList(); saveSuperadminList();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }

View File

@ -56,9 +56,9 @@ public class TFM_TwitterHandler
line = in.readLine(); line = in.readLine();
in.close(); in.close();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(ExceptionUtils.getFullStackTrace(e)); TFM_Log.severe(ExceptionUtils.getFullStackTrace(ex));
} }
return line; return line;
} }

View File

@ -40,16 +40,16 @@ public class TFM_UserList
userlist.put(username, entry); userlist.put(username, entry);
} }
for (Player player: plugin.getServer().getOnlinePlayers()) for (Player p : plugin.getServer().getOnlinePlayers())
{ {
addUser(player); addUser(p);
} }
exportList(); exportList();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe("Error loading Userlist, resetting list: " + e.getMessage()); TFM_Log.severe("Error loading Userlist, resetting list: " + ex.getMessage());
purge(); purge();
} }
} }
@ -67,9 +67,9 @@ public class TFM_UserList
{ {
new_userlist.save(new File(plugin.getDataFolder(), USERLIST_FILENAME)); new_userlist.save(new File(plugin.getDataFolder(), USERLIST_FILENAME));
} }
catch (IOException e) catch (IOException ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
@ -82,9 +82,9 @@ public class TFM_UserList
return instance; return instance;
} }
public void addUser(Player player) public void addUser(Player p)
{ {
addUser(player.getName(), player.getAddress().getAddress().getHostAddress()); addUser(p.getName(), p.getAddress().getAddress().getHostAddress());
} }
public void addUser(String username, String ip_address) public void addUser(String username, String ip_address)
@ -105,9 +105,9 @@ public class TFM_UserList
} }
} }
public TFM_UserListEntry getEntry(Player player) public TFM_UserListEntry getEntry(Player p)
{ {
return getEntry(player.getName()); return getEntry(p.getName());
} }
public TFM_UserListEntry getEntry(String username) public TFM_UserListEntry getEntry(String username)
@ -119,9 +119,9 @@ public class TFM_UserList
{ {
userlist.clear(); userlist.clear();
for (Player player: plugin.getServer().getOnlinePlayers()) for (Player p : plugin.getServer().getOnlinePlayers())
{ {
addUser(player); addUser(p);
} }
exportList(); exportList();

View File

@ -40,7 +40,7 @@ public class TFM_Util
} }
} }
} }
catch (Exception e) catch (Exception ex)
{ {
} }
} }
@ -55,9 +55,9 @@ public class TFM_Util
{ {
TFM_Log.info(message, true); TFM_Log.info(message, true);
for (Player player: Bukkit.getOnlinePlayers()) for (Player p : Bukkit.getOnlinePlayers())
{ {
player.sendMessage((color == null ? "" : color) + message); p.sendMessage((color == null ? "" : color) + message);
} }
} }
@ -396,14 +396,14 @@ public class TFM_Util
STRIKE_ONE, STRIKE_TWO, STRIKE_THREE; STRIKE_ONE, STRIKE_TWO, STRIKE_THREE;
} }
public static void autoEject(Player player, String kickMessage) public static void autoEject(Player p, String kickMessage)
{ {
EjectMethod method = EjectMethod.STRIKE_ONE; EjectMethod method = EjectMethod.STRIKE_ONE;
String player_ip = null; String player_ip = null;
try try
{ {
player_ip = player.getAddress().getAddress().getHostAddress(); player_ip = p.getAddress().getAddress().getHostAddress();
Integer num_kicks = TFM_Util.eject_tracker.get(player_ip); Integer num_kicks = TFM_Util.eject_tracker.get(player_ip);
if (num_kicks == null) if (num_kicks == null)
@ -428,15 +428,15 @@ public class TFM_Util
method = EjectMethod.STRIKE_THREE; method = EjectMethod.STRIKE_THREE;
} }
} }
catch (Exception e) catch (Exception ex)
{ {
} }
TFM_Log.info("autoEject -> name: " + player.getName() + " - player_ip: " + player_ip + " - method: " + method.toString()); TFM_Log.info("autoEject -> name: " + p.getName() + " - player_ip: " + player_ip + " - method: " + method.toString());
player.setOp(false); p.setOp(false);
player.setGameMode(GameMode.SURVIVAL); p.setGameMode(GameMode.SURVIVAL);
player.getInventory().clear(); p.getInventory().clear();
switch (method) switch (method)
{ {
@ -446,11 +446,11 @@ public class TFM_Util
c.add(Calendar.MINUTE, 1); c.add(Calendar.MINUTE, 1);
Date expires = c.getTime(); Date expires = c.getTime();
TFM_Util.bcastMsg(ChatColor.RED + player.getName() + " has been banned for 1 minute."); TFM_Util.bcastMsg(ChatColor.RED + p.getName() + " has been banned for 1 minute.");
TFM_ServerInterface.banIP(player_ip, kickMessage, "AutoEject", expires); TFM_ServerInterface.banIP(player_ip, kickMessage, "AutoEject", expires);
TFM_ServerInterface.banUsername(player.getName(), kickMessage, "AutoEject", expires); TFM_ServerInterface.banUsername(p.getName(), kickMessage, "AutoEject", expires);
player.kickPlayer(kickMessage); p.kickPlayer(kickMessage);
break; break;
} }
@ -460,11 +460,11 @@ public class TFM_Util
c.add(Calendar.MINUTE, 3); c.add(Calendar.MINUTE, 3);
Date expires = c.getTime(); Date expires = c.getTime();
TFM_Util.bcastMsg(ChatColor.RED + player.getName() + " has been banned for 3 minutes."); TFM_Util.bcastMsg(ChatColor.RED + p.getName() + " has been banned for 3 minutes.");
TFM_ServerInterface.banIP(player_ip, kickMessage, "AutoEject", expires); TFM_ServerInterface.banIP(player_ip, kickMessage, "AutoEject", expires);
TFM_ServerInterface.banUsername(player.getName(), kickMessage, "AutoEject", expires); TFM_ServerInterface.banUsername(p.getName(), kickMessage, "AutoEject", expires);
player.kickPlayer(kickMessage); p.kickPlayer(kickMessage);
break; break;
} }
@ -477,11 +477,11 @@ public class TFM_Util
TFM_ServerInterface.banIP(ip_address_parts[0] + "." + ip_address_parts[1] + ".*.*", kickMessage, "AutoEject", null); TFM_ServerInterface.banIP(ip_address_parts[0] + "." + ip_address_parts[1] + ".*.*", kickMessage, "AutoEject", null);
//p.setBanned(true); //p.setBanned(true);
TFM_ServerInterface.banUsername(player.getName(), kickMessage, "AutoEject", null); TFM_ServerInterface.banUsername(p.getName(), kickMessage, "AutoEject", null);
TFM_Util.bcastMsg(ChatColor.RED + player.getName() + " has been banned permanently."); TFM_Util.bcastMsg(ChatColor.RED + p.getName() + " has been banned permanently.");
player.kickPlayer(kickMessage); p.kickPlayer(kickMessage);
break; break;
} }
@ -653,9 +653,9 @@ public class TFM_Util
public static String playerListToNames(Set<OfflinePlayer> players) public static String playerListToNames(Set<OfflinePlayer> players)
{ {
List<String> player_names = new ArrayList<String>(); List<String> player_names = new ArrayList<String>();
for (OfflinePlayer player: players) for (OfflinePlayer p : players)
{ {
player_names.add(player.getName()); player_names.add(p.getName());
} }
return StringUtils.join(player_names, ", "); return StringUtils.join(player_names, ", ");
} }
@ -676,9 +676,9 @@ public class TFM_Util
ois.close(); ois.close();
fis.close(); fis.close();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
@ -728,9 +728,9 @@ public class TFM_Util
oos.close(); oos.close();
fos.close(); fos.close();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
@ -741,7 +741,7 @@ public class TFM_Util
{ {
do_wipe_flatlands = TFM_Util.getSavedFlag("do_wipe_flatlands"); do_wipe_flatlands = TFM_Util.getSavedFlag("do_wipe_flatlands");
} }
catch (Exception e) catch (Exception ex)
{ {
} }
@ -779,7 +779,7 @@ public class TFM_Util
{ {
return new SimpleDateFormat(DATE_STORAGE_FORMAT, Locale.ENGLISH).parse(date_str); return new SimpleDateFormat(DATE_STORAGE_FORMAT, Locale.ENGLISH).parse(date_str);
} }
catch (ParseException e) catch (ParseException ex)
{ {
return new Date(0L); return new Date(0L);
} }
@ -893,11 +893,11 @@ public class TFM_Util
String name = sender.getName() + " " + getPrefix(sender, senderIsConsole); String name = sender.getName() + " " + getPrefix(sender, senderIsConsole);
TFM_Log.info("[ADMIN] " + name + ": " + message); TFM_Log.info("[ADMIN] " + name + ": " + message);
for (Player player: Bukkit.getOnlinePlayers()) for (Player p : Bukkit.getOnlinePlayers())
{ {
if (TFM_SuperadminList.isUserSuperadmin(player)) if (TFM_SuperadminList.isUserSuperadmin(p))
{ {
player.sendMessage("[" + ChatColor.AQUA + "ADMIN" + ChatColor.WHITE + "] " + ChatColor.DARK_RED + name + ": " + ChatColor.AQUA + message); p.sendMessage("[" + ChatColor.AQUA + "ADMIN" + ChatColor.WHITE + "] " + ChatColor.DARK_RED + name + ": " + ChatColor.AQUA + message);
} }
} }
} }
@ -952,10 +952,10 @@ public class TFM_Util
field.setAccessible(true); field.setAccessible(true);
return (T) field.get(from); return (T) field.get(from);
} }
catch (NoSuchFieldException e) catch (NoSuchFieldException ex)
{ {
} }
catch (IllegalAccessException e) catch (IllegalAccessException ex)
{ {
} }
} }

View File

@ -30,56 +30,56 @@ public class TFM_WorldEditBridge
} }
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
return this.worldEditPlugin; return this.worldEditPlugin;
} }
public BukkitPlayer getBukkitPlayer(Player player) public BukkitPlayer getBukkitPlayer(Player p)
{ {
try try
{ {
WorldEditPlugin wep = this.getWorldEditPlugin(); WorldEditPlugin wep = this.getWorldEditPlugin();
if (wep != null) if (wep != null)
{ {
return wep.wrapPlayer(player); return wep.wrapPlayer(p);
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
return null; return null;
} }
public LocalSession getPlayerSession(Player player) public LocalSession getPlayerSession(Player p)
{ {
try try
{ {
WorldEditPlugin wep = this.getWorldEditPlugin(); WorldEditPlugin wep = this.getWorldEditPlugin();
if (wep != null) if (wep != null)
{ {
return wep.getSession(player); return wep.getSession(p);
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
return null; return null;
} }
public void undo(Player player, int count) public void undo(Player p, int count)
{ {
try try
{ {
LocalSession session = getPlayerSession(player); LocalSession session = getPlayerSession(p);
if (session != null) if (session != null)
{ {
BukkitPlayer bukkitPlayer = this.getBukkitPlayer(player); BukkitPlayer bukkitPlayer = this.getBukkitPlayer(p);
if (bukkitPlayer != null) if (bukkitPlayer != null)
{ {
for (int i = 0; i < count; i++) for (int i = 0; i < count; i++)
@ -89,25 +89,25 @@ public class TFM_WorldEditBridge
} }
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
public void setLimit(Player player, int limit) public void setLimit(Player p, int limit)
{ {
try try
{ {
LocalSession session = getPlayerSession(player); LocalSession session = getPlayerSession(p);
if (session != null) if (session != null)
{ {
session.setBlockChangeLimit(limit); session.setBlockChangeLimit(limit);
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }

View File

@ -139,9 +139,9 @@ public class TotalFreedomMod extends JavaPlugin
Metrics metrics = new Metrics(plugin); Metrics metrics = new Metrics(plugin);
metrics.start(); metrics.start();
} }
catch (IOException e) catch (IOException ex)
{ {
TFM_Log.warning("Failed to submit metrics data: " + e.getMessage()); TFM_Log.warning("Failed to submit metrics data: " + ex.getMessage());
} }
TFM_Log.info("Plugin Enabled - Version: " + TotalFreedomMod.pluginVersion + "." + TotalFreedomMod.buildNumber + " by Madgeek1450 and DarthSalamon"); TFM_Log.info("Plugin Enabled - Version: " + TotalFreedomMod.pluginVersion + "." + TotalFreedomMod.buildNumber + " by Madgeek1450 and DarthSalamon");
@ -198,9 +198,9 @@ public class TotalFreedomMod extends JavaPlugin
dispatcher = (TFM_Command) classLoader.loadClass(String.format("%s.%s%s", COMMAND_PATH, COMMAND_PREFIX, cmd.getName().toLowerCase())).newInstance(); dispatcher = (TFM_Command) classLoader.loadClass(String.format("%s.%s%s", COMMAND_PATH, COMMAND_PREFIX, cmd.getName().toLowerCase())).newInstance();
dispatcher.setup(this, sender, dispatcher.getClass()); dispatcher.setup(this, sender, dispatcher.getClass());
} }
catch (Throwable e) catch (Throwable ex)
{ {
TFM_Log.severe("Command not loaded: " + cmd.getName() + "\n" + ExceptionUtils.getStackTrace(e)); TFM_Log.severe("Command not loaded: " + cmd.getName() + "\n" + ExceptionUtils.getStackTrace(ex));
sender.sendMessage(ChatColor.RED + "Command Error: Command not loaded: " + cmd.getName()); sender.sendMessage(ChatColor.RED + "Command Error: Command not loaded: " + cmd.getName());
return true; return true;
} }
@ -216,15 +216,15 @@ public class TotalFreedomMod extends JavaPlugin
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
} }
} }
catch (Throwable e) catch (Throwable ex)
{ {
TFM_Log.severe("Command Error: " + commandLabel + "\n" + ExceptionUtils.getStackTrace(e)); TFM_Log.severe("Command Error: " + commandLabel + "\n" + ExceptionUtils.getStackTrace(ex));
} }
} }
catch (Throwable e) catch (Throwable ex)
{ {
TFM_Log.severe("Command Error: " + commandLabel + "\n" + ExceptionUtils.getStackTrace(e)); TFM_Log.severe("Command Error: " + commandLabel + "\n" + ExceptionUtils.getStackTrace(ex));
sender.sendMessage(ChatColor.RED + "Unknown Command Error."); sender.sendMessage(ChatColor.RED + "Unknown Command Error.");
} }
@ -324,9 +324,9 @@ public class TotalFreedomMod extends JavaPlugin
logsRegisterURL = config.getString("logs_register_url", logsRegisterURL); logsRegisterURL = config.getString("logs_register_url", logsRegisterURL);
serviceCheckerURL = config.getString("service_checker_url", serviceCheckerURL); serviceCheckerURL = config.getString("service_checker_url", serviceCheckerURL);
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe("Error loading main config: " + e.getMessage()); TFM_Log.severe("Error loading main config: " + ex.getMessage());
} }
} }
@ -337,9 +337,9 @@ public class TotalFreedomMod extends JavaPlugin
TFM_SuperadminList.backupSavedList(); TFM_SuperadminList.backupSavedList();
TFM_SuperadminList.loadSuperadminList(); TFM_SuperadminList.loadSuperadminList();
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe("Error loading superadmin list: " + e.getMessage()); TFM_Log.severe("Error loading superadmin list: " + ex.getMessage());
} }
} }
// //
@ -371,9 +371,9 @@ public class TotalFreedomMod extends JavaPlugin
} }
} }
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe("Error loading permban list: " + e.getMessage()); TFM_Log.severe("Error loading permban list: " + ex.getMessage());
} }
} }
@ -403,9 +403,9 @@ public class TotalFreedomMod extends JavaPlugin
TotalFreedomMod.buildNumber = props.getProperty("program.BUILDNUM"); TotalFreedomMod.buildNumber = props.getProperty("program.BUILDNUM");
TotalFreedomMod.buildDate = props.getProperty("program.BUILDDATE"); TotalFreedomMod.buildDate = props.getProperty("program.BUILDDATE");
} }
catch (Exception e) catch (Exception ex)
{ {
TFM_Log.severe(e); TFM_Log.severe(ex);
} }
} }
} }