Changed colors to match the forums

This commit is contained in:
unknown 2013-12-01 18:54:50 +01:00
parent 808e02f660
commit 7140e4c8df
4 changed files with 75 additions and 57 deletions

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Sun Dec 01 18:16:33 CET 2013 #Sun Dec 01 18:54:19 CET 2013
build.number=650 build.number=657

View File

@ -63,41 +63,60 @@ public class Command_list extends TFM_Command
final StringBuilder prefix = new StringBuilder(); final StringBuilder prefix = new StringBuilder();
if (TFM_Util.DEVELOPERS.contains(player.getName()))
{
prefix.append(ChatColor.DARK_PURPLE).append("[Dev]");
names.add(prefix.append(player.getName()).toString());
continue;
}
if (userSuperadmin) if (userSuperadmin)
{ {
TFM_Superadmin entry = TFM_SuperadminList.getAdminEntry(player.getName()); TFM_Superadmin entry = TFM_SuperadminList.getAdminEntry(player.getName());
if (player.getName().equals("markbyron"))
{
prefix.append(ChatColor.DARK_RED).append("[Owner]");
names.add(prefix.append(player.getName()).toString());
continue;
}
if (entry == null) if (entry == null)
{ {
prefix.append(ChatColor.GOLD).append("[SA]"); entry = TFM_SuperadminList.getAdminEntryByIP(player.getAddress().getAddress().getHostAddress().trim());
if (entry == null)
{
prefix.append(ChatColor.AQUA).append("[SA]");
names.add(prefix.append(player.getName()).toString());
continue;
}
} }
else if (entry.isSeniorAdmin())
if (entry.isSeniorAdmin())
{ {
prefix.append(ChatColor.LIGHT_PURPLE).append("[SrA]"); prefix.append(ChatColor.GOLD).append("[SrA]");
} }
else if (entry.isTelnetAdmin()) else if (entry.isTelnetAdmin())
{ {
prefix.append(ChatColor.DARK_GREEN).append("[STA]"); prefix.append(ChatColor.DARK_GREEN).append("[STA]");
} }
else
if (TFM_Util.DEVELOPERS.contains(player.getName()))
{ {
prefix.append(ChatColor.DARK_PURPLE).append("[Dev]"); prefix.append(ChatColor.AQUA).append("[SA]");
}
if (player.getName().equals("markbyron"))
{
prefix.append(ChatColor.BLUE).append("[Owner]");
} }
} }
else else
{ {
if (player.isOp()) if (player.isOp())
{ {
prefix.append(ChatColor.RED).append("[OP]"); prefix.append(ChatColor.BLUE).append("[OP]");
}
else
{
prefix.append(ChatColor.GREEN);
} }
} }
names.add(prefix.append(player.getName()).toString()); names.add(prefix.append(player.getName()).toString());
} }

View File

