Code refactoring and cleanup.

This commit is contained in:
StevenLawson 2014-08-23 14:19:25 -04:00
parent 0f764b976b
commit 755080d0a4
52 changed files with 109 additions and 146 deletions

View File

@ -156,7 +156,6 @@ public class TFM_WorldEditBridge
}.runTask(TotalFreedomMod.plugin); }.runTask(TotalFreedomMod.plugin);
} }
} }
catch (IncompleteRegionException ex) catch (IncompleteRegionException ex)
{ {

View File

@ -3,7 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.World.TFM_AdminWorld; import me.StevenLawson.TotalFreedomMod.World.TFM_AdminWorld;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -117,7 +116,7 @@ public class Command_adminworld extends TFM_Command
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }
@ -216,7 +215,7 @@ public class Command_adminworld extends TFM_Command
{ {
if (!(sender instanceof Player) || sender_p == null || !TFM_AdminList.isSuperAdmin(sender)) if (!(sender instanceof Player) || sender_p == null || !TFM_AdminList.isSuperAdmin(sender))
{ {
throw new PermissionDeniedException(TotalFreedomMod.MSG_NO_PERMS); throw new PermissionDeniedException(TFM_Command.MSG_NO_PERMS);
} }
} }

View File

@ -3,7 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -41,7 +40,7 @@ public class Command_blockcmd extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND); playerMsg(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -2,7 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
@ -52,7 +51,7 @@ public class Command_cage extends TFM_Command
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Minecart; import org.bukkit.entity.Minecart;
@ -23,7 +22,7 @@ public class Command_cartsit extends TFM_Command
if (targetPlayer == null) if (targetPlayer == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }
} }

View File

@ -48,4 +48,4 @@ public class Command_cmdlist extends TFM_Command
return true; return true;
} }
} }

View File

@ -2,7 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -35,7 +34,7 @@ public class Command_creative extends TFM_Command
{ {
if (!TFM_AdminList.isSuperAdmin(sender)) if (!TFM_AdminList.isSuperAdmin(sender))
{ {
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); sender.sendMessage(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
@ -54,12 +53,11 @@ public class Command_creative extends TFM_Command
return true; return true;
} }
player = getPlayer(args[0]); player = getPlayer(args[0]);
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -18,7 +17,7 @@ public class Command_deopall extends TFM_Command
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {
player.setOp(false); player.setOp(false);
player.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP); player.sendMessage(TFM_Command.YOU_ARE_NOT_OP);
} }
return true; return true;

View File

@ -5,8 +5,6 @@ import me.StevenLawson.TotalFreedomMod.TFM_Ban;
import me.StevenLawson.TotalFreedomMod.TFM_BanManager; import me.StevenLawson.TotalFreedomMod.TFM_BanManager;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerList; import me.StevenLawson.TotalFreedomMod.TFM_PlayerList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TFM_UuidResolver;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -31,7 +29,7 @@ public class Command_doom extends TFM_Command
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -5,14 +5,14 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH) @CommandPermissions(level = AdminLevel.ALL, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Goto the ender / \"The End\".", usage = "/<command>") @CommandParameters(description = "Goto the ender / \"The End\".", usage = "/<command>")
public class Command_ender extends TFM_Command public class Command_ender 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)
{ {
TFM_Util.gotoWorld(sender, server.getWorlds().get(0).getName() + "_the_end"); TFM_Util.gotoWorld(sender_p, server.getWorlds().get(0).getName() + "_the_end");
return true; return true;
} }
} }

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerList; import me.StevenLawson.TotalFreedomMod.TFM_PlayerList;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -24,7 +23,7 @@ public class Command_findip extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND); playerMsg(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -85,7 +85,7 @@ public class Command_fr extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND, ChatColor.RED); playerMsg(TFM_Command.PLAYER_NOT_FOUND, ChatColor.RED);
return true; return true;
} }

View File

