From 223ce86e46d1e5a8d2cea525d820bb7b4dc9f23f Mon Sep 17 00:00:00 2001 From: Diogo Correia Date: Wed, 24 Jun 2026 16:59:42 +0200 Subject: [PATCH] fix: explicitly declare parameters of ServerPingRecord constructor Some Spigot forks (e.g., Leaf) add additional constructors with different parameters, which causes the previous naive implementation of getting the first available constructor to fail. --- .../com/comphenix/protocol/wrappers/ping/ServerPingRecord.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/comphenix/protocol/wrappers/ping/ServerPingRecord.java b/src/main/java/com/comphenix/protocol/wrappers/ping/ServerPingRecord.java index 2ccef28c0..7a69ef1a8 100644 --- a/src/main/java/com/comphenix/protocol/wrappers/ping/ServerPingRecord.java +++ b/src/main/java/com/comphenix/protocol/wrappers/ping/ServerPingRecord.java @@ -59,7 +59,7 @@ private static void initialize() { PLAYER_SAMPLE_CLASS = MinecraftReflection.getServerPingPlayerSampleClass(); SERVER_DATA_CLASS = MinecraftReflection.getServerPingServerDataClass(); - PING_CTOR = Accessors.getConstructorAccessor(SERVER_PING.getConstructors()[0]); + PING_CTOR = Accessors.getConstructorAccessor(SERVER_PING, MinecraftReflection.getIChatBaseComponentClass(), Optional.class, Optional.class, Optional.class, boolean.class); DATA_WRAPPER = AutoWrapper.wrap(ServerData.class, SERVER_DATA_CLASS); SAMPLE_WRAPPER = AutoWrapper.wrap(PlayerSample.class, PLAYER_SAMPLE_CLASS);