diff --git a/Main Plugin/pom.xml b/Main Plugin/pom.xml
index 277f528..84fdfa8 100644
--- a/Main Plugin/pom.xml
+++ b/Main Plugin/pom.xml
@@ -11,7 +11,7 @@
PlayerBalancer Plugin
playerbalancer-plugin
- 2.1.5.3
+ 2.1.5.4
PlayerBalancer
@@ -65,13 +65,17 @@
bstats-repo
http://repo.bstats.org/content/repositories/releases/
+
+ codemc-repo
+ https://repo.codemc.org/repository/maven-public/
+
net.md-5
bungeecord-proxy
- local
+ LATEST
provided
diff --git a/Main Plugin/src/main/java/com/jaimemartz/playerbalancer/section/SectionServer.java b/Main Plugin/src/main/java/com/jaimemartz/playerbalancer/section/SectionServer.java
index 6ed7a04..ef81234 100644
--- a/Main Plugin/src/main/java/com/jaimemartz/playerbalancer/section/SectionServer.java
+++ b/Main Plugin/src/main/java/com/jaimemartz/playerbalancer/section/SectionServer.java
@@ -2,12 +2,21 @@ package com.jaimemartz.playerbalancer.section;
import com.jaimemartz.playerbalancer.settings.props.features.BalancerProps;
import net.md_5.bungee.BungeeServerInfo;
+import net.md_5.bungee.api.Callback;
+import net.md_5.bungee.api.ProxyServer;
+import net.md_5.bungee.api.ServerPing;
+import net.md_5.bungee.api.chat.ComponentBuilder;
+import net.md_5.bungee.api.chat.TextComponent;
import net.md_5.bungee.api.config.ServerInfo;
import net.md_5.bungee.api.connection.ProxiedPlayer;
+import javax.xml.soap.Text;
+import java.awt.*;
import java.net.InetSocketAddress;
import java.util.Collection;
import java.util.Collections;
+import java.util.Queue;
+import java.util.function.IntFunction;
import java.util.stream.Collectors;
public class SectionServer extends BungeeServerInfo {
@@ -35,4 +44,45 @@ public class SectionServer extends BungeeServerInfo {
.collect(Collectors.toList());
} else return Collections.emptyList();
}
+
+ @Override
+ public void sendData(String channel, byte[] data) {
+ this.sendData(channel, data, true);
+ }
+
+ @Override
+ public boolean sendData(String channel, byte[] data, boolean queue) {
+ //Nothing to do
+ return true;
+ }
+
+ @Override
+ public void ping(Callback callback) {
+ this.ping(callback, ProxyServer.getInstance().getProtocolVersion());
+ }
+
+ @Override
+ public void ping(Callback callback, int protocolVersion) {
+ ServerPing ping = new ServerPing();
+
+ ping.setDescriptionComponent(new TextComponent(
+ TextComponent.fromLegacyText(this.getMotd())
+ ));
+
+ ping.setVersion(new ServerPing.Protocol(
+ ProxyServer.getInstance().getName(),
+ protocolVersion
+ ));
+
+ Collection players = getPlayers();
+ ping.setPlayers(new ServerPing.Players(
+ Integer.MAX_VALUE,
+ players.size(),
+ players.stream().map(
+ player -> new ServerPing.PlayerInfo(player.getName(), player.getUniqueId())
+ ).toArray(ServerPing.PlayerInfo[]::new)
+ ));
+
+ callback.done(ping, null);
+ }
}