@ -5,7 +5,6 @@ import java.util.Iterator;
import me.StevenLawson.TotalFreedomMod.TFM_BanManager; import me.StevenLawson.TotalFreedomMod.TFM_BanManager;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -165,7 +164,7 @@ public class Command_gadmin extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), String.format("Opping %s.", target.getName()), false); TFM_Util.adminAction(sender.getName(), String.format("Opping %s.", target.getName()), false);
target.setOp(false); target.setOp(false);
target.sendMessage(TotalFreedomMod.YOU_ARE_OP); target.sendMessage(TFM_Command.YOU_ARE_OP);
break; break;
} }
@ -173,7 +172,7 @@ public class Command_gadmin extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), String.format("Deopping %s.", target.getName()), false); TFM_Util.adminAction(sender.getName(), String.format("Deopping %s.", target.getName()), false);
target.setOp(false); target.setOp(false);
target.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP); target.sendMessage(TFM_Command.YOU_ARE_NOT_OP);
break; break;
} }

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_CommandBlocker; import me.StevenLawson.TotalFreedomMod.TFM_CommandBlocker;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -23,7 +22,7 @@ public class Command_gcmd extends TFM_Command
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -5,7 +5,6 @@ import me.StevenLawson.TotalFreedomMod.TFM_Ban;
import me.StevenLawson.TotalFreedomMod.TFM_BanManager; import me.StevenLawson.TotalFreedomMod.TFM_BanManager;
import me.StevenLawson.TotalFreedomMod.TFM_RollbackManager; import me.StevenLawson.TotalFreedomMod.TFM_RollbackManager;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.ArrayUtils; import net.minecraft.util.org.apache.commons.lang3.ArrayUtils;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -31,7 +30,7 @@ public class Command_gtfo extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND, ChatColor.RED); playerMsg(TFM_Command.PLAYER_NOT_FOUND, ChatColor.RED);
return true; return true;
} }

View File

@ -3,7 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -81,7 +80,7 @@ public class Command_halt extends TFM_Command
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -23,7 +22,7 @@ public class Command_lastcmd extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND); playerMsg(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -2,7 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -51,7 +50,7 @@ public class Command_lockup extends TFM_Command
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }
@ -65,7 +64,7 @@ public class Command_lockup extends TFM_Command
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -5,14 +5,14 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@CommandPermissions(level = AdminLevel.ALL, source = SourceType.BOTH) @CommandPermissions(level = AdminLevel.ALL, source = SourceType.ONLY_IN_GAME)
@CommandParameters(description = "Goto the nether.", usage = "/<command>") @CommandParameters(description = "Goto the nether.", usage = "/<command>")
public class Command_nether extends TFM_Command public class Command_nether 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)
{ {
TFM_Util.gotoWorld(sender, server.getWorlds().get(0).getName() + "_nether"); TFM_Util.gotoWorld(sender_p, server.getWorlds().get(0).getName() + "_nether");
return true; return true;
} }
} }

View File

