mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-30 10:05:59 +00:00
Take two: Cleanup
This commit is contained in:
parent
8ce0defb52
commit
339518f4f4
@ -1,5 +1,5 @@
|
||||
#Tue, 13 Aug 2013 16:50:36 -0400
|
||||
#Wed, 14 Aug 2013 15:57:37 +0200
|
||||
|
||||
program.VERSION=2.22
|
||||
program.BUILDNUM=458
|
||||
program.BUILDDATE=08/13/2013 04\:50 PM
|
||||
program.BUILDNUM=459
|
||||
program.BUILDDATE=08/14/2013 03\:57 PM
|
||||
|
@ -1,3 +1,3 @@
|
||||
#Build Number for ANT. Do not edit!
|
||||
#Tue Aug 13 16:50:36 EDT 2013
|
||||
build.number=459
|
||||
#Wed Aug 14 15:57:37 CEST 2013
|
||||
build.number=460
|
||||
|
@ -29,11 +29,11 @@ public class Command_adminmode extends TFM_Command
|
||||
{
|
||||
TotalFreedomMod.adminOnlyMode = true;
|
||||
TFM_Util.adminAction(sender.getName(), "Closing the server to non-superadmins.", true);
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
p.kickPlayer("Server is now closed to non-superadmins.");
|
||||
player.kickPlayer("Server is now closed to non-superadmins.");
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
@ -23,9 +23,9 @@ public class Command_blockcmd extends TFM_Command
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Unblocking commands for all players", true);
|
||||
int counter = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
if (playerdata.allCommandsBlocked())
|
||||
{
|
||||
counter += 1;
|
||||
@ -36,10 +36,10 @@ public class Command_blockcmd extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -47,17 +47,17 @@ public class Command_blockcmd extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
if (TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
playerMsg(p.getName() + " is a Superadmin, and cannot have their commands blocked.");
|
||||
playerMsg(player.getName() + " is a Superadmin, and cannot have their commands blocked.");
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
playerdata.setCommandsBlocked(!playerdata.allCommandsBlocked());
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), (playerdata.allCommandsBlocked() ? "B" : "Unb") + "locking all commands for " + p.getName(), true);
|
||||
TFM_Util.adminAction(sender.getName(), (playerdata.allCommandsBlocked() ? "B" : "Unb") + "locking all commands for " + player.getName(), true);
|
||||
playerMsg((playerdata.allCommandsBlocked() ? "B" : "Unb") + "locked all commands.");
|
||||
|
||||
return true;
|
||||
|
@ -21,10 +21,10 @@ public class Command_cage extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -32,7 +32,7 @@ public class Command_cage extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
Material cage_material_outer = Material.GLASS;
|
||||
Material cage_material_inner = Material.AIR;
|
||||
@ -40,7 +40,7 @@ public class Command_cage extends TFM_Command
|
||||
{
|
||||
if (TFM_Util.isStopCommand(args[1]))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Uncaging " + p.getName() + ".", true);
|
||||
TFM_Util.adminAction(sender.getName(), "Uncaging " + player.getName() + ".", true);
|
||||
|
||||
playerdata.setCaged(false);
|
||||
playerdata.regenerateHistory();
|
||||
@ -70,7 +70,7 @@ public class Command_cage extends TFM_Command
|
||||
}
|
||||
}
|
||||
|
||||
Location target_pos = p.getLocation().add(0, 1, 0);
|
||||
Location target_pos = player.getLocation().add(0, 1, 0);
|
||||
playerdata.setCaged(true, target_pos, cage_material_outer, cage_material_inner);
|
||||
playerdata.regenerateHistory();
|
||||
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, 1, playerdata.getCageMaterial(TFM_PlayerData.CageLayer.INNER));
|
||||
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Caging " + p.getName() + ".", true);
|
||||
TFM_Util.adminAction(sender.getName(), "Caging " + player.getName() + ".", true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -28,14 +28,14 @@ public class Command_cake extends TFM_Command
|
||||
output.append(ChatColor.COLOR_CHAR).append(color_code).append(word).append(" ");
|
||||
}
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
ItemStack heldItem = new ItemStack(Material.CAKE, 1);
|
||||
p.getInventory().setItem(p.getInventory().firstEmpty(), heldItem);
|
||||
p.awardAchievement(Achievement.MINE_WOOD);
|
||||
p.awardAchievement(Achievement.BUILD_WORKBENCH);
|
||||
p.awardAchievement(Achievement.BUILD_HOE);
|
||||
p.awardAchievement(Achievement.BAKE_CAKE);
|
||||
player.getInventory().setItem(player.getInventory().firstEmpty(), heldItem);
|
||||
player.awardAchievement(Achievement.MINE_WOOD);
|
||||
player.awardAchievement(Achievement.BUILD_WORKBENCH);
|
||||
player.awardAchievement(Achievement.BUILD_HOE);
|
||||
player.awardAchievement(Achievement.BAKE_CAKE);
|
||||
}
|
||||
|
||||
TFM_Util.bcastMsg(output.toString());
|
||||
|
@ -21,11 +21,11 @@ public class Command_cmdlist extends TFM_Command
|
||||
{
|
||||
List<String> commands = new ArrayList<String>();
|
||||
|
||||
for (Plugin p : server.getPluginManager().getPlugins())
|
||||
for (Plugin target_plugin : server.getPluginManager().getPlugins())
|
||||
{
|
||||
try
|
||||
{
|
||||
PluginDescriptionFile desc = p.getDescription();
|
||||
PluginDescriptionFile desc = target_plugin.getDescription();
|
||||
Map<String, Map<String, Object>> map = (Map<String, Map<String, Object>>) desc.getCommands();
|
||||
|
||||
if (map != null)
|
||||
|
@ -24,10 +24,10 @@ public class Command_creative extends TFM_Command
|
||||
}
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
if (args.length == 0)
|
||||
{
|
||||
p = sender_p;
|
||||
player = sender_p;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -39,9 +39,9 @@ public class Command_creative extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
for (Player target_player : server.getOnlinePlayers())
|
||||
{
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
target_player.setGameMode(GameMode.CREATIVE);
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Changing everyone's gamemode to creative", false);
|
||||
@ -56,7 +56,7 @@ public class Command_creative extends TFM_Command
|
||||
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -66,9 +66,9 @@ public class Command_creative extends TFM_Command
|
||||
|
||||
}
|
||||
|
||||
playerMsg("Setting " + p.getName() + " to game mode 'Creative'.");
|
||||
playerMsg(p, sender.getName() + " set your game mode to 'Creative'.");
|
||||
p.setGameMode(GameMode.CREATIVE);
|
||||
playerMsg("Setting " + player.getName() + " to game mode 'Creative'.");
|
||||
playerMsg(player, sender.getName() + " set your game mode to 'Creative'.");
|
||||
player.setGameMode(GameMode.CREATIVE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ public class Command_deafen extends TFM_Command
|
||||
@Override
|
||||
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
|
||||
{
|
||||
for (final Player p : server.getOnlinePlayers())
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
for (double percent = 0.0; percent <= 1.0; percent += (1.0 / STEPS))
|
||||
{
|
||||
@ -29,7 +29,7 @@ public class Command_deafen extends TFM_Command
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
p.playSound(randomOffset(p.getLocation(), 5.0), Sound.values()[random.nextInt(Sound.values().length)], 100.0f, pitch);
|
||||
player.playSound(randomOffset(player.getLocation(), 5.0), Sound.values()[random.nextInt(Sound.values().length)], 100.0f, pitch);
|
||||
}
|
||||
}.runTaskLater(plugin, Math.round(20.0 * percent * 2.0));
|
||||
}
|
||||
|
@ -18,25 +18,25 @@ public class Command_deop extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
OfflinePlayer p = null;
|
||||
OfflinePlayer player = null;
|
||||
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
if (args[0].equalsIgnoreCase(onlinePlayer.getName()))
|
||||
{
|
||||
p = onlinePlayer;
|
||||
player = onlinePlayer;
|
||||
}
|
||||
}
|
||||
|
||||
// if the player is not online
|
||||
if (p == null)
|
||||
if (player == null)
|
||||
{
|
||||
p = server.getOfflinePlayer(args[0]);
|
||||
player = server.getOfflinePlayer(args[0]);
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "De-opping " + p.getName(), false);
|
||||
TFM_Util.adminAction(sender.getName(), "De-opping " + player.getName(), false);
|
||||
|
||||
p.setOp(false);
|
||||
player.setOp(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -15,10 +15,10 @@ public class Command_deopall extends TFM_Command
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "De-opping all players on the server", true);
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
p.setOp(false);
|
||||
p.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
|
||||
player.setOp(false);
|
||||
player.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -22,10 +22,10 @@ public class Command_doom extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
final Player p;
|
||||
final Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -33,42 +33,42 @@ public class Command_doom extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Casting oblivion over " + p.getName(), true);
|
||||
TFM_Util.bcastMsg(p.getName() + " will be completely obliviated!", ChatColor.RED);
|
||||
TFM_Util.adminAction(sender.getName(), "Casting oblivion over " + player.getName(), true);
|
||||
TFM_Util.bcastMsg(player.getName() + " will be completely obliviated!", ChatColor.RED);
|
||||
|
||||
final String IP = p.getAddress().getAddress().getHostAddress().trim();
|
||||
final String IP = player.getAddress().getAddress().getHostAddress().trim();
|
||||
|
||||
// remove from superadmin
|
||||
if (TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Removing " + p.getName() + " from the superadmin list.", true);
|
||||
TFM_SuperadminList.removeSuperadmin(p);
|
||||
TFM_Util.adminAction(sender.getName(), "Removing " + player.getName() + " from the superadmin list.", true);
|
||||
TFM_SuperadminList.removeSuperadmin(player);
|
||||
}
|
||||
|
||||
// remove from whitelist
|
||||
p.setWhitelisted(false);
|
||||
player.setWhitelisted(false);
|
||||
|
||||
// deop
|
||||
p.setOp(false);
|
||||
player.setOp(false);
|
||||
|
||||
// ban IP
|
||||
TFM_ServerInterface.banIP(IP, null, null, null);
|
||||
|
||||
// ban name
|
||||
TFM_ServerInterface.banUsername(p.getName(), null, null, null);
|
||||
TFM_ServerInterface.banUsername(player.getName(), null, null, null);
|
||||
|
||||
// set gamemode to survival
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
// clear inventory
|
||||
p.closeInventory();
|
||||
p.getInventory().clear();
|
||||
player.closeInventory();
|
||||
player.getInventory().clear();
|
||||
|
||||
// ignite player
|
||||
p.setFireTicks(10000);
|
||||
player.setFireTicks(10000);
|
||||
|
||||
// generate explosion
|
||||
p.getWorld().createExplosion(p.getLocation(), 4F);
|
||||
player.getWorld().createExplosion(player.getLocation(), 4F);
|
||||
|
||||
new BukkitRunnable()
|
||||
{
|
||||
@ -76,10 +76,10 @@ public class Command_doom extends TFM_Command
|
||||
public void run()
|
||||
{
|
||||
// strike lightning
|
||||
p.getWorld().strikeLightning(p.getLocation());
|
||||
player.getWorld().strikeLightning(player.getLocation());
|
||||
|
||||
// kill (if not done already)
|
||||
p.setHealth(0.0);
|
||||
player.setHealth(0.0);
|
||||
}
|
||||
}.runTaskLater(plugin, 20L * 2L);
|
||||
|
||||
@ -89,13 +89,13 @@ public class Command_doom extends TFM_Command
|
||||
public void run()
|
||||
{
|
||||
// message
|
||||
TFM_Util.adminAction(sender.getName(), "Banning " + p.getName() + ", IP: " + IP, true);
|
||||
TFM_Util.adminAction(sender.getName(), "Banning " + player.getName() + ", IP: " + IP, true);
|
||||
|
||||
// generate explosion
|
||||
p.getWorld().createExplosion(p.getLocation(), 4F);
|
||||
player.getWorld().createExplosion(player.getLocation(), 4F);
|
||||
|
||||
// kick player
|
||||
p.kickPlayer(ChatColor.RED + "FUCKOFF, and get your shit together!");
|
||||
player.kickPlayer(ChatColor.RED + "FUCKOFF, and get your shit together!");
|
||||
}
|
||||
}.runTaskLater(plugin, 20L * 3L);
|
||||
|
||||
|
@ -38,11 +38,11 @@ public class Command_expel extends TFM_Command
|
||||
}
|
||||
|
||||
Location sender_pos = sender_p.getLocation();
|
||||
for (Player p : sender_pos.getWorld().getPlayers())
|
||||
for (Player player : sender_pos.getWorld().getPlayers())
|
||||
{
|
||||
if (!p.equals(sender_p))
|
||||
if (!player.equals(sender_p))
|
||||
{
|
||||
Location target_pos = p.getLocation();
|
||||
Location target_pos = player.getLocation();
|
||||
|
||||
boolean in_range = false;
|
||||
try
|
||||
@ -55,8 +55,8 @@ public class Command_expel extends TFM_Command
|
||||
|
||||
if (in_range)
|
||||
{
|
||||
p.setVelocity(target_pos.clone().subtract(sender_pos).toVector().normalize().multiply(strength));
|
||||
playerMsg("Pushing " + p.getName() + ".");
|
||||
player.setVelocity(target_pos.clone().subtract(sender_pos).toVector().normalize().multiply(strength));
|
||||
playerMsg("Pushing " + player.getName() + ".");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,10 +19,10 @@ public class Command_findip extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
final Player p;
|
||||
final Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -30,7 +30,7 @@ public class Command_findip extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
playerMsg("Player IPs: " + StringUtils.join(TFM_UserList.getInstance(TotalFreedomMod.plugin).getEntry(p).getIpAddresses(), ", "));
|
||||
playerMsg("Player IPs: " + StringUtils.join(TFM_UserList.getInstance(TotalFreedomMod.plugin).getEntry(player).getIpAddresses(), ", "));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -62,9 +62,9 @@ public class Command_fr extends TFM_Command
|
||||
TotalFreedomMod.freezePurgeTask.cancel();
|
||||
}
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
playerdata.setFrozen(false);
|
||||
}
|
||||
|
||||
@ -72,10 +72,10 @@ public class Command_fr extends TFM_Command
|
||||
}
|
||||
else
|
||||
{
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -83,11 +83,11 @@ public class Command_fr extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
playerdata.setFrozen(!playerdata.isFrozen());
|
||||
|
||||
playerMsg(p.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
|
||||
playerMsg(p, "You have been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".", ChatColor.AQUA);
|
||||
playerMsg(player.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
|
||||
playerMsg(player, "You have been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".", ChatColor.AQUA);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -30,77 +30,77 @@ public class Command_gadmin extends TFM_Command
|
||||
playerMsg("[ Real Name ] : [ Display Name ] - Hash:");
|
||||
}
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
String hash = p.getUniqueId().toString().substring(0, 4);
|
||||
String hash = player.getUniqueId().toString().substring(0, 4);
|
||||
if (mode.equals("list"))
|
||||
{
|
||||
sender.sendMessage(ChatColor.GRAY + String.format("[ %s ] : [ %s ] - %s",
|
||||
p.getName(),
|
||||
ChatColor.stripColor(p.getDisplayName()),
|
||||
player.getName(),
|
||||
ChatColor.stripColor(player.getDisplayName()),
|
||||
hash));
|
||||
}
|
||||
else if (hash.equalsIgnoreCase(args[1]))
|
||||
{
|
||||
if (mode.equals("kick"))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Kicking: %s.", p.getName()), false);
|
||||
p.kickPlayer("Kicked by Administrator");
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Kicking: %s.", player.getName()), false);
|
||||
player.kickPlayer("Kicked by Administrator");
|
||||
}
|
||||
else if (mode.equals("nameban"))
|
||||
{
|
||||
TFM_ServerInterface.banUsername(p.getName(), null, null, null);
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Banning Name: %s.", p.getName()), true);
|
||||
p.kickPlayer("Username banned by Administrator.");
|
||||
TFM_ServerInterface.banUsername(player.getName(), null, null, null);
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Banning Name: %s.", player.getName()), true);
|
||||
player.kickPlayer("Username banned by Administrator.");
|
||||
}
|
||||
else if (mode.equals("ipban"))
|
||||
{
|
||||
String user_ip = p.getAddress().getAddress().getHostAddress();
|
||||
String user_ip = player.getAddress().getAddress().getHostAddress();
|
||||
String[] ip_parts = user_ip.split("\\.");
|
||||
if (ip_parts.length == 4)
|
||||
{
|
||||
user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]);
|
||||
}
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Banning IP: %s.", p.getName(), user_ip), true);
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Banning IP: %s.", player.getName(), user_ip), true);
|
||||
TFM_ServerInterface.banIP(user_ip, null, null, null);
|
||||
p.kickPlayer("IP address banned by Administrator.");
|
||||
player.kickPlayer("IP address banned by Administrator.");
|
||||
}
|
||||
else if (mode.equals("ban"))
|
||||
{
|
||||
String user_ip = p.getAddress().getAddress().getHostAddress();
|
||||
String user_ip = player.getAddress().getAddress().getHostAddress();
|
||||
String[] ip_parts = user_ip.split("\\.");
|
||||
if (ip_parts.length == 4)
|
||||
{
|
||||
user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]);
|
||||
}
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Banning Name: %s, IP: %s.", p.getName(), user_ip), true);
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Banning Name: %s, IP: %s.", player.getName(), user_ip), true);
|
||||
TFM_ServerInterface.banIP(user_ip, null, null, null);
|
||||
TFM_ServerInterface.banUsername(p.getName(), null, null, null);
|
||||
p.kickPlayer("IP and username banned by Administrator.");
|
||||
TFM_ServerInterface.banUsername(player.getName(), null, null, null);
|
||||
player.kickPlayer("IP and username banned by Administrator.");
|
||||
}
|
||||
else if (mode.equals("op"))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Opping %s.", p.getName()), false);
|
||||
p.setOp(false);
|
||||
p.sendMessage(TotalFreedomMod.YOU_ARE_OP);
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Opping %s.", player.getName()), false);
|
||||
player.setOp(false);
|
||||
player.sendMessage(TotalFreedomMod.YOU_ARE_OP);
|
||||
}
|
||||
else if (mode.equals("deop"))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Deopping %s.", p.getName()), false);
|
||||
p.setOp(false);
|
||||
p.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
|
||||
TFM_Util.adminAction(sender.getName(), String.format("Deopping %s.", player.getName()), false);
|
||||
player.setOp(false);
|
||||
player.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
|
||||
}
|
||||
else if (mode.equals("ci"))
|
||||
{
|
||||
p.getInventory().clear();
|
||||
player.getInventory().clear();
|
||||
}
|
||||
else if (mode.equals("fr"))
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
playerdata.setFrozen(!playerdata.isFrozen());
|
||||
|
||||
playerMsg(p.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
|
||||
p.sendMessage(ChatColor.AQUA + "You have been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
|
||||
playerMsg(player.getName() + " has been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
|
||||
player.sendMessage(ChatColor.AQUA + "You have been " + (playerdata.isFrozen() ? "frozen" : "unfrozen") + ".");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -17,10 +17,10 @@ public class Command_gcmd extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -46,8 +46,8 @@ public class Command_gcmd extends TFM_Command
|
||||
|
||||
try
|
||||
{
|
||||
playerMsg("Sending command as " + p.getName() + ": " + outcommand);
|
||||
if (server.dispatchCommand(p, outcommand))
|
||||
playerMsg("Sending command as " + player.getName() + ": " + outcommand);
|
||||
if (server.dispatchCommand(player, outcommand))
|
||||
{
|
||||
playerMsg("Command sent.");
|
||||
}
|
||||
|
@ -51,10 +51,10 @@ public class Command_glist extends TFM_Command
|
||||
|
||||
try
|
||||
{
|
||||
Player p = getPlayer(args[1]);
|
||||
Player player = getPlayer(args[1]);
|
||||
|
||||
username = p.getName();
|
||||
ip_addresses.add(p.getAddress().getAddress().getHostAddress());
|
||||
username = player.getName();
|
||||
ip_addresses.add(player.getAddress().getAddress().getHostAddress());
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -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);
|
||||
|
||||
Player p = server.getPlayerExact(username);
|
||||
if (p != null)
|
||||
Player player = server.getPlayerExact(username);
|
||||
if (player != null)
|
||||
{
|
||||
TFM_ServerInterface.banUsername(p.getName(), null, null, null);
|
||||
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");
|
||||
TFM_ServerInterface.banUsername(player.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");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -25,10 +25,10 @@ public class Command_gtfo extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -42,25 +42,25 @@ public class Command_gtfo extends TFM_Command
|
||||
ban_reason = StringUtils.join(ArrayUtils.subarray(args, 1, args.length), " ");
|
||||
}
|
||||
|
||||
TFM_Util.bcastMsg(p.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED);
|
||||
TFM_Util.bcastMsg(player.getName() + " has been a VERY naughty, naughty boy.", ChatColor.RED);
|
||||
|
||||
// Undo WorldEdits:
|
||||
TFM_WorldEditBridge.getInstance().undo(p, 15);
|
||||
TFM_WorldEditBridge.getInstance().undo(player, 15);
|
||||
|
||||
// rollback
|
||||
TFM_RollbackManager.rollback(p.getName());
|
||||
TFM_RollbackManager.rollback(player.getName());
|
||||
|
||||
// deop
|
||||
p.setOp(false);
|
||||
player.setOp(false);
|
||||
|
||||
// set gamemode to survival:
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
// clear inventory:
|
||||
p.getInventory().clear();
|
||||
player.getInventory().clear();
|
||||
|
||||
// strike with lightning effect:
|
||||
final Location target_pos = p.getLocation();
|
||||
final Location target_pos = player.getLocation();
|
||||
for (int x = -1; x <= 1; x++)
|
||||
{
|
||||
for (int z = -1; z <= 1; z++)
|
||||
@ -71,20 +71,20 @@ public class Command_gtfo extends TFM_Command
|
||||
}
|
||||
|
||||
// ban IP address:
|
||||
String user_ip = p.getAddress().getAddress().getHostAddress();
|
||||
String user_ip = player.getAddress().getAddress().getHostAddress();
|
||||
String[] ip_parts = user_ip.split("\\.");
|
||||
if (ip_parts.length == 4)
|
||||
{
|
||||
user_ip = String.format("%s.%s.*.*", ip_parts[0], ip_parts[1]);
|
||||
}
|
||||
TFM_Util.bcastMsg(String.format("Banning: %s, IP: %s.", p.getName(), user_ip), ChatColor.RED);
|
||||
TFM_Util.bcastMsg(String.format("Banning: %s, IP: %s.", player.getName(), user_ip), ChatColor.RED);
|
||||
TFM_ServerInterface.banIP(user_ip, ban_reason, null, null);
|
||||
|
||||
// ban username:
|
||||
TFM_ServerInterface.banUsername(p.getName(), ban_reason, null, null);
|
||||
TFM_ServerInterface.banUsername(player.getName(), ban_reason, null, null);
|
||||
|
||||
// kick Player:
|
||||
p.kickPlayer(ChatColor.RED + "GTFO" + (ban_reason != null ? ("\nReason: " + ChatColor.YELLOW + ban_reason) : ""));
|
||||
player.kickPlayer(ChatColor.RED + "GTFO" + (ban_reason != null ? ("\nReason: " + ChatColor.YELLOW + ban_reason) : ""));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -23,11 +23,11 @@ public class Command_halt extends TFM_Command
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Halting all non-superadmins.", true);
|
||||
int counter = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
TFM_PlayerData.getPlayerData(p).setHalted(true);
|
||||
TFM_PlayerData.getPlayerData(player).setHalted(true);
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
@ -39,10 +39,10 @@ public class Command_halt extends TFM_Command
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Unhalting all players.", true);
|
||||
int counter = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
if (TFM_PlayerData.getPlayerData(p).isHalted())
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
if (TFM_PlayerData.getPlayerData(player).isHalted())
|
||||
{
|
||||
playerdata.setHalted(false);
|
||||
counter++;
|
||||
@ -76,10 +76,10 @@ public class Command_halt extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -88,16 +88,16 @@ public class Command_halt extends TFM_Command
|
||||
}
|
||||
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
if (!playerdata.isHalted())
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Halting " + p.getName(), true);
|
||||
TFM_Util.adminAction(sender.getName(), "Halting " + player.getName(), true);
|
||||
playerdata.setHalted(true);
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Unhalting " + p.getName(), true);
|
||||
TFM_Util.adminAction(sender.getName(), "Unhalting " + player.getName(), true);
|
||||
playerdata.setHalted(false);
|
||||
return true;
|
||||
}
|
||||
|
@ -33,14 +33,14 @@ public class Command_invis extends TFM_Command
|
||||
List<String> players = new ArrayList<String>();
|
||||
int smites = 0;
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (p.hasPotionEffect(PotionEffectType.INVISIBILITY))
|
||||
if (player.hasPotionEffect(PotionEffectType.INVISIBILITY))
|
||||
{
|
||||
players.add(p.getName());
|
||||
if (smite && !TFM_SuperadminList.isUserSuperadmin(p))
|
||||
players.add(player.getName());
|
||||
if (smite && !TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
Command_smite.smite(p);
|
||||
Command_smite.smite(player);
|
||||
smites++;
|
||||
}
|
||||
}
|
||||
|
@ -16,11 +16,11 @@ public class Command_kicknoob extends TFM_Command
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Disconnecting all non-superadmins.", true);
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
p.kickPlayer(ChatColor.RED + "Disconnected by admin.");
|
||||
player.kickPlayer(ChatColor.RED + "Disconnected by admin.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,10 +18,10 @@ public class Command_lastcmd extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -29,7 +29,7 @@ public class Command_lastcmd extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
if (playerdata != null)
|
||||
{
|
||||
@ -38,7 +38,7 @@ public class Command_lastcmd extends TFM_Command
|
||||
{
|
||||
last_command = "(none)";
|
||||
}
|
||||
playerMsg(p.getName() + " - Last Command: " + last_command, ChatColor.GRAY);
|
||||
playerMsg(player.getName() + " - Last Command: " + last_command, ChatColor.GRAY);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -25,9 +25,9 @@ public class Command_list extends TFM_Command
|
||||
if (TFM_Util.isFromHostConsole(sender.getName()))
|
||||
{
|
||||
List<String> player_names = new ArrayList<String>();
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
player_names.add(p.getName());
|
||||
player_names.add(player.getName());
|
||||
}
|
||||
playerMsg("There are " + player_names.size() + "/" + server.getMaxPlayers() + " players online:\n" + StringUtils.join(player_names, ", "), ChatColor.WHITE);
|
||||
return true;
|
||||
@ -50,9 +50,9 @@ public class Command_list extends TFM_Command
|
||||
onlineStats.append(ChatColor.BLUE).append(" players online.");
|
||||
|
||||
List<String> player_names = new ArrayList<String>();
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
boolean userSuperadmin = TFM_SuperadminList.isUserSuperadmin(p);
|
||||
boolean userSuperadmin = TFM_SuperadminList.isUserSuperadmin(player);
|
||||
|
||||
if (listFilter == ListFilter.SHOW_ADMINS && !userSuperadmin)
|
||||
{
|
||||
@ -63,7 +63,7 @@ public class Command_list extends TFM_Command
|
||||
|
||||
if (userSuperadmin)
|
||||
{
|
||||
if (TFM_SuperadminList.isSeniorAdmin(p))
|
||||
if (TFM_SuperadminList.isSeniorAdmin(player))
|
||||
{
|
||||
prefix = (ChatColor.LIGHT_PURPLE + "[SrA]");
|
||||
}
|
||||
@ -72,25 +72,25 @@ public class Command_list extends TFM_Command
|
||||
prefix = (ChatColor.GOLD + "[SA]");
|
||||
}
|
||||
|
||||
if (TFM_Util.DEVELOPERS.contains(p.getName()))
|
||||
if (TFM_Util.DEVELOPERS.contains(player.getName()))
|
||||
{
|
||||
prefix = (ChatColor.DARK_PURPLE + "[Dev]");
|
||||
}
|
||||
|
||||
if (p.getName().equals("markbyron"))
|
||||
if (player.getName().equals("markbyron"))
|
||||
{
|
||||
prefix = (ChatColor.BLUE + "[Owner]");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (p.isOp())
|
||||
if (player.isOp())
|
||||
{
|
||||
prefix = (ChatColor.RED + "[OP]");
|
||||
}
|
||||
}
|
||||
|
||||
player_names.add(prefix + p.getName() + ChatColor.WHITE);
|
||||
player_names.add(prefix + player.getName() + ChatColor.WHITE);
|
||||
}
|
||||
|
||||
onlineUsers.append("Connected ").append(listFilter == ListFilter.SHOW_ADMINS ? "admins" : "players").append(": ").append(StringUtils.join(player_names, ", "));
|
||||
|
@ -21,18 +21,18 @@ public class Command_lockup extends TFM_Command
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Locking up all players", true);
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
startLockup(p);
|
||||
startLockup(player);
|
||||
}
|
||||
playerMsg("Locked up all players.");
|
||||
}
|
||||
else if (args[0].equalsIgnoreCase("purge"))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Unlocking all players", true);
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
cancelLockup(p);
|
||||
cancelLockup(player);
|
||||
}
|
||||
|
||||
playerMsg("Unlocked all players.");
|
||||
@ -46,10 +46,10 @@ public class Command_lockup extends TFM_Command
|
||||
{
|
||||
if (args[1].equalsIgnoreCase("on"))
|
||||
{
|
||||
final Player p;
|
||||
final Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -57,16 +57,16 @@ public class Command_lockup extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Locking up " + p.getName(), true);
|
||||
startLockup(p);
|
||||
playerMsg("Locked up " + p.getName() + ".");
|
||||
TFM_Util.adminAction(sender.getName(), "Locking up " + player.getName(), true);
|
||||
startLockup(player);
|
||||
playerMsg("Locked up " + player.getName() + ".");
|
||||
}
|
||||
else if (TFM_Util.isStopCommand(args[1]))
|
||||
{
|
||||
final Player p;
|
||||
final Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -74,9 +74,9 @@ public class Command_lockup extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Unlocking " + p.getName(), true);
|
||||
cancelLockup(p);
|
||||
playerMsg("Unlocked " + p.getName() + ".");
|
||||
TFM_Util.adminAction(sender.getName(), "Unlocking " + player.getName(), true);
|
||||
cancelLockup(player);
|
||||
playerMsg("Unlocked " + player.getName() + ".");
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -101,14 +101,14 @@ public class Command_lockup extends TFM_Command
|
||||
}
|
||||
}
|
||||
|
||||
private void cancelLockup(final Player p)
|
||||
private void cancelLockup(final Player player)
|
||||
{
|
||||
cancelLockup(TFM_PlayerData.getPlayerData(p));
|
||||
cancelLockup(TFM_PlayerData.getPlayerData(player));
|
||||
}
|
||||
|
||||
private void startLockup(final Player p)
|
||||
private void startLockup(final Player player)
|
||||
{
|
||||
final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
cancelLockup(playerdata);
|
||||
|
||||
@ -117,9 +117,9 @@ public class Command_lockup extends TFM_Command
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (p.isOnline())
|
||||
if (player.isOnline())
|
||||
{
|
||||
p.openInventory(p.getInventory());
|
||||
player.openInventory(player.getInventory());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -43,9 +43,9 @@ public class Command_onlinemode extends TFM_Command
|
||||
|
||||
if (online_mode)
|
||||
{
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
p.kickPlayer("Server is activating \"online-mode=true\". Please reconnect.");
|
||||
player.kickPlayer("Server is activating \"online-mode=true\". Please reconnect.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,21 +26,21 @@ public class Command_op extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
OfflinePlayer p = null;
|
||||
OfflinePlayer player = null;
|
||||
for (Player onlinePlayer : server.getOnlinePlayers())
|
||||
{
|
||||
if (args[0].equalsIgnoreCase(onlinePlayer.getName()))
|
||||
{
|
||||
p = onlinePlayer;
|
||||
player = onlinePlayer;
|
||||
}
|
||||
}
|
||||
|
||||
// if the player is not online
|
||||
if (p == null)
|
||||
if (player == null)
|
||||
{
|
||||
if (TFM_SuperadminList.isUserSuperadmin(sender) || senderIsConsole)
|
||||
{
|
||||
p = server.getOfflinePlayer(args[0]);
|
||||
player = server.getOfflinePlayer(args[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -50,8 +50,8 @@ public class Command_op extends TFM_Command
|
||||
}
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Opping " + p.getName(), false);
|
||||
p.setOp(true);
|
||||
TFM_Util.adminAction(sender.getName(), "Opping " + player.getName(), false);
|
||||
player.setOp(true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -32,14 +32,14 @@ public class Command_opall extends TFM_Command
|
||||
}
|
||||
}
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
p.setOp(true);
|
||||
p.sendMessage(TotalFreedomMod.YOU_ARE_OP);
|
||||
player.setOp(true);
|
||||
player.sendMessage(TotalFreedomMod.YOU_ARE_OP);
|
||||
|
||||
if (doSetGamemode)
|
||||
{
|
||||
p.setGameMode(targetGamemode);
|
||||
player.setGameMode(targetGamemode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -31,9 +31,9 @@ public class Command_ops extends TFM_Command
|
||||
int offlineOPs = 0;
|
||||
int totalOPs = 0;
|
||||
|
||||
for (OfflinePlayer p : server.getOperators())
|
||||
for (OfflinePlayer player : server.getOperators())
|
||||
{
|
||||
if (p.isOnline())
|
||||
if (player.isOnline())
|
||||
{
|
||||
onlineOPs++;
|
||||
}
|
||||
@ -61,13 +61,13 @@ public class Command_ops extends TFM_Command
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Removing all operators", true);
|
||||
|
||||
for (OfflinePlayer p : server.getOperators())
|
||||
for (OfflinePlayer player : server.getOperators())
|
||||
{
|
||||
p.setOp(false);
|
||||
player.setOp(false);
|
||||
|
||||
if (p.isOnline())
|
||||
if (player.isOnline())
|
||||
{
|
||||
p.getPlayer().sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
|
||||
player.getPlayer().sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,10 +21,10 @@ public class Command_orbit extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -32,7 +32,7 @@ public class Command_orbit extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
double strength = 10.0;
|
||||
|
||||
@ -40,7 +40,7 @@ public class Command_orbit extends TFM_Command
|
||||
{
|
||||
if (TFM_Util.isStopCommand(args[1]))
|
||||
{
|
||||
playerMsg("Stopped orbiting " + p.getName());
|
||||
playerMsg("Stopped orbiting " + player.getName());
|
||||
playerdata.stopOrbiting();
|
||||
return true;
|
||||
}
|
||||
@ -56,11 +56,11 @@ public class Command_orbit extends TFM_Command
|
||||
}
|
||||
}
|
||||
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
playerdata.startOrbiting(strength);
|
||||
|
||||
p.setVelocity(new Vector(0, strength, 0));
|
||||
TFM_Util.adminAction(sender.getName(), "Orbiting " + p.getName() + ".", false);
|
||||
player.setVelocity(new Vector(0, strength, 0));
|
||||
TFM_Util.adminAction(sender.getName(), "Orbiting " + player.getName() + ".", false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -58,20 +58,20 @@ public class Command_plugincontrol extends TFM_Command
|
||||
else if (commandMode == CommandMode.RELOAD)
|
||||
{
|
||||
playerMsg("Disabling all plugins.");
|
||||
for (Plugin p : pluginManager.getPlugins())
|
||||
for (Plugin target_plugin : pluginManager.getPlugins())
|
||||
{
|
||||
if (!p.getName().toLowerCase().startsWith("totalfreedommod"))
|
||||
if (!target_plugin.getName().toLowerCase().startsWith("totalfreedommod"))
|
||||
{
|
||||
pluginManager.disablePlugin(p);
|
||||
pluginManager.disablePlugin(target_plugin);
|
||||
}
|
||||
}
|
||||
|
||||
playerMsg("Enabling all plugins.");
|
||||
for (Plugin p : pluginManager.getPlugins())
|
||||
for (Plugin target_plugin : pluginManager.getPlugins())
|
||||
{
|
||||
if (!p.getName().toLowerCase().startsWith("totalfreedommod"))
|
||||
if (!target_plugin.getName().toLowerCase().startsWith("totalfreedommod"))
|
||||
{
|
||||
pluginManager.enablePlugin(p);
|
||||
pluginManager.enablePlugin(target_plugin);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -81,11 +81,11 @@ public class Command_plugincontrol extends TFM_Command
|
||||
|
||||
Plugin targetPlugin = null;
|
||||
|
||||
for (Plugin p : pluginManager.getPlugins())
|
||||
for (Plugin target_plugin : pluginManager.getPlugins())
|
||||
{
|
||||
if (searchPluginName.equalsIgnoreCase(p.getName().toLowerCase().trim()))
|
||||
if (searchPluginName.equalsIgnoreCase(target_plugin.getName().toLowerCase().trim()))
|
||||
{
|
||||
targetPlugin = p;
|
||||
targetPlugin = target_plugin;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ public class Command_premium extends TFM_Command
|
||||
{
|
||||
name = getPlayer(args[0]).getName();
|
||||
}
|
||||
catch (PlayerNotFoundException e)
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
name = args[0];
|
||||
}
|
||||
@ -59,9 +59,9 @@ public class Command_premium extends TFM_Command
|
||||
}.runTask(plugin);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
catch (Exception ex)
|
||||
{
|
||||
TFM_Log.severe(ExceptionUtils.getStackTrace(e));
|
||||
TFM_Log.severe(ExceptionUtils.getStackTrace(ex));
|
||||
playerMsg("There was an error querying the mojang server.", ChatColor.RED);
|
||||
}
|
||||
}
|
||||
|
@ -24,9 +24,9 @@ public class Command_purgeall extends TFM_Command
|
||||
// Undisguise all players
|
||||
TFM_DisguiseCraftBridge.undisguiseAllPlayers();
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
// Unmute all players
|
||||
if (playerdata.isMuted())
|
||||
@ -59,9 +59,9 @@ public class Command_purgeall extends TFM_Command
|
||||
}
|
||||
|
||||
// Purge potion effects
|
||||
for (PotionEffect potion_effect : p.getActivePotionEffects())
|
||||
for (PotionEffect potion_effect : player.getActivePotionEffects())
|
||||
{
|
||||
p.removePotionEffect(potion_effect.getType());
|
||||
player.removePotionEffect(potion_effect.getType());
|
||||
}
|
||||
|
||||
// Uncage
|
||||
|
@ -28,18 +28,18 @@ public class Command_qdeop extends TFM_Command
|
||||
|
||||
String target_name = args[0].toLowerCase();
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (p.getName().toLowerCase().indexOf(target_name) != -1 || p.getDisplayName().toLowerCase().indexOf(target_name) != -1)
|
||||
if (player.getName().toLowerCase().indexOf(target_name) != -1 || player.getDisplayName().toLowerCase().indexOf(target_name) != -1)
|
||||
{
|
||||
matched_player = true;
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "De-opping " + p.getName(), false);
|
||||
TFM_Util.adminAction(sender.getName(), "De-opping " + player.getName(), false);
|
||||
}
|
||||
p.setOp(false);
|
||||
p.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
|
||||
player.setOp(false);
|
||||
player.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -28,18 +28,18 @@ public class Command_qop extends TFM_Command
|
||||
|
||||
String target_name = args[0].toLowerCase();
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (p.getName().toLowerCase().indexOf(target_name) != -1 || p.getDisplayName().toLowerCase().indexOf(target_name) != -1)
|
||||
if (player.getName().toLowerCase().indexOf(target_name) != -1 || player.getDisplayName().toLowerCase().indexOf(target_name) != -1)
|
||||
{
|
||||
matched_player = true;
|
||||
|
||||
if (!silent)
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Opping " + p.getName(), false);
|
||||
TFM_Util.adminAction(sender.getName(), "Opping " + player.getName(), false);
|
||||
}
|
||||
p.setOp(true);
|
||||
p.sendMessage(TotalFreedomMod.YOU_ARE_OP);
|
||||
player.setOp(true);
|
||||
player.sendMessage(TotalFreedomMod.YOU_ARE_OP);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -21,13 +21,13 @@ public class Command_radar extends TFM_Command
|
||||
|
||||
List<TFM_RadarData> radar_data = new ArrayList<TFM_RadarData>();
|
||||
|
||||
for (Player p : sender_pos.getWorld().getPlayers())
|
||||
for (Player player : sender_pos.getWorld().getPlayers())
|
||||
{
|
||||
if (!p.equals(sender_p))
|
||||
if (!player.equals(sender_p))
|
||||
{
|
||||
try
|
||||
{
|
||||
radar_data.add(new TFM_RadarData(p, sender_pos.distance(p.getLocation()), p.getLocation()));
|
||||
radar_data.add(new TFM_RadarData(player, sender_pos.distance(player.getLocation()), player.getLocation()));
|
||||
}
|
||||
catch (IllegalArgumentException ex)
|
||||
{
|
||||
|
@ -15,9 +15,9 @@ public class Command_rank extends TFM_Command
|
||||
{
|
||||
if (senderIsConsole && args.length < 1)
|
||||
{
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
playerMsg(p.getName() + " is " + TFM_Util.getRank(p));
|
||||
playerMsg(player.getName() + " is " + TFM_Util.getRank(player));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@ -33,10 +33,10 @@ public class Command_rank extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -44,7 +44,7 @@ public class Command_rank extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
playerMsg(p.getName() + " is " + TFM_Util.getRank(p), ChatColor.AQUA);
|
||||
playerMsg(player.getName() + " is " + TFM_Util.getRank(player), ChatColor.AQUA);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -70,9 +70,9 @@ public class Command_ro extends TFM_Command
|
||||
if (target_player == null)
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Removing all " + from_material.name() + " within " + radius + " blocks of all players. Brace for lag...", senderIsConsole);
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
affected += TFM_Util.replaceBlocks(p.getLocation(), from_material, Material.AIR, radius);
|
||||
affected += TFM_Util.replaceBlocks(player.getLocation(), from_material, Material.AIR, radius);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -91,12 +91,12 @@ public class Command_saconfig extends TFM_Command
|
||||
|
||||
if (args[0].equalsIgnoreCase("add"))
|
||||
{
|
||||
Player p = null;
|
||||
Player player = null;
|
||||
String admin_name = null;
|
||||
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[1]);
|
||||
player = getPlayer(args[1]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -112,10 +112,10 @@ public class Command_saconfig extends TFM_Command
|
||||
}
|
||||
}
|
||||
|
||||
if (p != null)
|
||||
if (player != null)
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Adding " + p.getName() + " to the superadmin list.", true);
|
||||
TFM_SuperadminList.addSuperadmin(p);
|
||||
TFM_Util.adminAction(sender.getName(), "Adding " + player.getName() + " to the superadmin list.", true);
|
||||
TFM_SuperadminList.addSuperadmin(player);
|
||||
}
|
||||
else if (admin_name != null)
|
||||
{
|
||||
|
@ -27,9 +27,9 @@ public class Command_say extends TFM_Command
|
||||
{
|
||||
TFM_Util.bcastMsg("Server is going offline.", ChatColor.GRAY);
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
p.kickPlayer("Server is going offline, come back in a few minutes.");
|
||||
player.kickPlayer("Server is going offline, come back in a few minutes.");
|
||||
}
|
||||
|
||||
server.shutdown();
|
||||
|
@ -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_WorldEditBridge web = TFM_WorldEditBridge.getInstance();
|
||||
for (final Player p : server.getOnlinePlayers())
|
||||
for (final Player player : server.getOnlinePlayers())
|
||||
{
|
||||
web.setLimit(p, 500);
|
||||
web.setLimit(player, 500);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -21,10 +21,10 @@ public class Command_smite extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -32,27 +32,27 @@ public class Command_smite extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
smite(p);
|
||||
smite(player);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void smite(final Player p)
|
||||
public static void smite(final Player player)
|
||||
{
|
||||
TFM_Util.bcastMsg(p.getName() + " has been a naughty, naughty boy.", ChatColor.RED);
|
||||
TFM_Util.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED);
|
||||
|
||||
//Deop
|
||||
p.setOp(false);
|
||||
player.setOp(false);
|
||||
|
||||
//Set gamemode to survival:
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
//Clear inventory:
|
||||
p.getInventory().clear();
|
||||
player.getInventory().clear();
|
||||
|
||||
//Strike with lightning effect:
|
||||
final Location target_pos = p.getLocation();
|
||||
final World world = p.getWorld();
|
||||
final Location target_pos = player.getLocation();
|
||||
final World world = player.getWorld();
|
||||
for (int x = -1; x <= 1; x++)
|
||||
{
|
||||
for (int z = -1; z <= 1; z++)
|
||||
@ -63,6 +63,6 @@ public class Command_smite extends TFM_Command
|
||||
}
|
||||
|
||||
//Kill:
|
||||
p.setHealth(0.0);
|
||||
player.setHealth(0.0);
|
||||
}
|
||||
}
|
||||
|
@ -66,11 +66,11 @@ public class Command_stfu extends TFM_Command
|
||||
|
||||
TFM_PlayerData playerdata;
|
||||
int counter = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
playerdata.setMuted(true);
|
||||
counter++;
|
||||
}
|
||||
@ -87,9 +87,9 @@ public class Command_stfu extends TFM_Command
|
||||
public void run()
|
||||
{
|
||||
TFM_Util.adminAction("MuteTimer", "Unmuting all players", false);
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_PlayerData.getPlayerData(p).setMuted(false);
|
||||
TFM_PlayerData.getPlayerData(player).setMuted(false);
|
||||
}
|
||||
}
|
||||
}.runTaskLater(plugin, 20L * 60L * 5L);
|
||||
@ -98,10 +98,10 @@ public class Command_stfu extends TFM_Command
|
||||
}
|
||||
else
|
||||
{
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -109,24 +109,24 @@ public class Command_stfu extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
if (playerdata.isMuted())
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Unmuting " + p.getName(), true);
|
||||
TFM_Util.adminAction(sender.getName(), "Unmuting " + player.getName(), true);
|
||||
playerdata.setMuted(false);
|
||||
playerMsg("Unmuted " + p.getName());
|
||||
playerMsg("Unmuted " + player.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Muting " + p.getName(), true);
|
||||
TFM_Util.adminAction(sender.getName(), "Muting " + player.getName(), true);
|
||||
playerdata.setMuted(true);
|
||||
playerMsg("Muted " + p.getName());
|
||||
playerMsg("Muted " + player.getName());
|
||||
}
|
||||
else
|
||||
{
|
||||
playerMsg(p.getName() + " is a superadmin, and can't be muted.");
|
||||
playerMsg(player.getName() + " is a superadmin, and can't be muted.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,9 +15,9 @@ public class Command_stop extends TFM_Command
|
||||
{
|
||||
TFM_Util.bcastMsg("Server is going offline!", ChatColor.LIGHT_PURPLE);
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
p.kickPlayer("Server is going offline, come back in about 20 seconds.");
|
||||
player.kickPlayer("Server is going offline, come back in about 20 seconds.");
|
||||
}
|
||||
|
||||
server.shutdown();
|
||||
|
@ -26,11 +26,11 @@ public class Command_survival extends TFM_Command
|
||||
}
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
|
||||
if (args.length == 0)
|
||||
{
|
||||
p = sender_p;
|
||||
player = sender_p;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -42,9 +42,9 @@ public class Command_survival extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
for (Player target_player : server.getOnlinePlayers())
|
||||
{
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
target_player.setGameMode(GameMode.SURVIVAL);
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Changing everyone's gamemode to survival", false);
|
||||
@ -55,7 +55,7 @@ public class Command_survival extends TFM_Command
|
||||
{
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -70,9 +70,9 @@ public class Command_survival extends TFM_Command
|
||||
}
|
||||
}
|
||||
|
||||
playerMsg("Setting " + p.getName() + " to game mode 'Survival'.");
|
||||
p.sendMessage(sender.getName() + " set your game mode to 'Survival'.");
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
playerMsg("Setting " + player.getName() + " to game mode 'Survival'.");
|
||||
player.sendMessage(sender.getName() + " set your game mode to 'Survival'.");
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -35,14 +35,14 @@ public class Command_tag extends TFM_Command
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Removing all tags", false);
|
||||
int count = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
if (playerdata.getTag() != null)
|
||||
{
|
||||
count++;
|
||||
TFM_PlayerData.getPlayerData(p).setTag(null);
|
||||
TFM_PlayerData.getPlayerData(player).setTag(null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -104,10 +104,10 @@ public class Command_tag extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
final Player p;
|
||||
final Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[1]);
|
||||
player = getPlayer(args[1]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -115,8 +115,8 @@ public class Command_tag extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_PlayerData.getPlayerData(p).setTag(null);
|
||||
playerMsg("Removed " + p.getName() + "'s tag.");
|
||||
TFM_PlayerData.getPlayerData(player).setTag(null);
|
||||
playerMsg("Removed " + player.getName() + "'s tag.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -19,10 +19,10 @@ public class Command_tban extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -30,10 +30,10 @@ public class Command_tban extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "NOPE: " + p.getName(), true);
|
||||
TFM_ServerInterface.banUsername(p.getName(), ChatColor.RED + "You have been temporarily banned for 5 minutes",
|
||||
TFM_Util.adminAction(sender.getName(), "NOPE: " + player.getName(), true);
|
||||
TFM_ServerInterface.banUsername(player.getName(), ChatColor.RED + "You have been temporarily banned for 5 minutes",
|
||||
sender.getName(), TFM_Util.parseDateOffset("5m"));
|
||||
p.kickPlayer(ChatColor.RED + "NOPE!\nYou have been temporarily banned for five minutes.");
|
||||
player.kickPlayer(ChatColor.RED + "NOPE!\nYou have been temporarily banned for five minutes.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -25,10 +25,10 @@ public class Command_tempban extends TFM_Command
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p;
|
||||
Player player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(args[0]);
|
||||
player = getPlayer(args[0]);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
@ -36,7 +36,7 @@ public class Command_tempban extends TFM_Command
|
||||
return true;
|
||||
}
|
||||
|
||||
StringBuilder bcast_msg = new StringBuilder("Temporarily banned " + p.getName());
|
||||
StringBuilder bcast_msg = new StringBuilder("Temporarily banned " + player.getName());
|
||||
|
||||
Date ban_duration = TFM_Util.parseDateOffset("30m");
|
||||
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_ServerInterface.banUsername(p.getName(), ban_reason, sender.getName(), ban_duration);
|
||||
TFM_ServerInterface.banIP(p.getAddress().getAddress().getHostAddress().trim(), ban_reason, sender.getName(), ban_duration);
|
||||
p.kickPlayer(sender.getName() + " - " + bcast_msg.toString());
|
||||
TFM_ServerInterface.banUsername(player.getName(), ban_reason, sender.getName(), ban_duration);
|
||||
TFM_ServerInterface.banIP(player.getAddress().getAddress().getHostAddress().trim(), ban_reason, sender.getName(), ban_duration);
|
||||
player.kickPlayer(sender.getName() + " - " + bcast_msg.toString());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -46,14 +46,14 @@ public class Command_tfbanlist extends TFM_Command
|
||||
StringBuilder banned_players = new StringBuilder();
|
||||
banned_players.append("Banned Players: ");
|
||||
boolean first = true;
|
||||
for (OfflinePlayer p : server.getBannedPlayers())
|
||||
for (OfflinePlayer player : server.getBannedPlayers())
|
||||
{
|
||||
if (!first)
|
||||
{
|
||||
banned_players.append(", ");
|
||||
}
|
||||
first = false;
|
||||
banned_players.append(p.getName().trim());
|
||||
banned_players.append(player.getName().trim());
|
||||
}
|
||||
|
||||
playerMsg(banned_players.toString());
|
||||
|
@ -35,9 +35,9 @@ public class Command_whitelist extends TFM_Command
|
||||
int offlineWPs = 0;
|
||||
int totalWPs = 0;
|
||||
|
||||
for (OfflinePlayer p : server.getWhitelistedPlayers())
|
||||
for (OfflinePlayer player : server.getWhitelistedPlayers())
|
||||
{
|
||||
if (p.isOnline())
|
||||
if (player.isOnline())
|
||||
{
|
||||
onlineWPs++;
|
||||
}
|
||||
@ -88,18 +88,18 @@ public class Command_whitelist extends TFM_Command
|
||||
|
||||
String search_name = args[1].trim().toLowerCase();
|
||||
|
||||
OfflinePlayer p;
|
||||
OfflinePlayer player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(search_name);
|
||||
player = getPlayer(search_name);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
p = server.getOfflinePlayer(search_name);
|
||||
player = server.getOfflinePlayer(search_name);
|
||||
}
|
||||
|
||||
TFM_Util.adminAction(sender.getName(), "Adding " + p.getName() + " to the whitelist.", false);
|
||||
p.setWhitelisted(true);
|
||||
TFM_Util.adminAction(sender.getName(), "Adding " + player.getName() + " to the whitelist.", false);
|
||||
player.setWhitelisted(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -113,20 +113,20 @@ public class Command_whitelist extends TFM_Command
|
||||
|
||||
String search_name = args[1].trim().toLowerCase();
|
||||
|
||||
OfflinePlayer p;
|
||||
OfflinePlayer player;
|
||||
try
|
||||
{
|
||||
p = getPlayer(search_name);
|
||||
player = getPlayer(search_name);
|
||||
}
|
||||
catch (PlayerNotFoundException ex)
|
||||
{
|
||||
p = server.getOfflinePlayer(search_name);
|
||||
player = server.getOfflinePlayer(search_name);
|
||||
}
|
||||
|
||||
if (p.isWhitelisted())
|
||||
if (player.isWhitelisted())
|
||||
{
|
||||
TFM_Util.adminAction(sender.getName(), "Removing " + p.getName() + " from the whitelist.", false);
|
||||
p.setWhitelisted(false);
|
||||
TFM_Util.adminAction(sender.getName(), "Removing " + player.getName() + " from the whitelist.", false);
|
||||
player.setWhitelisted(false);
|
||||
return true;
|
||||
}
|
||||
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);
|
||||
int counter = 0;
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (!p.isWhitelisted())
|
||||
if (!player.isWhitelisted())
|
||||
{
|
||||
p.setWhitelisted(true);
|
||||
player.setWhitelisted(true);
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
|
@ -52,14 +52,14 @@ public class Command_whohas extends TFM_Command
|
||||
|
||||
List<String> players = new ArrayList<String>();
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (p.getInventory().contains(material))
|
||||
if (player.getInventory().contains(material))
|
||||
{
|
||||
players.add(p.getName());
|
||||
if (smite & !TFM_SuperadminList.isUserSuperadmin(p))
|
||||
players.add(player.getName());
|
||||
if (smite & !TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
Command_smite.smite(p);
|
||||
Command_smite.smite(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -36,9 +36,9 @@ public class Command_wildcard extends TFM_Command
|
||||
|
||||
String base_command = StringUtils.join(args, " ");
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
String out_command = base_command.replaceAll("\\x3f", p.getName());
|
||||
String out_command = base_command.replaceAll("\\x3f", player.getName());
|
||||
playerMsg("Running Command: " + out_command);
|
||||
server.dispatchCommand(sender, out_command);
|
||||
}
|
||||
|
@ -17,9 +17,9 @@ public class Command_wipeflatlands extends TFM_Command
|
||||
|
||||
TFM_Util.bcastMsg("Server is going offline for flatlands wipe.", ChatColor.GRAY);
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
p.kickPlayer("Server is going offline for flatlands wipe, come back in a few minutes.");
|
||||
player.kickPlayer("Server is going offline for flatlands wipe, come back in a few minutes.");
|
||||
}
|
||||
|
||||
server.shutdown();
|
||||
|
@ -143,11 +143,11 @@ public abstract class TFM_Command
|
||||
List<Player> matches = server.matchPlayer(partialname);
|
||||
if (matches.isEmpty())
|
||||
{
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
if (p.getDisplayName().toLowerCase().contains(partialname.toLowerCase()))
|
||||
if (player.getDisplayName().toLowerCase().contains(partialname.toLowerCase()))
|
||||
{
|
||||
return p;
|
||||
return player;
|
||||
}
|
||||
}
|
||||
throw new PlayerNotFoundException(partialname);
|
||||
|
@ -41,14 +41,14 @@ public class TFM_BlockListener implements Listener
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onBlockBreak(BlockBreakEvent event)
|
||||
{
|
||||
Player p = event.getPlayer();
|
||||
Player player = event.getPlayer();
|
||||
Location block_pos = event.getBlock().getLocation();
|
||||
|
||||
if (TotalFreedomMod.nukeMonitor)
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
Location player_pos = p.getLocation();
|
||||
Location player_pos = player.getLocation();
|
||||
|
||||
boolean out_of_range = false;
|
||||
if (!player_pos.getWorld().equals(block_pos.getWorld()))
|
||||
@ -64,8 +64,8 @@ public class TFM_BlockListener implements Listener
|
||||
{
|
||||
if (playerdata.incrementAndGetFreecamDestroyCount() > TotalFreedomMod.freecamTriggerCount)
|
||||
{
|
||||
TFM_Util.bcastMsg(p.getName() + " has been flagged for possible freecam nuking.", ChatColor.RED);
|
||||
TFM_Util.autoEject(p, "Freecam (extended range) block breaking is not permitted on this server.");
|
||||
TFM_Util.bcastMsg(player.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.");
|
||||
|
||||
playerdata.resetFreecamDestroyCount();
|
||||
|
||||
@ -83,8 +83,8 @@ public class TFM_BlockListener implements Listener
|
||||
{
|
||||
if (playerdata.incrementAndGetBlockDestroyCount() > TotalFreedomMod.nukeMonitorCountBreak)
|
||||
{
|
||||
TFM_Util.bcastMsg(p.getName() + " is breaking blocks too fast!", ChatColor.RED);
|
||||
TFM_Util.autoEject(p, "You are breaking blocks too fast. Nukers are not permitted on this server.");
|
||||
TFM_Util.bcastMsg(player.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.");
|
||||
|
||||
playerdata.resetBlockDestroyCount();
|
||||
|
||||
@ -96,7 +96,7 @@ public class TFM_BlockListener implements Listener
|
||||
|
||||
if (TotalFreedomMod.protectedAreasEnabled)
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
if (TFM_ProtectedArea.isInProtectedArea(block_pos))
|
||||
{
|
||||
@ -115,14 +115,14 @@ public class TFM_BlockListener implements Listener
|
||||
@EventHandler(priority = EventPriority.HIGH)
|
||||
public void onBlockPlace(BlockPlaceEvent event)
|
||||
{
|
||||
Player p = event.getPlayer();
|
||||
Player player = event.getPlayer();
|
||||
Location block_pos = event.getBlock().getLocation();
|
||||
|
||||
if (TotalFreedomMod.nukeMonitor)
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
Location player_pos = p.getLocation();
|
||||
Location player_pos = player.getLocation();
|
||||
|
||||
boolean out_of_range = false;
|
||||
if (!player_pos.getWorld().equals(block_pos.getWorld()))
|
||||
@ -138,8 +138,8 @@ public class TFM_BlockListener implements Listener
|
||||
{
|
||||
if (playerdata.incrementAndGetFreecamPlaceCount() > TotalFreedomMod.freecamTriggerCount)
|
||||
{
|
||||
TFM_Util.bcastMsg(p.getName() + " has been flagged for possible freecam building.", ChatColor.RED);
|
||||
TFM_Util.autoEject(p, "Freecam (extended range) block building is not permitted on this server.");
|
||||
TFM_Util.bcastMsg(player.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.");
|
||||
|
||||
playerdata.resetFreecamPlaceCount();
|
||||
|
||||
@ -157,8 +157,8 @@ public class TFM_BlockListener implements Listener
|
||||
{
|
||||
if (playerdata.incrementAndGetBlockPlaceCount() > TotalFreedomMod.nukeMonitorCountPlace)
|
||||
{
|
||||
TFM_Util.bcastMsg(p.getName() + " is placing blocks too fast!", ChatColor.RED);
|
||||
TFM_Util.autoEject(p, "You are placing blocks too fast.");
|
||||
TFM_Util.bcastMsg(player.getName() + " is placing blocks too fast!", ChatColor.RED);
|
||||
TFM_Util.autoEject(player, "You are placing blocks too fast.");
|
||||
|
||||
playerdata.resetBlockPlaceCount();
|
||||
|
||||
@ -170,7 +170,7 @@ public class TFM_BlockListener implements Listener
|
||||
|
||||
if (TotalFreedomMod.protectedAreasEnabled)
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
if (TFM_ProtectedArea.isInProtectedArea(block_pos))
|
||||
{
|
||||
@ -187,14 +187,14 @@ public class TFM_BlockListener implements Listener
|
||||
{
|
||||
if (TotalFreedomMod.allowLavaPlace)
|
||||
{
|
||||
TFM_Log.info(String.format("%s placed lava @ %s", p.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
|
||||
TFM_Log.info(String.format("%s placed lava @ %s", player.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
|
||||
|
||||
p.getInventory().clear(p.getInventory().getHeldItemSlot());
|
||||
player.getInventory().clear(player.getInventory().getHeldItemSlot());
|
||||
}
|
||||
else
|
||||
{
|
||||
p.getInventory().setItem(p.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
p.sendMessage(ChatColor.GRAY + "Lava placement is currently disabled.");
|
||||
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
player.sendMessage(ChatColor.GRAY + "Lava placement is currently disabled.");
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -205,14 +205,14 @@ public class TFM_BlockListener implements Listener
|
||||
{
|
||||
if (TotalFreedomMod.allowWaterPlace)
|
||||
{
|
||||
TFM_Log.info(String.format("%s placed water @ %s", p.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
|
||||
TFM_Log.info(String.format("%s placed water @ %s", player.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
|
||||
|
||||
p.getInventory().clear(p.getInventory().getHeldItemSlot());
|
||||
player.getInventory().clear(player.getInventory().getHeldItemSlot());
|
||||
}
|
||||
else
|
||||
{
|
||||
p.getInventory().setItem(p.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
p.sendMessage(ChatColor.GRAY + "Water placement is currently disabled.");
|
||||
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
player.sendMessage(ChatColor.GRAY + "Water placement is currently disabled.");
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -222,14 +222,14 @@ public class TFM_BlockListener implements Listener
|
||||
{
|
||||
if (TotalFreedomMod.allowFirePlace)
|
||||
{
|
||||
TFM_Log.info(String.format("%s placed fire @ %s", p.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
|
||||
TFM_Log.info(String.format("%s placed fire @ %s", player.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
|
||||
|
||||
p.getInventory().clear(p.getInventory().getHeldItemSlot());
|
||||
player.getInventory().clear(player.getInventory().getHeldItemSlot());
|
||||
}
|
||||
else
|
||||
{
|
||||
p.getInventory().setItem(p.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
p.sendMessage(ChatColor.GRAY + "Fire placement is currently disabled.");
|
||||
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
player.sendMessage(ChatColor.GRAY + "Fire placement is currently disabled.");
|
||||
|
||||
event.setCancelled(true);
|
||||
}
|
||||
@ -239,15 +239,15 @@ public class TFM_BlockListener implements Listener
|
||||
{
|
||||
if (TotalFreedomMod.allowExplosions)
|
||||
{
|
||||
TFM_Log.info(String.format("%s placed TNT @ %s", p.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
|
||||
TFM_Log.info(String.format("%s placed TNT @ %s", player.getName(), TFM_Util.formatLocation(event.getBlock().getLocation())));
|
||||
|
||||
p.getInventory().clear(p.getInventory().getHeldItemSlot());
|
||||
player.getInventory().clear(player.getInventory().getHeldItemSlot());
|
||||
}
|
||||
else
|
||||
{
|
||||
p.getInventory().setItem(p.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
player.getInventory().setItem(player.getInventory().getHeldItemSlot(), new ItemStack(Material.COOKIE, 1));
|
||||
|
||||
p.sendMessage(ChatColor.GRAY + "TNT is currently disabled.");
|
||||
player.sendMessage(ChatColor.GRAY + "TNT is currently disabled.");
|
||||
event.setCancelled(true);
|
||||
}
|
||||
break;
|
||||
|
@ -242,21 +242,21 @@ public class TFM_PlayerListener implements Listener
|
||||
return;
|
||||
}
|
||||
|
||||
Player p = event.getPlayer();
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
Player player = event.getPlayer();
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
for (Entry<Player, Double> fuckoff : TotalFreedomMod.fuckoffEnabledFor.entrySet())
|
||||
{
|
||||
Player fuckoff_player = fuckoff.getKey();
|
||||
|
||||
if (fuckoff_player.equals(p) || !fuckoff_player.isOnline())
|
||||
if (fuckoff_player.equals(player) || !fuckoff_player.isOnline())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
double fuckoff_range = fuckoff.getValue().doubleValue();
|
||||
|
||||
Location mover_pos = p.getLocation();
|
||||
Location mover_pos = player.getLocation();
|
||||
Location fuckoff_pos = fuckoff_player.getLocation();
|
||||
|
||||
double distanceSquared;
|
||||
@ -279,7 +279,7 @@ public class TFM_PlayerListener implements Listener
|
||||
boolean do_freeze = false;
|
||||
if (TotalFreedomMod.allPlayersFrozen)
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
do_freeze = true;
|
||||
}
|
||||
@ -305,7 +305,7 @@ public class TFM_PlayerListener implements Listener
|
||||
|
||||
if (playerdata.isCaged())
|
||||
{
|
||||
Location target_pos = p.getLocation().add(0, 1, 0);
|
||||
Location target_pos = player.getLocation().add(0, 1, 0);
|
||||
|
||||
boolean out_of_cage;
|
||||
if (!target_pos.getWorld().equals(playerdata.getCagePos().getWorld()))
|
||||
@ -330,9 +330,9 @@ public class TFM_PlayerListener implements Listener
|
||||
|
||||
if (playerdata.isOrbiting())
|
||||
{
|
||||
if (p.getVelocity().length() < playerdata.orbitStrength() * (2.0 / 3.0))
|
||||
if (player.getVelocity().length() < playerdata.orbitStrength() * (2.0 / 3.0))
|
||||
{
|
||||
p.setVelocity(new Vector(0, playerdata.orbitStrength(), 0));
|
||||
player.setVelocity(new Vector(0, playerdata.orbitStrength(), 0));
|
||||
}
|
||||
}
|
||||
|
||||
@ -355,23 +355,23 @@ public class TFM_PlayerListener implements Listener
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!landmine.player.equals(p))
|
||||
if (!landmine.player.equals(player))
|
||||
{
|
||||
if (p.getWorld().equals(landmine_pos.getWorld()))
|
||||
if (player.getWorld().equals(landmine_pos.getWorld()))
|
||||
{
|
||||
if (p.getLocation().distanceSquared(landmine_pos) <= (landmine.radius * landmine.radius))
|
||||
if (player.getLocation().distanceSquared(landmine_pos) <= (landmine.radius * landmine.radius))
|
||||
{
|
||||
landmine.landmine_pos.getBlock().setType(Material.AIR);
|
||||
|
||||
TNTPrimed tnt1 = landmine_pos.getWorld().spawn(landmine_pos, TNTPrimed.class);
|
||||
tnt1.setFuseTicks(40);
|
||||
tnt1.setPassenger(p);
|
||||
tnt1.setPassenger(player);
|
||||
tnt1.setVelocity(new Vector(0.0, 2.0, 0.0));
|
||||
|
||||
TNTPrimed tnt2 = landmine_pos.getWorld().spawn(p.getLocation(), TNTPrimed.class);
|
||||
TNTPrimed tnt2 = landmine_pos.getWorld().spawn(player.getLocation(), TNTPrimed.class);
|
||||
tnt2.setFuseTicks(1);
|
||||
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
landmines.remove();
|
||||
}
|
||||
}
|
||||
@ -392,10 +392,10 @@ public class TFM_PlayerListener implements Listener
|
||||
{
|
||||
try
|
||||
{
|
||||
final Player p = event.getPlayer();
|
||||
final Player player = event.getPlayer();
|
||||
String message = event.getMessage().trim();
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
|
||||
// Check for spam
|
||||
Long lastRan = TFM_Heartbeat.getLastRan();
|
||||
@ -407,8 +407,8 @@ public class TFM_PlayerListener implements Listener
|
||||
{
|
||||
if (playerdata.incrementAndGetMsgCount() > MSG_PER_HEARTBEAT)
|
||||
{
|
||||
TFM_Util.bcastMsg(p.getName() + " was automatically kicked for spamming chat.", ChatColor.RED);
|
||||
TFM_Util.autoEject(p, "Kicked for spamming chat.");
|
||||
TFM_Util.bcastMsg(player.getName() + " was automatically kicked for spamming chat.", ChatColor.RED);
|
||||
TFM_Util.autoEject(player, "Kicked for spamming chat.");
|
||||
|
||||
playerdata.resetMsgCount();
|
||||
|
||||
@ -420,7 +420,7 @@ public class TFM_PlayerListener implements Listener
|
||||
// Check for message repeat
|
||||
if (playerdata.getLastMessage().equalsIgnoreCase(message))
|
||||
{
|
||||
TFM_Util.playerMsg(p, "Please do not repeat messages.");
|
||||
TFM_Util.playerMsg(player, "Please do not repeat messages.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@ -429,9 +429,9 @@ public class TFM_PlayerListener implements Listener
|
||||
// Check for muted
|
||||
if (playerdata.isMuted())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
p.sendMessage(ChatColor.RED + "You are muted, STFU!");
|
||||
player.sendMessage(ChatColor.RED + "You are muted, STFU!");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@ -448,7 +448,7 @@ public class TFM_PlayerListener implements Listener
|
||||
if (message.length() > 100)
|
||||
{
|
||||
message = message.substring(0, 100);
|
||||
TFM_Util.playerMsg(p, "Message was shortened because it was too long to send.");
|
||||
TFM_Util.playerMsg(player, "Message was shortened because it was too long to send.");
|
||||
}
|
||||
|
||||
// Check for caps
|
||||
@ -471,7 +471,7 @@ public class TFM_PlayerListener implements Listener
|
||||
// Check for adminchat
|
||||
if (playerdata.inAdminChat())
|
||||
{
|
||||
TFM_Util.adminChatMessage(p, message, false);
|
||||
TFM_Util.adminChatMessage(player, message, false);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@ -482,7 +482,7 @@ public class TFM_PlayerListener implements Listener
|
||||
// Set the tag
|
||||
if (playerdata.getTag() != null)
|
||||
{
|
||||
p.setDisplayName((playerdata.getTag() + " " + p.getDisplayName().replaceAll(" ", "")));
|
||||
player.setDisplayName((playerdata.getTag() + " " + player.getDisplayName().replaceAll(" ", "")));
|
||||
}
|
||||
|
||||
}
|
||||
@ -496,15 +496,15 @@ public class TFM_PlayerListener implements Listener
|
||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
String command = event.getMessage();
|
||||
Player p = event.getPlayer();
|
||||
Player player = event.getPlayer();
|
||||
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
playerdata.setLastCommand(command);
|
||||
|
||||
if (playerdata.incrementAndGetMsgCount() > MSG_PER_HEARTBEAT)
|
||||
{
|
||||
TFM_Util.bcastMsg(p.getName() + " was automatically kicked for spamming commands.", ChatColor.RED);
|
||||
TFM_Util.autoEject(p, "Kicked for spamming commands.");
|
||||
TFM_Util.bcastMsg(player.getName() + " was automatically kicked for spamming commands.", ChatColor.RED);
|
||||
TFM_Util.autoEject(player, "Kicked for spamming commands.");
|
||||
|
||||
playerdata.resetMsgCount();
|
||||
|
||||
@ -516,7 +516,7 @@ public class TFM_PlayerListener implements Listener
|
||||
|
||||
if (playerdata.allCommandsBlocked())
|
||||
{
|
||||
TFM_Util.playerMsg(p, "Your commands have been blocked by an admin.", ChatColor.RED);
|
||||
TFM_Util.playerMsg(player, "Your commands have been blocked by an admin.", ChatColor.RED);
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@ -524,13 +524,13 @@ public class TFM_PlayerListener implements Listener
|
||||
// Block commands if player is muted
|
||||
if (playerdata.isMuted())
|
||||
{
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
for (String test_command : BLOCKED_MUTED_CMDS)
|
||||
{
|
||||
if (Pattern.compile("^/" + test_command.toLowerCase() + " ").matcher(command).find())
|
||||
{
|
||||
p.sendMessage(ChatColor.RED + "That command is blocked while you are muted.");
|
||||
player.sendMessage(ChatColor.RED + "That command is blocked while you are muted.");
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
@ -544,7 +544,7 @@ public class TFM_PlayerListener implements Listener
|
||||
|
||||
if (TotalFreedomMod.preprocessLogEnabled)
|
||||
{
|
||||
TFM_Log.info(String.format("[PREPROCESS_COMMAND] %s(%s): %s", p.getName(), ChatColor.stripColor(p.getDisplayName()), command), true);
|
||||
TFM_Log.info(String.format("[PREPROCESS_COMMAND] %s(%s): %s", player.getName(), ChatColor.stripColor(player.getDisplayName()), command), true);
|
||||
}
|
||||
|
||||
command = command.toLowerCase().trim();
|
||||
@ -556,13 +556,13 @@ public class TFM_PlayerListener implements Listener
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (!TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
for (Player pl : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (TFM_SuperadminList.isUserSuperadmin(pl) && TFM_PlayerData.getPlayerData(pl).cmdspyEnabled())
|
||||
{
|
||||
TFM_Util.playerMsg(pl, p.getName() + ": " + command);
|
||||
TFM_Util.playerMsg(pl, player.getName() + ": " + command);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -587,12 +587,12 @@ public class TFM_PlayerListener implements Listener
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerKick(PlayerKickEvent event)
|
||||
{
|
||||
Player p = event.getPlayer();
|
||||
if (TotalFreedomMod.fuckoffEnabledFor.containsKey(p))
|
||||
Player player = event.getPlayer();
|
||||
if (TotalFreedomMod.fuckoffEnabledFor.containsKey(player))
|
||||
{
|
||||
TotalFreedomMod.fuckoffEnabledFor.remove(p);
|
||||
TotalFreedomMod.fuckoffEnabledFor.remove(player);
|
||||
}
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
playerdata.disarmMP44();
|
||||
if (playerdata.isCaged())
|
||||
{
|
||||
@ -604,12 +604,12 @@ public class TFM_PlayerListener implements Listener
|
||||
@EventHandler(priority = EventPriority.MONITOR)
|
||||
public void onPlayerQuit(PlayerQuitEvent event)
|
||||
{
|
||||
Player p = event.getPlayer();
|
||||
if (TotalFreedomMod.fuckoffEnabledFor.containsKey(p))
|
||||
Player player = event.getPlayer();
|
||||
if (TotalFreedomMod.fuckoffEnabledFor.containsKey(player))
|
||||
{
|
||||
TotalFreedomMod.fuckoffEnabledFor.remove(p);
|
||||
TotalFreedomMod.fuckoffEnabledFor.remove(player);
|
||||
}
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
playerdata.disarmMP44();
|
||||
if (playerdata.isCaged())
|
||||
{
|
||||
@ -623,41 +623,41 @@ public class TFM_PlayerListener implements Listener
|
||||
{
|
||||
try
|
||||
{
|
||||
final Player p = event.getPlayer();
|
||||
final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
final Player player = event.getPlayer();
|
||||
final TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
playerdata.setSuperadminIdVerified(null);
|
||||
|
||||
TFM_UserList.getInstance(TotalFreedomMod.plugin).addUser(p);
|
||||
TFM_UserList.getInstance(TotalFreedomMod.plugin).addUser(player);
|
||||
|
||||
boolean superadmin_impostor = TFM_SuperadminList.isSuperadminImpostor(p);
|
||||
boolean superadmin_impostor = TFM_SuperadminList.isSuperadminImpostor(player);
|
||||
|
||||
if (superadmin_impostor || TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (superadmin_impostor || TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
TFM_Util.bcastMsg(ChatColor.AQUA + p.getName() + " is " + TFM_Util.getRank(p));
|
||||
TFM_Util.bcastMsg(ChatColor.AQUA + player.getName() + " is " + TFM_Util.getRank(player));
|
||||
|
||||
if (superadmin_impostor)
|
||||
{
|
||||
p.getInventory().clear();
|
||||
p.setOp(false);
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
TFM_Util.bcastMsg("Warning: " + p.getName() + " has been flagged as an impostor!", ChatColor.RED);
|
||||
player.getInventory().clear();
|
||||
player.setOp(false);
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
TFM_Util.bcastMsg("Warning: " + player.getName() + " has been flagged as an impostor!", ChatColor.RED);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (TFM_SuperadminList.verifyIdentity(p.getName(), p.getAddress().getAddress().getHostAddress()))
|
||||
if (TFM_SuperadminList.verifyIdentity(player.getName(), player.getAddress().getAddress().getHostAddress()))
|
||||
{
|
||||
playerdata.setSuperadminIdVerified(Boolean.TRUE);
|
||||
|
||||
TFM_SuperadminList.updateLastLogin(p);
|
||||
TFM_SuperadminList.updateLastLogin(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
playerdata.setSuperadminIdVerified(Boolean.FALSE);
|
||||
|
||||
TFM_Util.bcastMsg("Warning: " + p.getName() + " is an admin, but is using a username not registered to one of their IPs.", ChatColor.RED);
|
||||
TFM_Util.bcastMsg("Warning: " + player.getName() + " is an admin, but is using a username not registered to one of their IPs.", ChatColor.RED);
|
||||
}
|
||||
|
||||
p.setOp(true);
|
||||
player.setOp(true);
|
||||
}
|
||||
}
|
||||
|
||||
@ -668,7 +668,7 @@ public class TFM_PlayerListener implements Listener
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
p.sendMessage(ChatColor.RED + "Server is currently closed to non-superadmins.");
|
||||
player.sendMessage(ChatColor.RED + "Server is currently closed to non-superadmins.");
|
||||
}
|
||||
}.runTaskLater(TotalFreedomMod.plugin, 20L * 3L);
|
||||
}
|
||||
|
@ -27,9 +27,9 @@ public class TFM_Heartbeat extends BukkitRunnable
|
||||
{
|
||||
lastRan = System.currentTimeMillis();
|
||||
|
||||
for (Player p : server.getOnlinePlayers())
|
||||
for (Player player : server.getOnlinePlayers())
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.getPlayerData(player);
|
||||
playerdata.resetMsgCount();
|
||||
playerdata.resetBlockDestroyCount();
|
||||
playerdata.resetBlockPlaceCount();
|
||||
|
@ -62,9 +62,9 @@ public class TFM_PlayerData
|
||||
this.player_name = player.getName();
|
||||
}
|
||||
|
||||
public static TFM_PlayerData getPlayerData(Player p)
|
||||
public static TFM_PlayerData getPlayerData(Player player)
|
||||
{
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.userinfo.get(p);
|
||||
TFM_PlayerData playerdata = TFM_PlayerData.userinfo.get(player);
|
||||
|
||||
if (playerdata == null)
|
||||
{
|
||||
@ -74,7 +74,7 @@ public class TFM_PlayerData
|
||||
Entry<Player, TFM_PlayerData> pair = it.next();
|
||||
TFM_PlayerData playerdata_test = pair.getValue();
|
||||
|
||||
if (playerdata_test.player_name.equalsIgnoreCase(p.getName()))
|
||||
if (playerdata_test.player_name.equalsIgnoreCase(player.getName()))
|
||||
{
|
||||
if (Bukkit.getOnlineMode())
|
||||
{
|
||||
@ -83,7 +83,7 @@ public class TFM_PlayerData
|
||||
}
|
||||
else
|
||||
{
|
||||
if (playerdata_test.ip_address.equalsIgnoreCase(p.getAddress().getAddress().getHostAddress()))
|
||||
if (playerdata_test.ip_address.equalsIgnoreCase(player.getAddress().getAddress().getHostAddress()))
|
||||
{
|
||||
playerdata = playerdata_test;
|
||||
break;
|
||||
@ -95,8 +95,8 @@ public class TFM_PlayerData
|
||||
|
||||
if (playerdata == null)
|
||||
{
|
||||
playerdata = new TFM_PlayerData(p);
|
||||
TFM_PlayerData.userinfo.put(p, playerdata);
|
||||
playerdata = new TFM_PlayerData(player);
|
||||
TFM_PlayerData.userinfo.put(player, playerdata);
|
||||
}
|
||||
|
||||
return playerdata;
|
||||
|
@ -130,9 +130,9 @@ public class TFM_ServerInterface
|
||||
final BanList banByIP = player_list.getIPBans();
|
||||
final BanList banByName = player_list.getNameBans();
|
||||
|
||||
final Player p = event.getPlayer();
|
||||
final Player player = event.getPlayer();
|
||||
|
||||
final String player_name = p.getName();
|
||||
final String player_name = player.getName();
|
||||
final String player_ip = event.getAddress().getHostAddress().trim().toLowerCase();
|
||||
|
||||
if (player_name.trim().length() <= 2)
|
||||
@ -146,7 +146,7 @@ public class TFM_ServerInterface
|
||||
return;
|
||||
}
|
||||
|
||||
// not safe to use TFM_Util.isUserSuperadmin for player logging in because p.getAddress() will return a null until after player login.
|
||||
// not safe to use TFM_Util.isUserSuperadmin for player logging in because player.getAddress() will return a null until after player login.
|
||||
boolean is_superadmin;
|
||||
if (server.getOnlineMode())
|
||||
{
|
||||
@ -304,7 +304,7 @@ public class TFM_ServerInterface
|
||||
|
||||
if (TotalFreedomMod.lockdownEnabled)
|
||||
{
|
||||
TFM_Util.playerMsg(p, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED);
|
||||
TFM_Util.playerMsg(player, "Warning: Server is currenty in lockdown-mode, new players will not be able to join!", ChatColor.RED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -173,9 +173,9 @@ public class TFM_SuperadminList
|
||||
}
|
||||
}
|
||||
|
||||
public static TFM_Superadmin getAdminEntry(Player p)
|
||||
public static TFM_Superadmin getAdminEntry(Player player)
|
||||
{
|
||||
return getAdminEntry(p.getName().toLowerCase());
|
||||
return getAdminEntry(player.getName().toLowerCase());
|
||||
}
|
||||
|
||||
public static TFM_Superadmin getAdminEntryByIP(String ip)
|
||||
@ -193,9 +193,9 @@ public class TFM_SuperadminList
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void updateLastLogin(Player p)
|
||||
public static void updateLastLogin(Player player)
|
||||
{
|
||||
TFM_Superadmin admin_entry = getAdminEntry(p);
|
||||
TFM_Superadmin admin_entry = getAdminEntry(player);
|
||||
if (admin_entry != null)
|
||||
{
|
||||
admin_entry.setLastLogin(new Date());
|
||||
@ -324,11 +324,11 @@ public class TFM_SuperadminList
|
||||
return false;
|
||||
}
|
||||
|
||||
Player p = (Player) user;
|
||||
Player player = (Player) user;
|
||||
|
||||
if (superadminNames.contains(p.getName().toLowerCase()))
|
||||
if (superadminNames.contains(player.getName().toLowerCase()))
|
||||
{
|
||||
return !isUserSuperadmin(p);
|
||||
return !isUserSuperadmin(player);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -366,10 +366,10 @@ public class TFM_SuperadminList
|
||||
}
|
||||
}
|
||||
|
||||
public static void addSuperadmin(Player p)
|
||||
public static void addSuperadmin(Player player)
|
||||
{
|
||||
String admin_name = p.getName().toLowerCase();
|
||||
List<String> ips = Arrays.asList(p.getAddress().getAddress().getHostAddress());
|
||||
String admin_name = player.getName().toLowerCase();
|
||||
List<String> ips = Arrays.asList(player.getAddress().getAddress().getHostAddress());
|
||||
|
||||
addSuperadmin(admin_name, ips);
|
||||
}
|
||||
@ -399,9 +399,9 @@ public class TFM_SuperadminList
|
||||
}
|
||||
}
|
||||
|
||||
public static void removeSuperadmin(Player p)
|
||||
public static void removeSuperadmin(Player player)
|
||||
{
|
||||
removeSuperadmin(p.getName());
|
||||
removeSuperadmin(player.getName());
|
||||
}
|
||||
|
||||
public static void cleanSuperadminList(boolean verbose)
|
||||
|
@ -40,9 +40,9 @@ public class TFM_UserList
|
||||
userlist.put(username, entry);
|
||||
}
|
||||
|
||||
for (Player p : plugin.getServer().getOnlinePlayers())
|
||||
for (Player player : plugin.getServer().getOnlinePlayers())
|
||||
{
|
||||
addUser(p);
|
||||
addUser(player);
|
||||
}
|
||||
|
||||
exportList();
|
||||
@ -82,9 +82,9 @@ public class TFM_UserList
|
||||
return instance;
|
||||
}
|
||||
|
||||
public void addUser(Player p)
|
||||
public void addUser(Player player)
|
||||
{
|
||||
addUser(p.getName(), p.getAddress().getAddress().getHostAddress());
|
||||
addUser(player.getName(), player.getAddress().getAddress().getHostAddress());
|
||||
}
|
||||
|
||||
public void addUser(String username, String ip_address)
|
||||
@ -105,9 +105,9 @@ public class TFM_UserList
|
||||
}
|
||||
}
|
||||
|
||||
public TFM_UserListEntry getEntry(Player p)
|
||||
public TFM_UserListEntry getEntry(Player player)
|
||||
{
|
||||
return getEntry(p.getName());
|
||||
return getEntry(player.getName());
|
||||
}
|
||||
|
||||
public TFM_UserListEntry getEntry(String username)
|
||||
@ -119,9 +119,9 @@ public class TFM_UserList
|
||||
{
|
||||
userlist.clear();
|
||||
|
||||
for (Player p : plugin.getServer().getOnlinePlayers())
|
||||
for (Player player : plugin.getServer().getOnlinePlayers())
|
||||
{
|
||||
addUser(p);
|
||||
addUser(player);
|
||||
}
|
||||
|
||||
exportList();
|
||||
|
@ -55,9 +55,9 @@ public class TFM_Util
|
||||
{
|
||||
TFM_Log.info(message, true);
|
||||
|
||||
for (Player p : Bukkit.getOnlinePlayers())
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
p.sendMessage((color == null ? "" : color) + message);
|
||||
player.sendMessage((color == null ? "" : color) + message);
|
||||
}
|
||||
}
|
||||
|
||||
@ -396,14 +396,14 @@ public class TFM_Util
|
||||
STRIKE_ONE, STRIKE_TWO, STRIKE_THREE;
|
||||
}
|
||||
|
||||
public static void autoEject(Player p, String kickMessage)
|
||||
public static void autoEject(Player player, String kickMessage)
|
||||
{
|
||||
EjectMethod method = EjectMethod.STRIKE_ONE;
|
||||
String player_ip = null;
|
||||
|
||||
try
|
||||
{
|
||||
player_ip = p.getAddress().getAddress().getHostAddress();
|
||||
player_ip = player.getAddress().getAddress().getHostAddress();
|
||||
|
||||
Integer num_kicks = TFM_Util.eject_tracker.get(player_ip);
|
||||
if (num_kicks == null)
|
||||
@ -432,11 +432,11 @@ public class TFM_Util
|
||||
{
|
||||
}
|
||||
|
||||
TFM_Log.info("autoEject -> name: " + p.getName() + " - player_ip: " + player_ip + " - method: " + method.toString());
|
||||
TFM_Log.info("autoEject -> name: " + player.getName() + " - player_ip: " + player_ip + " - method: " + method.toString());
|
||||
|
||||
p.setOp(false);
|
||||
p.setGameMode(GameMode.SURVIVAL);
|
||||
p.getInventory().clear();
|
||||
player.setOp(false);
|
||||
player.setGameMode(GameMode.SURVIVAL);
|
||||
player.getInventory().clear();
|
||||
|
||||
switch (method)
|
||||
{
|
||||
@ -446,11 +446,11 @@ public class TFM_Util
|
||||
c.add(Calendar.MINUTE, 1);
|
||||
Date expires = c.getTime();
|
||||
|
||||
TFM_Util.bcastMsg(ChatColor.RED + p.getName() + " has been banned for 1 minute.");
|
||||
TFM_Util.bcastMsg(ChatColor.RED + player.getName() + " has been banned for 1 minute.");
|
||||
|
||||
TFM_ServerInterface.banIP(player_ip, kickMessage, "AutoEject", expires);
|
||||
TFM_ServerInterface.banUsername(p.getName(), kickMessage, "AutoEject", expires);
|
||||
p.kickPlayer(kickMessage);
|
||||
TFM_ServerInterface.banUsername(player.getName(), kickMessage, "AutoEject", expires);
|
||||
player.kickPlayer(kickMessage);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -460,11 +460,11 @@ public class TFM_Util
|
||||
c.add(Calendar.MINUTE, 3);
|
||||
Date expires = c.getTime();
|
||||
|
||||
TFM_Util.bcastMsg(ChatColor.RED + p.getName() + " has been banned for 3 minutes.");
|
||||
TFM_Util.bcastMsg(ChatColor.RED + player.getName() + " has been banned for 3 minutes.");
|
||||
|
||||
TFM_ServerInterface.banIP(player_ip, kickMessage, "AutoEject", expires);
|
||||
TFM_ServerInterface.banUsername(p.getName(), kickMessage, "AutoEject", expires);
|
||||
p.kickPlayer(kickMessage);
|
||||
TFM_ServerInterface.banUsername(player.getName(), kickMessage, "AutoEject", expires);
|
||||
player.kickPlayer(kickMessage);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -477,11 +477,11 @@ public class TFM_Util
|
||||
TFM_ServerInterface.banIP(ip_address_parts[0] + "." + ip_address_parts[1] + ".*.*", kickMessage, "AutoEject", null);
|
||||
|
||||
//p.setBanned(true);
|
||||
TFM_ServerInterface.banUsername(p.getName(), kickMessage, "AutoEject", null);
|
||||
TFM_ServerInterface.banUsername(player.getName(), kickMessage, "AutoEject", null);
|
||||
|
||||
TFM_Util.bcastMsg(ChatColor.RED + p.getName() + " has been banned permanently.");
|
||||
TFM_Util.bcastMsg(ChatColor.RED + player.getName() + " has been banned permanently.");
|
||||
|
||||
p.kickPlayer(kickMessage);
|
||||
player.kickPlayer(kickMessage);
|
||||
|
||||
break;
|
||||
}
|
||||
@ -653,9 +653,9 @@ public class TFM_Util
|
||||
public static String playerListToNames(Set<OfflinePlayer> players)
|
||||
{
|
||||
List<String> player_names = new ArrayList<String>();
|
||||
for (OfflinePlayer p : players)
|
||||
for (OfflinePlayer player : players)
|
||||
{
|
||||
player_names.add(p.getName());
|
||||
player_names.add(player.getName());
|
||||
}
|
||||
return StringUtils.join(player_names, ", ");
|
||||
}
|
||||
@ -893,11 +893,11 @@ public class TFM_Util
|
||||
String name = sender.getName() + " " + getPrefix(sender, senderIsConsole);
|
||||
TFM_Log.info("[ADMIN] " + name + ": " + message);
|
||||
|
||||
for (Player p : Bukkit.getOnlinePlayers())
|
||||
for (Player player : Bukkit.getOnlinePlayers())
|
||||
{
|
||||
if (TFM_SuperadminList.isUserSuperadmin(p))
|
||||
if (TFM_SuperadminList.isUserSuperadmin(player))
|
||||
{
|
||||
p.sendMessage("[" + ChatColor.AQUA + "ADMIN" + ChatColor.WHITE + "] " + ChatColor.DARK_RED + name + ": " + ChatColor.AQUA + message);
|
||||
player.sendMessage("[" + ChatColor.AQUA + "ADMIN" + ChatColor.WHITE + "] " + ChatColor.DARK_RED + name + ": " + ChatColor.AQUA + message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,14 +38,14 @@ public class TFM_WorldEditBridge
|
||||
return this.worldEditPlugin;
|
||||
}
|
||||
|
||||
public BukkitPlayer getBukkitPlayer(Player p)
|
||||
public BukkitPlayer getBukkitPlayer(Player player)
|
||||
{
|
||||
try
|
||||
{
|
||||
WorldEditPlugin wep = this.getWorldEditPlugin();
|
||||
if (wep != null)
|
||||
{
|
||||
return wep.wrapPlayer(p);
|
||||
return wep.wrapPlayer(player);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -55,14 +55,14 @@ public class TFM_WorldEditBridge
|
||||
return null;
|
||||
}
|
||||
|
||||
public LocalSession getPlayerSession(Player p)
|
||||
public LocalSession getPlayerSession(Player player)
|
||||
{
|
||||
try
|
||||
{
|
||||
WorldEditPlugin wep = this.getWorldEditPlugin();
|
||||
if (wep != null)
|
||||
{
|
||||
return wep.getSession(p);
|
||||
return wep.getSession(player);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
@ -72,14 +72,14 @@ public class TFM_WorldEditBridge
|
||||
return null;
|
||||
}
|
||||
|
||||
public void undo(Player p, int count)
|
||||
public void undo(Player player, int count)
|
||||
{
|
||||
try
|
||||
{
|
||||
LocalSession session = getPlayerSession(p);
|
||||
LocalSession session = getPlayerSession(player);
|
||||
if (session != null)
|
||||
{
|
||||
BukkitPlayer bukkitPlayer = this.getBukkitPlayer(p);
|
||||
BukkitPlayer bukkitPlayer = this.getBukkitPlayer(player);
|
||||
if (bukkitPlayer != null)
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
@ -95,11 +95,11 @@ public class TFM_WorldEditBridge
|
||||
}
|
||||
}
|
||||
|
||||
public void setLimit(Player p, int limit)
|
||||
public void setLimit(Player player, int limit)
|
||||
{
|
||||
try
|
||||
{
|
||||
LocalSession session = getPlayerSession(p);
|
||||
LocalSession session = getPlayerSession(player);
|
||||
if (session != null)
|
||||
{
|
||||
session.setBlockChangeLimit(limit);
|
||||
|
Loading…
Reference in New Issue
Block a user