PolyLib

PolyLib

26M Downloads

S2C Packet types missing on physical server

Linguardium opened this issue ยท 1 comments

commented

https://github.com/CreeperHost/PolyLib/blob/release/1.21.4/common/src/main/java/net/creeperhost/polylib/network/PolyLibNetwork.java#L46-L55

Issue seen on 1.21.1 but exists on all arch versions since 1.20.5

Custom Payload Packet Type must be registered on both sides. It is automatically handled when registering a receiver. Since receivers are only registered on physical client, physical server must call NetworkManager.registerS2CPayloadType. Since this is missing, errors are thrown when attempting to send S2C packets identified in the link above.

[18:51:31] [Server thread/ERROR] [minecraft/ServerPacketListener]: Failed to handle packet net.minecraft.network.protocol.game.ServerboundUseItemPacket@2b94f77, suppressing error
java.lang.NullPointerException: Cannot invoke "net.minecraft.network.protocol.common.custom.CustomPacketPayload$Type.id()" because "type" is null
        at TRANSFORMER/[email protected]/dev.architectury.impl.NetworkAggregator.collectPackets(NetworkAggregator.java:143) ~[architectury-13.0.8-neoforge.jar%23128!/:?] {re:classloading}
        at TRANSFORMER/[email protected]/dev.architectury.impl.NetworkAggregator.collectPackets(NetworkAggregator.java:137) ~[architectury-13.0.8-neoforge.jar%23128!/:?] {re:classloading}
        at TRANSFORMER/[email protected]/dev.architectury.networking.NetworkManager.collectPackets(NetworkManager.java:133) ~[architectury-13.0.8-neoforge.jar%23128!/:?] {re:classloading,pl:runtimedistcleaner:A}
        at TRANSFORMER/[email protected]/dev.architectury.networking.NetworkManager.sendToPlayer(NetworkManager.java:142) ~[architectury-13.0.8-neoforge.jar%23128!/:?] {re:classloading,pl:runtimedistcleaner:A}
        at TRANSFORMER/[email protected]/net.creeperhost.polylib.network.PolyLibNetwork.sendContainerPacketToClient(PolyLibNetwork.java:95) ~[polylib-2100.0.3-build.160-neoforge.jar%23133!/:2100.0.3-build.160] {re:classloading}
commented

Fixed in 0.4.170, Should be live on CurseForge within the next few minutes