@ -4,7 +4,6 @@ import me.StevenLawson.TotalFreedomMod.TFM_Log;
import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface; import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -28,7 +27,7 @@ public class Command_onlinemode extends TFM_Command
if (sender instanceof Player && !TFM_AdminList.isSeniorAdmin(sender, true)) if (sender instanceof Player && !TFM_AdminList.isSeniorAdmin(sender, true))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -35,7 +34,7 @@ public class Command_opall extends TFM_Command
for (Player player : server.getOnlinePlayers()) for (Player player : server.getOnlinePlayers())
{ {
player.setOp(true); player.setOp(true);
player.sendMessage(TotalFreedomMod.YOU_ARE_OP); player.sendMessage(TFM_Command.YOU_ARE_OP);
if (doSetGamemode) if (doSetGamemode)
{ {

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -15,7 +14,7 @@ public class Command_opme extends TFM_Command
{ {
TFM_Util.adminAction(sender.getName(), "Opping " + sender.getName(), false); TFM_Util.adminAction(sender.getName(), "Opping " + sender.getName(), false);
sender.setOp(true); sender.setOp(true);
sender.sendMessage(TotalFreedomMod.YOU_ARE_OP); sender.sendMessage(TFM_Command.YOU_ARE_OP);
return true; return true;
} }

View File

@ -2,7 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -44,7 +43,7 @@ public class Command_ops extends TFM_Command
{ {
if (!TFM_AdminList.isSuperAdmin(sender)) if (!TFM_AdminList.isSuperAdmin(sender))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
@ -55,7 +54,7 @@ public class Command_ops extends TFM_Command
player.setOp(false); player.setOp(false);
if (player.isOnline()) if (player.isOnline())
{ {
playerMsg(player.getPlayer(), TotalFreedomMod.YOU_ARE_NOT_OP); playerMsg(player.getPlayer(), TFM_Command.YOU_ARE_NOT_OP);
} }
} }
return true; return true;

View File

@ -2,7 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -27,7 +26,7 @@ public class Command_orbit extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND, ChatColor.RED); playerMsg(TFM_Command.PLAYER_NOT_FOUND, ChatColor.RED);
return true; return true;
} }

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_PermbanList; import me.StevenLawson.TotalFreedomMod.TFM_PermbanList;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -28,7 +27,7 @@ public class Command_permban extends TFM_Command
{ {
if (!senderIsConsole) if (!senderIsConsole)
{ {
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); sender.sendMessage(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
playerMsg("Reloading permban list...", ChatColor.RED); playerMsg("Reloading permban list...", ChatColor.RED);

View File

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -40,7 +39,7 @@ public class Command_potion extends TFM_Command
{ {
if (!(TFM_AdminList.isSuperAdmin(sender) || senderIsConsole)) if (!(TFM_AdminList.isSuperAdmin(sender) || senderIsConsole))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
TFM_Util.adminAction(sender.getName(), "Cleared all potion effects from all players", true); TFM_Util.adminAction(sender.getName(), "Cleared all potion effects from all players", true);
@ -62,7 +61,7 @@ public class Command_potion extends TFM_Command
if (target == null) if (target == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND, ChatColor.RED); playerMsg(TFM_Command.PLAYER_NOT_FOUND, ChatColor.RED);
return true; return true;
} }
} }
@ -106,7 +105,7 @@ public class Command_potion extends TFM_Command
if (target == null) if (target == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND, ChatColor.RED); playerMsg(TFM_Command.PLAYER_NOT_FOUND, ChatColor.RED);
return true; return true;
} }
} }

View File

@ -3,7 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -38,7 +37,7 @@ public class Command_qdeop extends TFM_Command
{ {
matchedPlayerNames.add(player.getName()); matchedPlayerNames.add(player.getName());
player.setOp(false); player.setOp(false);
player.sendMessage(TotalFreedomMod.YOU_ARE_NOT_OP); player.sendMessage(TFM_Command.YOU_ARE_NOT_OP);
} }
} }
} }

View File

@ -3,7 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -38,7 +37,7 @@ public class Command_qop extends TFM_Command
{ {
matchedPlayerNames.add(player.getName()); matchedPlayerNames.add(player.getName());
player.setOp(true); player.setOp(true);
player.sendMessage(TotalFreedomMod.YOU_ARE_OP); player.sendMessage(TFM_Command.YOU_ARE_OP);
} }
} }
} }

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerRank; import me.StevenLawson.TotalFreedomMod.TFM_PlayerRank;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -38,11 +37,10 @@ public class Command_rank extends TFM_Command
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }
playerMsg(player.getName() + " is " + TFM_PlayerRank.fromSender(player).getLoginMessage(), ChatColor.AQUA); playerMsg(player.getName() + " is " + TFM_PlayerRank.fromSender(player).getLoginMessage(), ChatColor.AQUA);
return true; return true;

View File

@ -3,7 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
@ -71,7 +70,7 @@ public class Command_ro extends TFM_Command
targetPlayer = getPlayer(args[2]); targetPlayer = getPlayer(args[2]);
if (targetPlayer == null) if (targetPlayer == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND); playerMsg(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }
} }

View File

