Skip to content

Conversation

@connorslade
Copy link

@connorslade connorslade commented May 30, 2025

For some reason, after updating the game version when using the paper plugin, the calls to ItemStack.OPTIONAL_STREAM_CODEC.decode were failing. I can't find what seams to be causing this, so I just reverted to the previous manual implementation for readItem and writeItem.

The Error

java.lang.IllegalArgumentException: No value with id 15200
	at knot//net.minecraft.core.IdMap.byIdOrThrow(IdMap.java:19)
	at knot//net.minecraft.network.codec.ByteBufCodecs$27.decode(ByteBufCodecs.java:561)
	at knot//net.minecraft.network.codec.ByteBufCodecs$27.decode(ByteBufCodecs.java:553)
	at knot//net.minecraft.world.item.ItemStack$1.decode(ItemStack.java:160)
	at knot//net.minecraft.world.item.ItemStack$1.decode(ItemStack.java:152)
	at knot//net.minecraft.world.item.ItemStack$2.decode(ItemStack.java:182)
	at knot//net.minecraft.world.item.ItemStack$2.decode(ItemStack.java:179)
	at knot//com.hpfxd.spectatorplus.fabric.sync.CustomPacketCodecs.readItem(CustomPacketCodecs.java:50)
	at knot//com.hpfxd.spectatorplus.fabric.sync.CustomPacketCodecs.readItems(CustomPacketCodecs.java:24)
	at knot//com.hpfxd.spectatorplus.fabric.sync.packet.ClientboundHotbarSyncPacket.<init>(ClientboundHotbarSyncPacket.java:35)
	at knot//net.minecraft.network.codec.StreamCodec$2.decode(StreamCodec.java:40)
	at knot//net.minecraft.network.protocol.common.custom.CustomPacketPayload$1.decode(CustomPacketPayload.java:63)
	at knot//net.minecraft.network.protocol.common.custom.CustomPacketPayload$1.decode(CustomPacketPayload.java:39)
	at knot//net.minecraft.network.codec.StreamCodec$4.decode(StreamCodec.java:79)
	at knot//net.minecraft.network.codec.StreamCodec$5.decode(StreamCodec.java:94)
	at knot//net.minecraft.network.codec.StreamCodec$5.decode(StreamCodec.java:90)
	at knot//net.minecraft.network.codec.IdDispatchCodec.decode(IdDispatchCodec.java:36)
	at knot//net.minecraft.network.codec.IdDispatchCodec.decode(IdDispatchCodec.java:14)
	at knot//net.minecraft.network.PacketDecoder.decode(PacketDecoder.java:33)
	at knot//io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:530)
	at knot//io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:469)
	at knot//io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at knot//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at knot//io.netty.handler.flow.FlowControlHandler.dequeue(FlowControlHandler.java:202)
	at knot//io.netty.handler.flow.FlowControlHandler.channelRead(FlowControlHandler.java:164)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at knot//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at knot//io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
	at knot//io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at knot//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at knot//io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
	at knot//io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:333)
	at knot//io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:455)
	at knot//io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:290)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at knot//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at knot//io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:289)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at knot//io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
	at knot//io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
	at knot//io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
	at knot//io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
	at knot//io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:799)
	at knot//io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:501)
	at knot//io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:399)
	at knot//io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:998)
	at knot//io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
	at java.base/java.lang.Thread.run(Thread.java:1583)

After trying the previous release of Minecraft 1.21.4 on a paper server with the plugin installed, the same function is failing. I guess this is the bug mentioned in #16 and #18? I'm very confused, but everything seams to be working after the reversion.

@JonDeschenes
Copy link

Hello connorslade,

Would you mind adding a link to download your version? I'm not really good with github, compiling, etc.

tyvm :D

@connorslade
Copy link
Author

Yeah sure. Just made releases for Minecraft 1.21.5-1.21.7 at https://github.com/connorslade/SpectatorPlus/releases.

@JonDeschenes
Copy link

Hello, thank you again for updating this plugin/mod ! I was wondering if you could update it to 1.21.8 and 1.21 9? And the spectator does not follow if the player he spectate change dimension! And I think we had some config we could change in the mod in the menu but now we do not have!

Thank you again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants