#How to transfer data making up Paper/Spigot server-side plugin custom items and recipes to a mod

1 messages · Page 1 of 1 (latest)

peak wharf
#

What I'm basically trying to do here is register all of my Paper server's custom items and crafting recipes with some sort of recipe browsing and item browsing window. I've discovered that I can't use the vanilla recipe browser to fetch the recipes (likely because my recipes use a custom crafting system with input item amounts that can be greater than one), meaning using vanilla recipe packets sent to the client or using JEI or REI to display my items is likely out of the question.

I was playing around with the networking aspects of Fabric for a few hours tonight, and realized that Spigot/Paper doesn't have a byte encoder/decoder for Strings and ItemStacks (at least without using NMS) that matches the Fabric implementations. Even though I can use plugin messaging channels to send and receive custom packets, I can't actually encode or decode any of the data I need to because of this mismatch. Does anyone have a creative solution to get around this? Or maybe an API that can help bridge this gap? Or am I better off just commissioning someone experienced to design the network handling?

Thank you to anyone who reads this, and hopefully there's a solution somewhere 🙏

#

Here's a link to the message containing the (non-working) code I came up with to attempt to solve this problem, to no avail. #mod-dev-1 message

#

If you've got any input at all, please don't hesitate to ping me - this feature is something I'd really like to add.

cinder dew
peak wharf
# cinder dew the true solution is to not use paper. does the paper server send the recipe inf...

Yes, but I rely heavily on numerous paper plugins to the point where it would cost significantly less time and money to get this packet workaround or create an API than to use Fabric as the server base.

Unfortunately, sending the recipe info, even just the item info, is not working due to the differences in native data serialization between paper and fabric. And unfortunately, I've tried using vanilla recipe packets, but the nature of my recipes mean that the recipes aren't actually sent to the client (like vanilla recipes are) - I tried to get that to work for a few hours before moving on to try packet-based communication.

cinder dew
# peak wharf Yes, but I rely heavily on numerous paper plugins to the point where it would co...

if it’s your server i highly recommend you switch to fabric. ESPECIALLY if you want to make a custom clientside mod that your players can use. there are lots of fabric serverside mods that can replace paper plugins.

To answer your question: you might need to write a decoder for this; I’m not aware of any paper<->fabric codec. But you really just need to encode strings and ints, right? so it seems like not too too hard to do…

peak wharf