Skip to content

Commit 0e267a5

Browse files
fix: explicitly declare parameters of ServerPingRecord constructor (#3644)
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.
1 parent 2d3b3e3 commit 0e267a5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/main/java/com/comphenix/protocol/wrappers/ping/ServerPingRecord.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ private static void initialize() {
5959
PLAYER_SAMPLE_CLASS = MinecraftReflection.getServerPingPlayerSampleClass();
6060
SERVER_DATA_CLASS = MinecraftReflection.getServerPingServerDataClass();
6161

62-
PING_CTOR = Accessors.getConstructorAccessor(SERVER_PING.getConstructors()[0]);
62+
PING_CTOR = Accessors.getConstructorAccessor(SERVER_PING, MinecraftReflection.getIChatBaseComponentClass(), Optional.class, Optional.class, Optional.class, boolean.class);
6363

6464
DATA_WRAPPER = AutoWrapper.wrap(ServerData.class, SERVER_DATA_CLASS);
6565
SAMPLE_WRAPPER = AutoWrapper.wrap(PlayerSample.class, PLAYER_SAMPLE_CLASS);

0 commit comments

Comments
 (0)