-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
ShapedRecipe error on join #10748
Comments
#10710 - I'd guess this is basically the fix here |
Ah, I see. |
I think you mis-understood what that PR does. It will continue to throw an error when you create a recipe, it will just do it earlier. That PR adds an "empty" recipe choice for very specific recipes that allow empty ingredients. |
Ah ok. |
oh, but then that confuses me, what is the answer for an ingredient with an empty hole? I've not touched that API in a short while |
Try to use space as a char and don't try to define it |
Damn, yes you are right that works.. Thanks. Was/is this change documented somewhere? I never would have thought about trying that... Also not sure if I should close this issue with that now... |
Using a space to signify emptiness isn't a new thing. If it's not in the javadocs, it probably should be. |
Yeah a space should be quite obvious I guess.. But I was so used to it needing to be a material I guess. |
I looked at the code and seems like this was always the supported method, which copied the vanilla, while adding air was just not prevented, which now adds restrictions Also bukkit doesn't limit you to use only space as emptiness, unlike vanilla. Just as long as you don't define the char, it will mean emptiness, but space will ensure no future incompatibility, since it's the same as vanilla |
Yea, I don't recall seeing this doc'd on the wiki (as in, the entire recipe system? or in the JDs; I thought it would scream if you didn't define a char, but, I guess that's only in some recipe types? This is, fun |
Ok if this has always worked then I guess I just never tried it nor questioned it "needing" a material and all chars defined.. I guess I can close this issue with that though as it's not a bug in paper I would say. |
There is a documentation issue here, however |
Yeah, but would this not fall und paper/docs? |
Yes, I've raised a seperate issue for a docs page; though, I have no idea if somebody wants to look at the javadocs |
Ah, thanks for opening that.. I guess we will see if anyone takes a look. |
Expected behavior
Joining the Server normaly, not getting an error
Observed/Actual behavior
When joining the server, getting an error and getting kicked.
Steps/models to reproduce
Create a Plugin with the following code for a custom ShapedRecipe:
This Code worked prior to Paper 1.20.6.
Plugin and Datapack List
No datapacks, only my own plugin which adds the recipe above
Paper version
This server is running Paper version 1.20.6-82-master@0ad09de (2024-05-18T20:25:01Z) (Implementing API version 1.20.6-R0.1-SNAPSHOT)
Other
Error I get when joining:
[14:41:54 INFO]: UUID of player NickCloud is aa162c9f-0772-446c-9acb-31c8a4ac0adb [14:41:55 INFO]: [+] NickCloud [14:41:55 ERROR]: Error sending packet clientbound/minecraft:update_recipes (skippable? false) io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:update_recipes' at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:53) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:20) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:26) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:12) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.ChannelOutboundHandlerAdapter.write(ChannelOutboundHandlerAdapter.java:113) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at net.minecraft.network.Connection$2.write(Connection.java:749) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:940) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:966) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:934) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:984) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1025) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:306) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final] at net.minecraft.network.Connection.doSendPacket(Connection.java:504) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.Connection.lambda$sendPacket$13(Connection.java:489) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.97.Final.jar:4.1.97.Final] at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.97.Final.jar:4.1.97.Final] at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.97.Final.jar:4.1.97.Final] at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:413) ~[netty-transport-classes-epoll-4.1.97.Final.jar:4.1.97.Final] at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.97.Final.jar:4.1.97.Final] at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.97.Final.jar:4.1.97.Final] at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?] Caused by: io.netty.handler.codec.EncoderException: Empty ItemStack not allowed at net.minecraft.world.item.ItemStack$2.encode(ItemStack.java:214) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.world.item.ItemStack$2.encode(ItemStack.java:201) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.ByteBufCodecs$19.encode(ByteBufCodecs.java:413) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.ByteBufCodecs$19.encode(ByteBufCodecs.java:395) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.StreamCodec$4.encode(StreamCodec.java:72) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.world.item.crafting.ShapedRecipePattern.toNetwork(ShapedRecipePattern.java:167) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.StreamCodec$2.encode(StreamCodec.java:38) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.world.item.crafting.ShapedRecipe$Serializer.toNetwork(ShapedRecipe.java:208) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.StreamCodec$1.encode(StreamCodec.java:24) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.StreamCodec$6.encode(StreamCodec.java:107) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.StreamCodec$8.encode(StreamCodec.java:141) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.ByteBufCodecs$19.encode(ByteBufCodecs.java:413) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.ByteBufCodecs$19.encode(ByteBufCodecs.java:395) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.StreamCodec$7.encode(StreamCodec.java:122) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.StreamCodec$5.encode(StreamCodec.java:88) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] at net.minecraft.network.codec.StreamCodec$5.encode(StreamCodec.java:78) ~[paper-1.20.6.jar:1.20.6-82-0ad09de] ... 32 more [14:41:55 INFO]: NickCloud[/46.57.89.116:59729] logged in with entity id 60 at ([world]-112.45268948341727, 75.0, -59.66880202521697) [14:41:56 INFO]: NickCloud lost connection: Internal Exception: io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:update_recipes' [14:41:57 INFO]: [-] NickCloud
The text was updated successfully, but these errors were encountered: