Replace more PacketType#prepare usage
Also mark methods as internal
This commit is contained in:
4 files changed
+8
-9
No files matched your search
+5
@@ -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;
|
||||
}
|
||||
|
||||
+1
-3
@@ -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;
|
||||
}
|
||||
|
||||
+1
-3
@@ -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();
|
||||
|
||||
+1
-3
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user