Flonja / multiversion

A multiversion Gophertunnel library
GNU General Public License v3.0
15 stars 3 forks source link

Custom blocks palette adjustment #4

Open joojoooo opened 1 month ago

joojoooo commented 1 month ago

I made a protocol translator (1.20.0 to 1.20.50), a lot of the code I copied from this repo and tedac. It works fine on nukkit or pmmp servers. The issue is The Hive, they use custom blocks in StartGame, persistent block palette in LevelChunk... Sending the original LevelChunks crashes the client, even if there were no chunk changes between these 2 protocols, If I convert the persistent states to runtime ids the client doesn't crash, the only issue is all the blocks are wrong. I think the palette adjust code must be wrong or outdated. By not sending custom blocks in StartGame and not adjusting for them then the conversion is correct for at least the few non custom blocks, but since 99% of the blocks used on Hive are custom, that's not a viable option. Do you have any advice on how I can properly downgrade those chunks?

joojoooo commented 1 month ago

https://github.com/CustomiesDevs/Customies/commit/87ee6060517e63f92bc2f500dd9086377c2e6d60

I think this also affects 1.20.50 but I'm not sure. If so, different versions will need different adjustments

Flonja commented 1 month ago

I haven't played around with custom items and blocks a lot, so what I currently have is likely broken

joojoooo commented 1 month ago

When the server is sending custom blocks with "properties", the convert() function in custom_blocks.go fails to cast []int32 "enum" into []any But even with that fixed (i guess), runtime ids are still wrong

joojoooo commented 1 month ago

I know the issue is not my chunk conversion code because this is without sending the client custom blocks nor adjusting for them, as you can see non custom blocks are converted successfully to the old runtime id: NoCustomblocks

This is by sending the blocks and using your adjust code: customBlockAdjusted