From 2c1cf457a3f591545cc720d49cf5f3da019279a6 Mon Sep 17 00:00:00 2001 From: mathiascode Date: Thu, 7 Jan 2021 09:29:55 +0200 Subject: [PATCH] Remove custom server ping code --- src/main/java/pw/kaboom/extras/Main.java | 2 -- .../extras/modules/server/ServerPing.java | 19 ------------------- src/main/resources/plugin.yml | 2 +- 3 files changed, 1 insertion(+), 22 deletions(-) delete mode 100644 src/main/java/pw/kaboom/extras/modules/server/ServerPing.java diff --git a/src/main/java/pw/kaboom/extras/Main.java b/src/main/java/pw/kaboom/extras/Main.java index 72ad49b..5312661 100644 --- a/src/main/java/pw/kaboom/extras/Main.java +++ b/src/main/java/pw/kaboom/extras/Main.java @@ -41,7 +41,6 @@ import pw.kaboom.extras.modules.player.PlayerInteract; import pw.kaboom.extras.modules.player.PlayerRecipe; import pw.kaboom.extras.modules.player.PlayerTeleport; import pw.kaboom.extras.modules.server.ServerCommand; -import pw.kaboom.extras.modules.server.ServerPing; import pw.kaboom.extras.modules.server.ServerTick; public final class Main extends JavaPlugin { @@ -113,7 +112,6 @@ public final class Main extends JavaPlugin { /* Server-related modules */ this.getServer().getPluginManager().registerEvents(new ServerCommand(), this); - this.getServer().getPluginManager().registerEvents(new ServerPing(), this); this.getServer().getPluginManager().registerEvents(new ServerTick(), this); } diff --git a/src/main/java/pw/kaboom/extras/modules/server/ServerPing.java b/src/main/java/pw/kaboom/extras/modules/server/ServerPing.java deleted file mode 100644 index 055b2dc..0000000 --- a/src/main/java/pw/kaboom/extras/modules/server/ServerPing.java +++ /dev/null @@ -1,19 +0,0 @@ -package pw.kaboom.extras.modules.server; - -import org.bukkit.event.EventHandler; -import org.bukkit.event.Listener; - -import com.destroystokyo.paper.event.server.PaperServerListPingEvent; - -public final class ServerPing implements Listener { - @EventHandler - void onServerListPing(final PaperServerListPingEvent event) { - if (event.getClient().getProtocolVersion() == -1) { - final int protocol = 754; - event.setProtocolVersion(protocol); - } else { - event.setProtocolVersion(event.getClient().getProtocolVersion()); - } - event.setVersion("1.16.4"); - } -} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 76e115b..71aabc4 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ name: Extras main: pw.kaboom.extras.Main description: Plugin that adds extra functionality to the server. -depend: [ProtocolLib] +softdepend: [ProtocolLib] api-version: 1.13 version: master