File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
src/main/java/net/hypixel/modapi Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 88import net .hypixel .modapi .packet .HypixelPacket ;
99import net .hypixel .modapi .packet .PacketRegistry ;
1010import net .hypixel .modapi .packet .impl .clientbound .*;
11- import net .hypixel .modapi .packet .impl .clientbound .ClientboundHelloPacket ;
1211import net .hypixel .modapi .packet .impl .clientbound .event .ClientboundLocationPacket ;
13- import net .hypixel .modapi .packet .impl .serverbound .*;
12+ import net .hypixel .modapi .packet .impl .serverbound .ServerboundPartyInfoPacket ;
13+ import net .hypixel .modapi .packet .impl .serverbound .ServerboundPingPacket ;
14+ import net .hypixel .modapi .packet .impl .serverbound .ServerboundPlayerInfoPacket ;
15+ import net .hypixel .modapi .packet .impl .serverbound .ServerboundRegisterPacket ;
1416import net .hypixel .modapi .serializer .PacketSerializer ;
1517
1618import java .util .*;
@@ -92,6 +94,11 @@ public void subscribeToEventPacket(Class<? extends EventPacket> packet) {
9294 }
9395
9496 private void sendRegisterPacket (boolean alwaysSendIfNotEmpty ) {
97+ if (packetSender == null ) {
98+ // Allow registering events before the mod has fully initialized
99+ return ;
100+ }
101+
95102 if (lastSubscribedEvents .equals (subscribedEvents ) && !(alwaysSendIfNotEmpty && !subscribedEvents .isEmpty ())) {
96103 return ;
97104 }
You can’t perform that action at this time.
0 commit comments