Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to write item on protocol version 767 #252

Open
ThePitereq opened this issue Jul 30, 2024 · 2 comments
Open

Unable to write item on protocol version 767 #252

ThePitereq opened this issue Jul 30, 2024 · 2 comments

Comments

@ThePitereq
Copy link

Describe the bug
Bug that kicks player from server while trying to enchant items or click while anvil/enchanting table is opened when there are custom enchantments present on server.
Problem doesn't appear on all enchantments, only on certain ones, don't see where the problem is as i have two enchantments where the only difference is the max_level

To Reproduce
Steps to reproduce the behavior:

  1. Install any datapack that contains custom enchantments (I've been using Dungeons and Taverns)
  2. Open enchanting table and try enchant few times.
  3. Click on the output item.
  4. Kicked from server and error appears

Expected behavior
Get an item enchanted without any problems

Screenshots
Error Logs

ThePitereq lost connection: Internal Exception: io.netty.handler.codec.DecoderException: Failed to decode packet 'serverbound/minecraft:container_click'

[Protocolize]: Unable to write item on protocol version 767
java.lang.RuntimeException: Unable to write EnchantmentsComponentImpl of item
at dev.simplix.protocolize.api.item.StructuredItemStackSerializer.writeComponent(StructuredItemStackSerializer.java:96) ~[?:?]
at dev.simplix.protocolize.api.item.StructuredItemStackSerializer.write(StructuredItemStackSerializer.java:73) ~[?:?]
at dev.simplix.protocolize.api.item.ItemStackSerializer.write(ItemStackSerializer.java:201) ~[?:?]
at dev.simplix.protocolize.data.packets.ClickWindow.write(ClickWindow.java:118) ~[?:?]
at dev.simplix.protocolize.velocity.packet.VelocityProtocolizePacket.encode(VelocityProtocolizePacket.java:78) ~[?:?]
at com.velocitypowered.proxy.protocol.netty.MinecraftEncoder.encode(MinecraftEncoder.java:54) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at com.velocitypowered.proxy.protocol.netty.MinecraftEncoder.encode(MinecraftEncoder.java:32) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:875) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:984) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:868) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:893) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:956) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:982) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:950) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1020) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:311) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at com.velocitypowered.proxy.connection.MinecraftConnection.write(MinecraftConnection.java:234) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at com.velocitypowered.proxy.connection.client.ClientPlaySessionHandler.handleGeneric(ClientPlaySessionHandler.java:460) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at com.velocitypowered.proxy.connection.MinecraftConnection.channelRead(MinecraftConnection.java:154) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.tryDecode(MinecraftDecoder.java:91) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at com.velocitypowered.proxy.protocol.netty.MinecraftDecoder.channelRead(MinecraftDecoder.java:60) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:286) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.epoll.AbstractEpollStreamChannel$EpollStreamUnsafe.epollInReady(AbstractEpollStreamChannel.java:800) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.epoll.EpollEventLoop.processReady(EpollEventLoop.java:509) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:407) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) ~[velocity.jar:3.3.0-SNAPSHOT (git-44b1e0c6-b412)]
at java.base/java.lang.Thread.run(Thread.java:840) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "dev.simplix.protocolize.data.Enchantment.name()" because the return value of "java.util.Map$Entry.getKey()" is null
at dev.simplix.protocolize.data.item.component.EnchantmentsComponentImpl.write(EnchantmentsComponentImpl.java:53) ~[?:?]
at dev.simplix.protocolize.api.item.StructuredItemStackSerializer.writeComponent(StructuredItemStackSerializer.java:94) ~[?:?]
... 65 more

Proxy environment
Velocity 3.3.0-SNAPSHOT (git-44b1e0c6-b412)
Plugins: jpremium, luckperms, packetevents, pl-hide-pro, plasmovoice, protocolize, serverlistplus

Minecraft versions used
Server: Paper version 1.21-108-master@73a863b
Client: Vanilla 1.21

@Exceptionflug
Copy link
Owner

Hey, custom enchantments are currently not supported by protocolize

@ThePitereq
Copy link
Author

is there any ETA when they will be supported, or they won't be in near future?

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

No branches or pull requests

2 participants