Skip to content

Commit f56737d

Browse files
committed
fix
1 parent d69c18c commit f56737d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fabric-networking-api-v1/src/client/java/org/sinytra/fabric/networking_api/client/NeoClientCommonNetworking.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)