refactor: make some constant things that are List immutable by using List.of()

This commit is contained in:
ChomeNS
2025-04-23 16:15:17 +07:00
parent c90840265a
commit b1925edf00
7 changed files with 64 additions and 82 deletions

View File

@@ -37,13 +37,11 @@ public class ChomeNSModIntegrationPlugin implements Listener {
private static final SecureRandom RANDOM = new SecureRandom();
public static final List<Class<? extends Packet>> SERVERBOUND_PACKETS = new ArrayList<>();
static {
SERVERBOUND_PACKETS.add(ServerboundSuccessfulHandshakePacket.class);
SERVERBOUND_PACKETS.add(ServerboundRunCoreCommandPacket.class);
SERVERBOUND_PACKETS.add(ServerboundRunCommandPacket.class);
}
public static final List<Class<? extends Packet>> SERVERBOUND_PACKETS = List.of(
ServerboundSuccessfulHandshakePacket.class,
ServerboundRunCoreCommandPacket.class,
ServerboundRunCommandPacket.class
);
private final Bot bot;