Skip to content

Commit 3c05fa7

Browse files
committed
fix NeoClientCommonNetworking, loom.silentMojangMappingsLicense()
1 parent ceb3643 commit 3c05fa7

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ allprojects {
7373
apply(plugin = "java-library")
7474
apply(plugin = "dev.architectury.loom")
7575

76+
loom.silentMojangMappingsLicense()
77+
7678
java {
7779
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
7880
withSourcesJar()

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)