Fixed all deprecated methods

This commit is contained in:
unknown 2013-12-03 16:21:58 +01:00
parent 9a48ec04aa
commit 5cfaf8970d
3 changed files with 7 additions and 18 deletions

View File

@ -1,5 +1,6 @@
package me.StevenLawson.TotalFreedomMod.Commands;
import me.StevenLawson.TotalFreedomMod.TFM_PlayerRank;
import me.StevenLawson.TotalFreedomMod.TFM_Util;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
@ -17,7 +18,7 @@ public class Command_rank extends TFM_Command
{
for (Player player : server.getOnlinePlayers())
{
playerMsg(player.getName() + " is " + TFM_Util.getRank(player));
playerMsg(player.getName() + " is " + TFM_PlayerRank.fromSender(player).getLoginMessage());
}
return true;
}
@ -29,7 +30,7 @@ public class Command_rank extends TFM_Command
if (args.length == 0)
{
playerMsg(sender.getName() + " is " + TFM_Util.getRank(sender), ChatColor.AQUA);
playerMsg(sender.getName() + " is " + TFM_PlayerRank.fromSender(sender).getLoginMessage(), ChatColor.AQUA);
return true;
}
@ -44,7 +45,7 @@ public class Command_rank extends TFM_Command
return true;
}
playerMsg(player.getName() + " is " + TFM_Util.getRank(player), ChatColor.AQUA);
playerMsg(player.getName() + " is " + TFM_PlayerRank.fromSender(player).getLoginMessage(), ChatColor.AQUA);
return true;
}

View File

@ -691,7 +691,7 @@ public class TFM_PlayerListener implements Listener
if (impostor || TFM_SuperadminList.isUserSuperadmin(player))
{
TFM_Util.bcastMsg(ChatColor.AQUA + player.getName() + " is " + TFM_Util.getRank(player));
TFM_Util.bcastMsg(ChatColor.AQUA + player.getName() + " is " + TFM_PlayerRank.fromSender(player).getLoginMessage());
if (impostor)
{
@ -720,7 +720,7 @@ public class TFM_PlayerListener implements Listener
}
else if (TFM_Util.DEVELOPERS.contains(player.getName()))
{
TFM_Util.bcastMsg(ChatColor.AQUA + player.getName() + " is " + TFM_Util.getRank(player));
TFM_Util.bcastMsg(ChatColor.AQUA + player.getName() + " is " + TFM_PlayerRank.fromSender(player).getLoginMessage());
}
if (TFM_ConfigEntry.ADMIN_ONLY_MODE.getBoolean())

View File

@ -415,12 +415,6 @@ public class TFM_Util
}
}
@Deprecated
public static String getRank(CommandSender sender)
{
return TFM_PlayerRank.fromSender(sender).getLoginMessage();
}
public static Date parseDateOffset(String time)
{
Pattern timePattern = Pattern.compile(
@ -733,7 +727,7 @@ public class TFM_Util
public static void adminChatMessage(CommandSender sender, String message, boolean senderIsConsole)
{
String name = sender.getName() + " " + getPrefix(sender, senderIsConsole) + ChatColor.WHITE;
String name = sender.getName() + " " + TFM_PlayerRank.fromSender(sender).getPrefix() + ChatColor.WHITE;
TFM_Log.info("[ADMIN] " + name + ": " + message);
for (Player player : Bukkit.getOnlinePlayers())
@ -745,12 +739,6 @@ public class TFM_Util
}
}
@Deprecated
public static String getPrefix(CommandSender sender, boolean senderIsConsole)
{
return TFM_PlayerRank.fromSender(sender).getPrefix();
}
//getField: Borrowed from WorldEdit
@SuppressWarnings("unchecked")
public static <T> T getField(Object from, String name)