From 2e0759c3ec415dbaa429aa9850fa22f03387ea49 Mon Sep 17 00:00:00 2001 From: filoghost Date: Mon, 10 Nov 2014 14:52:40 +0100 Subject: [PATCH] Removed {status: }, because it wasn't able to detect a server going offline. --- .../holograms/bungee/BungeeChannel.java | 2 +- .../placeholders/PlaceholderManager.java | 29 ++----------------- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/HolographicDisplays/src/com/gmail/filoghost/holograms/bungee/BungeeChannel.java b/HolographicDisplays/src/com/gmail/filoghost/holograms/bungee/BungeeChannel.java index 3da8df95..78a6c6b0 100644 --- a/HolographicDisplays/src/com/gmail/filoghost/holograms/bungee/BungeeChannel.java +++ b/HolographicDisplays/src/com/gmail/filoghost/holograms/bungee/BungeeChannel.java @@ -35,7 +35,7 @@ public class BungeeChannel implements PluginMessageListener { @Override public void onPluginMessageReceived(String channel, Player player, byte[] message) { - if (!channel.equals("BungeeCord") || !channel.equals("RedisBungee")) { + if (!channel.equals("BungeeCord") && !channel.equals("RedisBungee")) { return; } diff --git a/HolographicDisplays/src/com/gmail/filoghost/holograms/placeholders/PlaceholderManager.java b/HolographicDisplays/src/com/gmail/filoghost/holograms/placeholders/PlaceholderManager.java index 2553c085..5493610c 100644 --- a/HolographicDisplays/src/com/gmail/filoghost/holograms/placeholders/PlaceholderManager.java +++ b/HolographicDisplays/src/com/gmail/filoghost/holograms/placeholders/PlaceholderManager.java @@ -22,7 +22,6 @@ public class PlaceholderManager { private static long elapsedLongTicks; 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 WORLD_PATTERN = Pattern.compile("(\\{world:)([^}]+)(\\})"); @@ -49,7 +48,6 @@ public class PlaceholderManager { // Don't create a list if not necessary. List containedPlaceholders = null; List bungeeServersOnlinePlayers = null; - List bungeeServersStatuses = null; List worldsPlayerCount = null; Matcher matcher; @@ -106,26 +104,7 @@ public class PlaceholderManager { // Add it to tracked servers. bungeeServersOnlinePlayers.add(serverName); - } - - // BungeeCord status pattern. - matcher = BUNGEE_STATUS_PATTERN.matcher(customName); - while (matcher.find()) { - - if (bungeeServersStatuses == null) { - bungeeServersStatuses = new ArrayList(); - } - - 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. matcher = ANIMATION_PATTERN.matcher(customName); @@ -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); if (containedPlaceholders != null) { @@ -163,10 +142,6 @@ public class PlaceholderManager { data.setBungeeOnlinePlayersToCheck(bungeeServersOnlinePlayers); } - if (bungeeServersStatuses != null) { - data.setBungeeStatusesToCheck(bungeeServersStatuses); - } - if (worldsPlayerCount != null) { data.setWorldsCountToCheck(worldsPlayerCount); }