diff --git a/src/de/steamwar/bungeecore/BungeeCore.java b/src/de/steamwar/bungeecore/BungeeCore.java
index e319ed6..df18fb2 100644
--- a/src/de/steamwar/bungeecore/BungeeCore.java
+++ b/src/de/steamwar/bungeecore/BungeeCore.java
@@ -24,6 +24,7 @@ import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
import de.steamwar.bungeecore.commands.*;
import de.steamwar.bungeecore.listeners.*;
import de.steamwar.bungeecore.listeners.mods.*;
+import de.steamwar.bungeecore.listeners.ping.PingListener;
import de.steamwar.bungeecore.network.BungeeNetworkHandler;
import de.steamwar.bungeecore.network.NetworkReceiver;
import de.steamwar.bungeecore.sql.*;
@@ -77,6 +78,7 @@ public class BungeeCore extends Plugin {
public void onEnable(){
getProxy().registerChannel("sw:bridge");
getProxy().registerChannel("fabricmodsender:mods");
+ getProxy().registerChannel("nochatreports:sync");
setInstance(this);
MAIN_SERVER = ProxyServer.getInstance().getConfig().getListeners().stream().anyMatch(info -> ((InetSocketAddress) info.getSocketAddress()).getPort() == 25565);
@@ -110,6 +112,7 @@ public class BungeeCore extends Plugin {
new BrandListener();
new Fabric();
new SubserverProtocolFixer();
+ new PingListener();
local = new Node.LocalNode();
//new Node.RemoteNode("lx");
diff --git a/src/de/steamwar/bungeecore/listeners/mods/Forge.java b/src/de/steamwar/bungeecore/listeners/mods/Forge.java
index 6d274e6..94a0fa2 100644
--- a/src/de/steamwar/bungeecore/listeners/mods/Forge.java
+++ b/src/de/steamwar/bungeecore/listeners/mods/Forge.java
@@ -55,11 +55,6 @@ public class Forge extends BasicListener {
initialHandlerCh.setAccessible(true);
}
- @EventHandler
- public void onServerPing(ProxyPingEvent event) {
- event.setResponse(new FMLPing(event.getResponse(), event.getConnection().getVersion()));
- }
-
public static void onServerConnected(LoginEvent event) {
if(event.getConnection().getVersion() < 341) { //1.13+
event.completeIntent(BungeeCore.get());
diff --git a/src/de/steamwar/bungeecore/listeners/ping/PingListener.java b/src/de/steamwar/bungeecore/listeners/ping/PingListener.java
new file mode 100644
index 0000000..a7bbf6e
--- /dev/null
+++ b/src/de/steamwar/bungeecore/listeners/ping/PingListener.java
@@ -0,0 +1,32 @@
+/*
+ This file is a part of the SteamWar software.
+
+ Copyright (C) 2022 SteamWar.de-Serverteam
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU Affero General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see .
+*/
+
+package de.steamwar.bungeecore.listeners.ping;
+
+import de.steamwar.bungeecore.listeners.BasicListener;
+import net.md_5.bungee.api.event.ProxyPingEvent;
+import net.md_5.bungee.event.EventHandler;
+
+public class PingListener extends BasicListener {
+
+ @EventHandler
+ public void onPing(ProxyPingEvent event) {
+ event.setResponse(new SteamWarServerPing(event.getResponse(), event.getConnection().getVersion()));
+ }
+}
diff --git a/src/de/steamwar/bungeecore/listeners/mods/FMLPing.java b/src/de/steamwar/bungeecore/listeners/ping/SteamWarServerPing.java
similarity index 89%
rename from src/de/steamwar/bungeecore/listeners/mods/FMLPing.java
rename to src/de/steamwar/bungeecore/listeners/ping/SteamWarServerPing.java
index a8b5994..76240ac 100644
--- a/src/de/steamwar/bungeecore/listeners/mods/FMLPing.java
+++ b/src/de/steamwar/bungeecore/listeners/ping/SteamWarServerPing.java
@@ -1,7 +1,7 @@
/*
This file is a part of the SteamWar software.
- Copyright (C) 2020 SteamWar.de-Serverteam
+ Copyright (C) 2022 SteamWar.de-Serverteam
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -16,17 +16,21 @@
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see .
*/
-package de.steamwar.bungeecore.listeners.mods;
+
+package de.steamwar.bungeecore.listeners.ping;
import net.md_5.bungee.api.ServerPing;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
-public class FMLPing extends ServerPing {
+public class SteamWarServerPing extends ServerPing {
+ private final boolean preventsChatReports = true;
private final ForgeData forgeData;
- public FMLPing(ServerPing existing, int version) {
+ public SteamWarServerPing(ServerPing existing, int version) {
super(existing.getVersion(), existing.getPlayers(), existing.getDescriptionComponent(), existing.getFaviconObject());
forgeData = new ForgeData(version);
}