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 8
8
import net .hypixel .modapi .packet .HypixelPacket ;
9
9
import net .hypixel .modapi .packet .PacketRegistry ;
10
10
import net .hypixel .modapi .packet .impl .clientbound .*;
11
- import net .hypixel .modapi .packet .impl .clientbound .ClientboundHelloPacket ;
12
11
import 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 ;
14
16
import net .hypixel .modapi .serializer .PacketSerializer ;
15
17
16
18
import java .util .*;
@@ -92,6 +94,11 @@ public void subscribeToEventPacket(Class<? extends EventPacket> packet) {
92
94
}
93
95
94
96
private void sendRegisterPacket (boolean alwaysSendIfNotEmpty ) {
97
+ if (packetSender == null ) {
98
+ // Allow registering events before the mod has fully initialized
99
+ return ;
100
+ }
101
+
95
102
if (lastSubscribedEvents .equals (subscribedEvents ) && !(alwaysSendIfNotEmpty && !subscribedEvents .isEmpty ())) {
96
103
return ;
97
104
}
You can’t perform that action at this time.
0 commit comments