mirror of
https://github.com/filoghost/HolographicDisplays.git
synced 2025-01-01 21:57:36 +01:00
Removed {status: }, because it wasn't able to detect a server going
offline.
This commit is contained in:
parent
7080dca140
commit
2e0759c3ec
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
|
||||||
@ -106,26 +104,7 @@ public class PlaceholderManager {
|
|||||||
|
|
||||||
// Add it to tracked servers.
|
// Add it to tracked servers.
|
||||||
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);
|
||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user