Remove custom server ping code

This commit is contained in:
mathiascode 2021-01-07 09:29:55 +02:00
parent 317d930731
commit 2c1cf457a3
3 changed files with 1 additions and 22 deletions

View file

@ -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);
}

View file

@ -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");
}
}

View file

@ -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