@ -85,7 +85,6 @@ public class Command_rollback extends TFM_Command
{ {
String playerName = null; String playerName = null;
final Player player = getPlayer(playerNameInput); final Player player = getPlayer(playerNameInput);
if (player != null) if (player != null)
{ {

View File

@ -6,7 +6,6 @@ import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
import me.StevenLawson.TotalFreedomMod.TFM_TwitterHandler; import me.StevenLawson.TotalFreedomMod.TFM_TwitterHandler;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
@ -39,7 +38,7 @@ public class Command_saconfig extends TFM_Command
{ {
if (!TFM_AdminList.isSeniorAdmin(sender, true)) if (!TFM_AdminList.isSeniorAdmin(sender, true))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
@ -53,7 +52,7 @@ public class Command_saconfig extends TFM_Command
// All commands below are superadmin+ commands. // All commands below are superadmin+ commands.
if (!TFM_AdminList.isSuperAdmin(sender)) if (!TFM_AdminList.isSuperAdmin(sender))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
@ -61,7 +60,7 @@ public class Command_saconfig extends TFM_Command
{ {
if (senderIsConsole) if (senderIsConsole)
{ {
playerMsg(TotalFreedomMod.NOT_FROM_CONSOLE); playerMsg(TFM_Command.NOT_FROM_CONSOLE);
return true; return true;
} }
@ -157,7 +156,7 @@ public class Command_saconfig extends TFM_Command
if (superadmin == null) if (superadmin == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND); playerMsg(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }
@ -185,7 +184,7 @@ public class Command_saconfig extends TFM_Command
{ {
if (!TFM_AdminList.isSeniorAdmin(sender)) if (!TFM_AdminList.isSeniorAdmin(sender))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }

View File

@ -1,7 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands; package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.Location; import org.bukkit.Location;
@ -26,7 +25,7 @@ public class Command_smite extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND); playerMsg(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -102,7 +102,7 @@ public class Command_stfu extends TFM_Command
if (player == null) if (player == null)
{ {
sender.sendMessage(TotalFreedomMod.PLAYER_NOT_FOUND); sender.sendMessage(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -2,7 +2,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.GameMode; import org.bukkit.GameMode;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -36,7 +35,7 @@ public class Command_survival extends TFM_Command
{ {
if (!TFM_AdminList.isSuperAdmin(sender) || senderIsConsole) if (!TFM_AdminList.isSuperAdmin(sender) || senderIsConsole)
{ {
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); sender.sendMessage(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
@ -55,7 +54,7 @@ public class Command_survival extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND); playerMsg(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }
} }

View File

@ -5,7 +5,6 @@ import java.util.List;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerData; import me.StevenLawson.TotalFreedomMod.TFM_PlayerData;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -45,7 +44,7 @@ public class Command_tag extends TFM_Command
{ {
if (!TFM_AdminList.isSuperAdmin(sender)) if (!TFM_AdminList.isSuperAdmin(sender))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
@ -91,7 +90,7 @@ public class Command_tag extends TFM_Command
{ {
if (!TFM_AdminList.isSuperAdmin(sender)) if (!TFM_AdminList.isSuperAdmin(sender))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
@ -99,7 +98,7 @@ public class Command_tag extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND); playerMsg(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }

View File

@ -2,9 +2,7 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_Ban; import me.StevenLawson.TotalFreedomMod.TFM_Ban;
import me.StevenLawson.TotalFreedomMod.TFM_BanManager; import me.StevenLawson.TotalFreedomMod.TFM_BanManager;
import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Location; import org.bukkit.Location;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -27,11 +25,10 @@ public class Command_tban extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND, ChatColor.RED); playerMsg(TFM_Command.PLAYER_NOT_FOUND, ChatColor.RED);
return true; return true;
} }
// strike with lightning effect: // strike with lightning effect:
final Location targetPos = player.getLocation(); final Location targetPos = player.getLocation();
for (int x = -1; x <= 1; x++) for (int x = -1; x <= 1; x++)

View File

@ -31,7 +31,7 @@ public class Command_tempban extends TFM_Command
if (player == null) if (player == null)
{ {
playerMsg(TotalFreedomMod.PLAYER_NOT_FOUND); playerMsg(TFM_Command.PLAYER_NOT_FOUND);
return true; return true;
} }
@ -55,7 +55,6 @@ public class Command_tempban extends TFM_Command
message.append(", Reason: \"").append(reason).append("\""); message.append(", Reason: \"").append(reason).append("\"");
} }
// strike with lightning effect: // strike with lightning effect:
final Location targetPos = player.getLocation(); final Location targetPos = player.getLocation();
for (int x = -1; x <= 1; x++) for (int x = -1; x <= 1; x++)
@ -72,7 +71,6 @@ public class Command_tempban extends TFM_Command
TFM_BanManager.addIpBan(new TFM_Ban(TFM_Util.getIp(player), player.getName(), sender.getName(), expires, reason)); TFM_BanManager.addIpBan(new TFM_Ban(TFM_Util.getIp(player), player.getName(), sender.getName(), expires, reason));
TFM_BanManager.addUuidBan(new TFM_Ban(TFM_Util.getUuid(player), player.getName(), sender.getName(), expires, reason)); TFM_BanManager.addUuidBan(new TFM_Ban(TFM_Util.getUuid(player), player.getName(), sender.getName(), expires, reason));
player.kickPlayer(sender.getName() + " - " + message.toString()); player.kickPlayer(sender.getName() + " - " + message.toString());
return true; return true;

View File

@ -33,7 +33,7 @@ public class Command_tfm extends TFM_Command
if (!TFM_AdminList.isSuperAdmin(sender)) if (!TFM_AdminList.isSuperAdmin(sender))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }

View File

@ -3,7 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import java.io.File; import java.io.File;
import me.StevenLawson.TotalFreedomMod.TFM_Log; import me.StevenLawson.TotalFreedomMod.TFM_Log;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
@ -28,7 +27,7 @@ public class Command_tfupdate extends TFM_Command
if (!sender.getName().equalsIgnoreCase("madgeek1450")) if (!sender.getName().equalsIgnoreCase("madgeek1450"))
{ {
playerMsg(TotalFreedomMod.MSG_NO_PERMS); playerMsg(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }

View File

@ -3,7 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.Config.TFM_ConfigEntry; import me.StevenLawson.TotalFreedomMod.Config.TFM_ConfigEntry;
import me.StevenLawson.TotalFreedomMod.TFM_TwitterHandler; import me.StevenLawson.TotalFreedomMod.TFM_TwitterHandler;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -113,7 +112,7 @@ public class Command_twitter extends TFM_Command
{ {
if (!sender.getName().equalsIgnoreCase("DarthSalamon")) if (!sender.getName().equalsIgnoreCase("DarthSalamon"))
{ {
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); sender.sendMessage(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }

View File

@ -109,7 +109,6 @@ public class Command_uuid extends TFM_Command
} }
return false; return false;
} }

View File

@ -3,7 +3,6 @@ package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface; import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface;
import me.StevenLawson.TotalFreedomMod.TFM_AdminList; import me.StevenLawson.TotalFreedomMod.TFM_AdminList;
import me.StevenLawson.TotalFreedomMod.TFM_Util; import me.StevenLawson.TotalFreedomMod.TFM_Util;
import me.StevenLawson.TotalFreedomMod.TotalFreedomMod;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -58,7 +57,7 @@ public class Command_whitelist extends TFM_Command
// all commands past this line are superadmin-only // all commands past this line are superadmin-only
if (!(senderIsConsole || TFM_AdminList.isSuperAdmin(sender))) if (!(senderIsConsole || TFM_AdminList.isSuperAdmin(sender)))
{ {
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); sender.sendMessage(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }
@ -152,7 +151,7 @@ public class Command_whitelist extends TFM_Command
// all commands past this line are console/telnet only // all commands past this line are console/telnet only
if (!senderIsConsole) if (!senderIsConsole)
{ {
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); sender.sendMessage(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }

View File

@ -13,6 +13,12 @@ import org.bukkit.entity.Player;
public abstract class TFM_Command public abstract class TFM_Command
{ {
public static final String MSG_NO_PERMS = ChatColor.YELLOW + "You do not have permission to use this command.";
public static final String YOU_ARE_OP = ChatColor.YELLOW + "You are now op!";
public static final String YOU_ARE_NOT_OP = ChatColor.YELLOW + "You are no longer op!";
public static final String NOT_FROM_CONSOLE = "This command may not be used from the console.";
public static final String PLAYER_NOT_FOUND = ChatColor.GRAY + "Player not found!";
protected TotalFreedomMod plugin; protected TotalFreedomMod plugin;
protected Server server; protected Server server;
private CommandSender commandSender; private CommandSender commandSender;

View File

@ -40,7 +40,6 @@ public class TFM_CommandHandler
StringUtils.join(args, " ")), true); StringUtils.join(args, " ")), true);
} }
final TFM_Command dispatcher; final TFM_Command dispatcher;
try try
{ {
@ -62,7 +61,7 @@ public class TFM_CommandHandler
if (!dispatcher.senderHasPermission()) if (!dispatcher.senderHasPermission())
{ {
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS); sender.sendMessage(TFM_Command.MSG_NO_PERMS);
return true; return true;
} }

View File

@ -1,6 +1,5 @@
package me.StevenLawson.TotalFreedomMod; package me.StevenLawson.TotalFreedomMod;
import java.io.File;
import java.util.Collections; import java.util.Collections;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
@ -22,7 +21,6 @@ import org.bukkit.OfflinePlayer;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
import org.bukkit.configuration.ConfigurationSection; import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.util.FileUtil;
public class TFM_AdminList public class TFM_AdminList
{ {
@ -136,7 +134,6 @@ public class TFM_AdminList
admin.isSeniorAdmin(), admin.isSeniorAdmin(),
admin.isActivated()); admin.isActivated());
newAdmin.addIps(admin.getIps()); newAdmin.addIps(admin.getIps());
adminList.remove(oldUuid); adminList.remove(oldUuid);
@ -222,7 +219,6 @@ public class TFM_AdminList
telnetUUIDs.add(uuid); telnetUUIDs.add(uuid);
} }
if (admin.isSeniorAdmin()) if (admin.isSeniorAdmin())
{ {
seniorUUIDs.add(uuid); seniorUUIDs.add(uuid);
@ -413,7 +409,6 @@ public class TFM_AdminList
} }
} }
if (!(sender instanceof Player)) if (!(sender instanceof Player))
{ {
return seniorConsoleNames.contains(sender.getName()) return seniorConsoleNames.contains(sender.getName())
@ -443,7 +438,6 @@ public class TFM_AdminList
return true; return true;
} }
if (superIps.contains(TFM_Util.getIp(player))) if (superIps.contains(TFM_Util.getIp(player)))
{ {
return true; return true;

View File

@ -31,8 +31,8 @@ public class TFM_Heartbeat extends BukkitRunnable
{ {
lastRan = System.currentTimeMillis(); lastRan = System.currentTimeMillis();
final boolean doAwayKickCheck = final boolean doAwayKickCheck
TFM_ConfigEntry.AUTOKICK_ENABLED.getBoolean() = TFM_ConfigEntry.AUTOKICK_ENABLED.getBoolean()
&& TFM_EssentialsBridge.isEssentialsEnabled() && TFM_EssentialsBridge.isEssentialsEnabled()
&& ((server.getOnlinePlayers().length / server.getMaxPlayers()) > TFM_ConfigEntry.AUTOKICK_THRESHOLD.getDouble()); && ((server.getOnlinePlayers().length / server.getMaxPlayers()) > TFM_ConfigEntry.AUTOKICK_THRESHOLD.getDouble());

View File

@ -70,7 +70,6 @@ public enum TFM_PlayerRank
return DEVELOPER; return DEVELOPER;
} }
final TFM_Admin entry = TFM_AdminList.getEntry((Player) sender); final TFM_Admin entry = TFM_AdminList.getEntry((Player) sender);
final TFM_PlayerRank rank; final TFM_PlayerRank rank;

View File

@ -1,7 +1,14 @@
package me.StevenLawson.TotalFreedomMod; package me.StevenLawson.TotalFreedomMod;
import me.StevenLawson.TotalFreedomMod.Config.TFM_ConfigEntry; import java.io.File;
import java.io.*; import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.net.URL; import java.net.URL;
import java.nio.channels.Channels; import java.nio.channels.Channels;
@ -10,12 +17,24 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.Set;
import java.util.UUID;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
import me.StevenLawson.TotalFreedomMod.Config.TFM_Config; import me.StevenLawson.TotalFreedomMod.Config.TFM_Config;
import me.StevenLawson.TotalFreedomMod.Config.TFM_ConfigEntry;
import net.minecraft.util.org.apache.commons.io.FileUtils; import net.minecraft.util.org.apache.commons.io.FileUtils;
import net.minecraft.util.org.apache.commons.lang3.StringUtils; import net.minecraft.util.org.apache.commons.lang3.StringUtils;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
@ -260,35 +279,31 @@ public class TFM_Util
return escapedIp.trim().replaceAll("_", "\\."); return escapedIp.trim().replaceAll("_", "\\.");
} }
public static void gotoWorld(CommandSender sender, String targetworld) public static void gotoWorld(Player player, String targetWorld)
{ {
if (sender instanceof Player) if (player == null)
{ {
Player player = (Player) sender; return;
}
if (player.getWorld().getName().equalsIgnoreCase(targetworld)) if (player.getWorld().getName().equalsIgnoreCase(targetWorld))
{
playerMsg(player, "Going to main world.", ChatColor.GRAY);
player.teleport(Bukkit.getWorlds().get(0).getSpawnLocation());
return;
}
for (World world : Bukkit.getWorlds())
{
if (world.getName().equalsIgnoreCase(targetWorld))
{ {
sender.sendMessage(ChatColor.GRAY + "Going to main world."); playerMsg(player, "Going to world: " + targetWorld, ChatColor.GRAY);
player.teleport(Bukkit.getWorlds().get(0).getSpawnLocation()); player.teleport(world.getSpawnLocation());
return; return;
} }
for (World world : Bukkit.getWorlds())
{
if (world.getName().equalsIgnoreCase(targetworld))
{
sender.sendMessage(ChatColor.GRAY + "Going to world: " + targetworld);
player.teleport(world.getSpawnLocation());
return;
}
}
sender.sendMessage(ChatColor.GRAY + "World " + targetworld + " not found.");
}
else
{
sender.sendMessage(TotalFreedomMod.NOT_FROM_CONSOLE);
} }
playerMsg(player, "World " + targetWorld + " not found.", ChatColor.GRAY);
} }
public static String decolorize(String string) public static String decolorize(String string)

View File

@ -14,7 +14,6 @@ import java.util.Properties;
import me.StevenLawson.TotalFreedomMod.Commands.TFM_CommandLoader; import me.StevenLawson.TotalFreedomMod.Commands.TFM_CommandLoader;
import me.StevenLawson.TotalFreedomMod.HTTPD.TFM_HTTPD_Manager; import me.StevenLawson.TotalFreedomMod.HTTPD.TFM_HTTPD_Manager;
import me.StevenLawson.TotalFreedomMod.Listener.*; import me.StevenLawson.TotalFreedomMod.Listener.*;
import org.bukkit.ChatColor;
import org.bukkit.Server; import org.bukkit.Server;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -36,12 +35,6 @@ public class TotalFreedomMod extends JavaPlugin
public static final String PROTECTED_AREA_FILE = "protectedareas.dat"; public static final String PROTECTED_AREA_FILE = "protectedareas.dat";
public static final String SAVED_FLAGS_FILE = "savedflags.dat"; public static final String SAVED_FLAGS_FILE = "savedflags.dat";
// //
public static final String MSG_NO_PERMS = ChatColor.YELLOW + "You do not have permission to use this command.";
public static final String YOU_ARE_OP = ChatColor.YELLOW + "You are now op!";
public static final String YOU_ARE_NOT_OP = ChatColor.YELLOW + "You are no longer op!";
public static final String NOT_FROM_CONSOLE = "This command may not be used from the console.";
public static final String PLAYER_NOT_FOUND = ChatColor.GRAY + "Player not found!";
//
public static String buildNumber = "1"; public static String buildNumber = "1";
public static String buildDate = TotalFreedomMod.buildDate = TFM_Util.dateToString(new Date()); public static String buildDate = TotalFreedomMod.buildDate = TFM_Util.dateToString(new Date());
public static String buildCreator = "Unknown"; public static String buildCreator = "Unknown";

View File

@ -56,4 +56,4 @@ public class CleanroomBlockPopulator extends BlockPopulator
} }
} }
} }
} }

View File

@ -233,4 +233,4 @@ public class CleanroomChunkGenerator extends ChunkGenerator
return new Location(world, 0, world.getHighestBlockYAt(0, 0), 0); return new Location(world, 0, world.getHighestBlockYAt(0, 0), 0);
} }
} }