From dba4a297e295d68980da31264b0069fe9b18a13e Mon Sep 17 00:00:00 2001 From: HacktheTime Date: Thu, 12 Oct 2023 20:17:28 +0200 Subject: preperations to have a common code and different implementations for forge and fabric to ease up maintaining both versions --- .../de/hype/bbsentials/packets/PacketManager.java | 53 ---------------------- 1 file changed, 53 deletions(-) delete mode 100644 src/main/java/de/hype/bbsentials/packets/PacketManager.java (limited to 'src/main/java/de/hype/bbsentials/packets/PacketManager.java') diff --git a/src/main/java/de/hype/bbsentials/packets/PacketManager.java b/src/main/java/de/hype/bbsentials/packets/PacketManager.java deleted file mode 100644 index cda4315..0000000 --- a/src/main/java/de/hype/bbsentials/packets/PacketManager.java +++ /dev/null @@ -1,53 +0,0 @@ -package de.hype.bbsentials.packets; - -import de.hype.bbsentials.communication.BBsentialConnection; -import de.hype.bbsentials.packets.packets.*; - -import java.util.ArrayList; -import java.util.List; - -public class PacketManager { - private static List> packets = new ArrayList<>(); - - public List> getPackets() { - return packets; - } - - // Define a map to store packet classes and their associated actions - BBsentialConnection connection; - - // Method to initialize packet actions - public PacketManager(BBsentialConnection connection) { - this.connection = connection; - initializePacketActions(connection); - } - - public static void initializePacketActions(BBsentialConnection connection) { - packets.add(new Packet<>(BingoChatMessagePacket.class, connection::onBingoChatMessagePacket)); - packets.add(new Packet<>(BroadcastMessagePacket.class, connection::onBroadcastMessagePacket)); - packets.add(new Packet<>(ChChestPacket.class, connection::onChChestPacket)); - packets.add(new Packet<>(DisconnectPacket.class, connection::onDisconnectPacket)); - packets.add(new Packet<>(DisplayTellrawMessagePacket.class, connection::onDisplayTellrawMessagePacket)); - packets.add(new Packet<>(InternalCommandPacket.class, connection::onInternalCommandPacket)); - packets.add(new Packet<>(InvalidCommandFeedbackPacket.class, connection::onInvalidCommandFeedbackPacket)); - packets.add(new Packet<>(MiningEventPacket.class, connection::onMiningEventPacket)); - packets.add(new Packet<>(PartyPacket.class, connection::onPartyPacket)); -// packets.add(new Packet<>(RequestConnectPacket.class, connection::dummy)); - packets.add(new Packet<>(SplashNotifyPacket.class, connection::onSplashNotifyPacket)); - packets.add(new Packet<>(SystemMessagePacket.class, connection::onSystemMessagePacket)); - packets.add(new Packet<>(WelcomeClientPacket.class, connection::onWelcomePacket)); - } - - // Method to handle a received packet - - - // method to get a list of all packets - public static List> getAllPacketClasses() { - initializePacketActions(null); - List> allPackets = new ArrayList<>(); - for (int i = 0; i < allPackets.size(); i++) { - allPackets.add(packets.get(i).getClazz()); - } - return allPackets; - } -} -- cgit