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