@@ -17,19 +17,19 @@ public static void onRegisterPacket(ICommonPacketListener listener, Set<Resource
1717 ConnectionProtocol protocol = listener .protocol ();
1818 List <ResourceLocation > listIds = List .copyOf (ids );
1919 if (protocol == ConnectionProtocol .CONFIGURATION ) {
20- listener .getMainThreadEventLoop ().execute (() -> C2SConfigurationChannelEvents .REGISTER .invoker ().onChannelRegister ((ClientConfigurationPacketListenerImpl ) listener , new NeoClientPacketSender (listener .getConnection ()), Minecraft .getInstance (), listIds ));
20+ listener .getPacketProcessor ().scheduleIfPossible (() -> C2SConfigurationChannelEvents .REGISTER .invoker ().onChannelRegister ((ClientConfigurationPacketListenerImpl ) listener , new NeoClientPacketSender (listener .getConnection ()), Minecraft .getInstance (), listIds ));
2121 } else if (protocol == ConnectionProtocol .PLAY ) {
22- listener .getMainThreadEventLoop ().execute (() -> C2SPlayChannelEvents .REGISTER .invoker ().onChannelRegister ((ClientPacketListener ) listener , new NeoClientPacketSender (listener .getConnection ()), Minecraft .getInstance (), listIds ));
22+ listener .getPacketProcessor ().scheduleIfPossible (() -> C2SPlayChannelEvents .REGISTER .invoker ().onChannelRegister ((ClientPacketListener ) listener , new NeoClientPacketSender (listener .getConnection ()), Minecraft .getInstance (), listIds ));
2323 }
2424 }
2525
2626 public static void onUnregisterPacket (ICommonPacketListener listener , Set <ResourceLocation > ids ) {
2727 ConnectionProtocol protocol = listener .protocol ();
2828 List <ResourceLocation > listIds = List .copyOf (ids );
2929 if (protocol == ConnectionProtocol .CONFIGURATION ) {
30- listener .getMainThreadEventLoop ().execute (() -> C2SConfigurationChannelEvents .UNREGISTER .invoker ().onChannelUnregister ((ClientConfigurationPacketListenerImpl ) listener , new NeoClientPacketSender (listener .getConnection ()), Minecraft .getInstance (), listIds ));
30+ listener .getPacketProcessor ().scheduleIfPossible (() -> C2SConfigurationChannelEvents .UNREGISTER .invoker ().onChannelUnregister ((ClientConfigurationPacketListenerImpl ) listener , new NeoClientPacketSender (listener .getConnection ()), Minecraft .getInstance (), listIds ));
3131 } else if (protocol == ConnectionProtocol .PLAY ) {
32- listener .getMainThreadEventLoop ().execute (() -> C2SPlayChannelEvents .UNREGISTER .invoker ().onChannelUnregister ((ClientPacketListener ) listener , new NeoClientPacketSender (listener .getConnection ()), Minecraft .getInstance (), listIds ));
32+ listener .getPacketProcessor ().scheduleIfPossible (() -> C2SPlayChannelEvents .UNREGISTER .invoker ().onChannelUnregister ((ClientPacketListener ) listener , new NeoClientPacketSender (listener .getConnection ()), Minecraft .getInstance (), listIds ));
3333 }
3434 }
3535}
0 commit comments