Networking API bug: sendPacket is not cancellable when using PacketSender.sendPacket with futures
filloax opened this issue ยท 3 comments
Tried using the v1 API with custom packets, like this:
sender.sendPacket(FooPacket()) { after() }
using a sender obtained in, for example, ServerPlayConnectionEvents.JOIN, but this error happens:
org.spongepowered.asm.mixin.injection.callback.CancellationException: The call doSendPacket is not cancellable.
at org.spongepowered.asm.mixin.injection.callback.CallbackInfo.cancel(CallbackInfo.java:101) ~[sponge-mixin-0.12.5+mixin.0.8.5.jar:0.12.5+mixin.0.8.5]
at net.minecraft.network.Connection.handler$zdl000$fabric-networking-api-v1$sendInternal(Connection.java:614) ~[minecraft-common-project-root-1.20.1-loom.mappings.1_20_1.layered+hash.498914590-v2.jar:?]
at net.minecraft.network.Connection.doSendPacket(Connection.java:220) ~[minecraft-common-project-root-1.20.1-loom.mappings.1_20_1.layered+hash.498914590-v2.jar:?]
at net.minecraft.network.Connection.method_10761(Connection.java:212) ~[minecraft-common-project-root-1.20.1-loom.mappings.1_20_1.layered+hash.498914590-v2.jar:?]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.82.Final.jar:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.82.Final.jar:?]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.82.Final.jar:?]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[netty-transport-4.1.82.Final.jar:?]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.82.Final.jar:?]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.82.Final.jar:?]
Cause seems to be a fabric API mixin missing a cancellable = true
, in ClientConnectionMixin here:
@modmuss50 I think this affects all versions after 1.19.1, when using sendPacket
that accepts PacketCallbacks
.