@ -26,39 +26,37 @@ public class TFM_ServerListener implements Listener
// Comment this method out if you want to compile this without a custom CraftBukkit. // Comment this method out if you want to compile this without a custom CraftBukkit.
// Just make sure that enable-command-block=false in server.properties. // Just make sure that enable-command-block=false in server.properties.
// -Madgeek // -Madgeek
/* Temporary: Until we get a custom CB build out /* Temporary: Until we get a custom CB build out
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)
public void onCommandBlockSet(org.bukkit.event.server.CommandBlockSetEvent event) public void onCommandBlockSet(org.bukkit.event.server.CommandBlockSetEvent event)
{ {
Player player = event.getPlayer(); Player player = event.getPlayer();
String newCommandRaw = event.getNewCommand(); String newCommandRaw = event.getNewCommand();
if (!TFM_SuperadminList.isSeniorAdmin(player, true)) if (!TFM_SuperadminList.isSeniorAdmin(player, true))
{ {
player.sendMessage(ChatColor.GRAY + "Only senior admins may set command block commands."); player.sendMessage(ChatColor.GRAY + "Only senior admins may set command block commands.");
event.setCancelled(true); event.setCancelled(true);
return; return;
} }
Matcher matcher = Pattern.compile("^/?(\\S+)").matcher(newCommandRaw); Matcher matcher = Pattern.compile("^/?(\\S+)").matcher(newCommandRaw);
if (matcher.find()) if (matcher.find())
{ {
String topLevelCommand = matcher.group(1); String topLevelCommand = matcher.group(1);
if (topLevelCommand != null) if (topLevelCommand != null)
{ {
topLevelCommand = topLevelCommand.toLowerCase().trim(); topLevelCommand = topLevelCommand.toLowerCase().trim();
// We need to make it look like the command is coming from the console, so keep the player's name without the Player instance via dummy:
if (TFM_CommandBlocker.getInstance().isCommandBlocked(topLevelCommand, new TFM_ServerListener_DummyCommandSender(player.getName()), false))
{
player.sendMessage(ChatColor.GRAY + "That command is blocked.");
event.setCancelled(true);
}
}
}
}*/
// We need to make it look like the command is coming from the console, so keep the player's name without the Player instance via dummy:
if (TFM_CommandBlocker.getInstance().isCommandBlocked(topLevelCommand, new TFM_ServerListener_DummyCommandSender(player.getName()), false))
{
player.sendMessage(ChatColor.GRAY + "That command is blocked.");
event.setCancelled(true);
}
}
}
}*/
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.NORMAL)
public void onRemoteServerCommand(RemoteServerCommandEvent event) public void onRemoteServerCommand(RemoteServerCommandEvent event)
{ {

View File

@ -437,7 +437,7 @@ public class TFM_Util
if (entry.isSeniorAdmin()) if (entry.isSeniorAdmin())
{ {
return "a " + ChatColor.LIGHT_PURPLE + "Senior Admin" + ChatColor.AQUA + "."; return "a " + ChatColor.GOLD + "Senior Admin" + ChatColor.AQUA + ".";
} }
else if (entry.isTelnetAdmin()) else if (entry.isTelnetAdmin())
{ {
@ -445,13 +445,13 @@ public class TFM_Util
} }
else else
{ {
return "a " + ChatColor.GOLD + "Super Admin" + ChatColor.AQUA + "."; return "a " + ChatColor.AQUA + "Super Admin" + ChatColor.AQUA + ".";
} }
} }
if (sender.isOp()) if (sender.isOp())
{ {
return "an " + ChatColor.DARK_GREEN + "OP" + ChatColor.AQUA + "."; return "an " + ChatColor.BLUE + "OP" + ChatColor.AQUA + ".";
} }
return "a " + ChatColor.GREEN + "non-OP" + ChatColor.AQUA + "."; return "a " + ChatColor.GREEN + "non-OP" + ChatColor.AQUA + ".";
@ -791,14 +791,14 @@ public class TFM_Util
else else
{ {
final TFM_Superadmin entry = TFM_SuperadminList.getAdminEntry(sender.getName()); final TFM_Superadmin entry = TFM_SuperadminList.getAdminEntry(sender.getName());
if (entry == null) { if (entry == null)
return "";
}
if (entry.isSeniorAdmin())
{ {
prefix = ChatColor.LIGHT_PURPLE + "(SrA)"; return ChatColor.AQUA + "(SA)";
}
else if (entry.isSeniorAdmin())
{
prefix = ChatColor.GOLD + "(SrA)";
} }
else if (entry.isTelnetAdmin()) else if (entry.isTelnetAdmin())
{ {
@ -806,14 +806,15 @@ public class TFM_Util
} }
else else
{ {
prefix = ChatColor.GOLD + "(SA)"; prefix = ChatColor.AQUA + "(SA)";
} }
if (DEVELOPERS.contains(sender.getName())) if (DEVELOPERS.contains(sender.getName()))
{ {
prefix = ChatColor.DARK_PURPLE + "(Dev)"; prefix = ChatColor.DARK_PURPLE + "(Dev)";
} }
} }
return prefix + ChatColor.WHITE; return prefix + ChatColor.WHITE;
} }