Replace more PacketType#prepare usage

Also mark methods as internal
This commit is contained in:
booky committed 2026-01-04 22:59:14 +01:00
1 parent fbb80124db
commit 84b3392e9a
4 files changed
+8 -9

No files matched your search

@@ -438,6 +438,10 @@ public final class PacketType {
ClientVersion.V_1_21_6,
ClientVersion.V_1_21_9);
private PacketType() {
}
@ApiStatus.Internal
public static void prepare() {
if (PREPARED) {
return;
@@ -457,6 +461,7 @@ public final class PacketType {
}
}
@ApiStatus.Internal
public static boolean isPrepared() {
return PREPARED;
}
@@ -97,9 +97,7 @@ public class TestPacketEventsBuilder {
PacketEvents.SERVER_CHANNEL_HANDLER_NAME = "pe-connection-initializer-" + id;
PacketEvents.TIMEOUT_HANDLER_NAME = "pe-timeout-handler-" + id;
if (!PacketType.isPrepared()) {
PacketType.prepare();
}
PacketType.prepare();
loaded = true;
}
@@ -114,9 +114,7 @@ public class SpigotPacketEventsBuilder {
throw new IllegalStateException(ex);
}
if (!PacketType.isPrepared()) {
PacketType.prepare();
}
PacketType.prepare();
//Server hasn't bound to the port yet.
lateBind = !injector.isServerBound();
@@ -106,9 +106,7 @@ public class SpongePacketEventsBuilder {
throw new IllegalStateException(ex);
}
if (!PacketType.isPrepared()) {
PacketType.prepare();
}
PacketType.prepare();
// Server hasn't bound to the port yet.
lateBind = !injector.isServerBound();