Removed {status: }, because it wasn't able to detect a server going

offline.
This commit is contained in:
filoghost 2014-11-10 14:52:40 +01:00
parent 7080dca140
commit 2e0759c3ec
2 changed files with 3 additions and 28 deletions

View File

@ -35,7 +35,7 @@ public class BungeeChannel implements PluginMessageListener {
@Override @Override
public void onPluginMessageReceived(String channel, Player player, byte[] message) { public void onPluginMessageReceived(String channel, Player player, byte[] message) {
if (!channel.equals("BungeeCord") || !channel.equals("RedisBungee")) { if (!channel.equals("BungeeCord") && !channel.equals("RedisBungee")) {
return; return;
} }

View File

@ -22,7 +22,6 @@ public class PlaceholderManager {
private static long elapsedLongTicks; private static long elapsedLongTicks;
private static final Pattern BUNGEE_ONLINE_PATTERN = Pattern.compile("(\\{online:)([^}]+)(\\})"); private static final Pattern BUNGEE_ONLINE_PATTERN = Pattern.compile("(\\{online:)([^}]+)(\\})");
private static final Pattern BUNGEE_STATUS_PATTERN = Pattern.compile("(\\{status:)([^}]+)(\\})");
private static final Pattern ANIMATION_PATTERN = Pattern.compile("(\\{animation:)([^}]+)(\\})"); private static final Pattern ANIMATION_PATTERN = Pattern.compile("(\\{animation:)([^}]+)(\\})");
private static final Pattern WORLD_PATTERN = Pattern.compile("(\\{world:)([^}]+)(\\})"); private static final Pattern WORLD_PATTERN = Pattern.compile("(\\{world:)([^}]+)(\\})");
@ -49,7 +48,6 @@ public class PlaceholderManager {
// Don't create a list if not necessary. // Don't create a list if not necessary.
List<Placeholder> containedPlaceholders = null; List<Placeholder> containedPlaceholders = null;
List<String> bungeeServersOnlinePlayers = null; List<String> bungeeServersOnlinePlayers = null;
List<String> bungeeServersStatuses = null;
List<String> worldsPlayerCount = null; List<String> worldsPlayerCount = null;
Matcher matcher; Matcher matcher;
@ -108,25 +106,6 @@ public class PlaceholderManager {
bungeeServersOnlinePlayers.add(serverName); bungeeServersOnlinePlayers.add(serverName);
} }
// BungeeCord status pattern.
matcher = BUNGEE_STATUS_PATTERN.matcher(customName);
while (matcher.find()) {
if (bungeeServersStatuses == null) {
bungeeServersStatuses = new ArrayList<String>();
}
String serverName = matcher.group(2).trim();
ServerInfoTimer.track(serverName); // Track this server.
// Shorter placeholder without spaces.
customName = customName.replace(matcher.group(), "{status:" + serverName + "}");
// Add it to tracked servers.
bungeeServersStatuses.add(serverName);
}
// Animation pattern. // Animation pattern.
matcher = ANIMATION_PATTERN.matcher(customName); matcher = ANIMATION_PATTERN.matcher(customName);
boolean updateName = false; boolean updateName = false;
@ -152,7 +131,7 @@ public class PlaceholderManager {
} }
} }
if (containedPlaceholders != null || bungeeServersOnlinePlayers != null || bungeeServersStatuses != null || worldsPlayerCount != null) { if (containedPlaceholders != null || bungeeServersOnlinePlayers != null || worldsPlayerCount != null) {
HologramLineData data = new HologramLineData(horse, customName); HologramLineData data = new HologramLineData(horse, customName);
if (containedPlaceholders != null) { if (containedPlaceholders != null) {
@ -163,10 +142,6 @@ public class PlaceholderManager {
data.setBungeeOnlinePlayersToCheck(bungeeServersOnlinePlayers); data.setBungeeOnlinePlayersToCheck(bungeeServersOnlinePlayers);
} }
if (bungeeServersStatuses != null) {
data.setBungeeStatusesToCheck(bungeeServersStatuses);
}
if (worldsPlayerCount != null) { if (worldsPlayerCount != null) {
data.setWorldsCountToCheck(worldsPlayerCount); data.setWorldsCountToCheck(worldsPlayerCount);
} }