Re-setup the packet handlers

This commit is contained in:
libraryaddict 2024-07-02 03:03:46 +12:00
parent ccd1c147d2
commit 421702797a
2 changed files with 6 additions and 1 deletions

View File

@ -24,6 +24,7 @@ import org.bukkit.entity.Entity;
import org.bukkit.entity.Player;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
@ -36,7 +37,9 @@ public class PacketsHandler {
registerPacketHandlers();
}
private void registerPacketHandlers() {
public void registerPacketHandlers() {
Arrays.fill(packetHandlers, null);
List<IPacketHandler> packetHandlers = new ArrayList<>();
packetHandlers.add(new PacketHandlerAttributes());

View File

@ -136,6 +136,8 @@ public class PacketsManager {
PacketEvents.getAPI().getEventManager().unregisterListener(mainListener);
}
getPacketsHandler().registerPacketHandlers();
ArrayList<Server> packetsToListen = new ArrayList<>();
// Add spawn packets