Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

Custom blocks palette adjustment #4

Open
joojoooo opened this issue May 27, 2024 · 4 comments
Open

Custom blocks palette adjustment #4

joojoooo opened this issue May 27, 2024 · 4 comments

Comments

@joojoooo
Copy link

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
Copy link
Author

CustomiesDevs/Customies@87ee606

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

@Flonja
Copy link
Owner

Flonja commented May 27, 2024

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

@joojoooo
Copy link
Author

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
Copy link
Author

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants