Cuberite Forum
Generating palette files - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Generating palette files (/thread-3442.html)



Generating palette files - MightyFilipns - 10-09-2024

Where can I find the script for generating the Palette_1_XX.cpp files and to update the BlockStates.cpp and BlockStates.h? Looking at git history @tigerw previously added them.


RE: Generating palette files - NiLSPACE - 10-10-2024

That's probably this one: https://github.com/cuberite/cuberite/tree/master/Tools/BlockTypePaletteGenerator


RE: Generating palette files - MightyFilipns - 10-10-2024

Not what I'm looking for. The script generator.lua creates a palette file but the system to use does not appear to exist ???. (Am I missing something here?) I am trying to generate palette files like this https://github.com/cuberite/cuberite/blob/master/src/Protocol/Palettes/Palette_1_16.cpp, For versions 1.17-1.21.1. I have already implemented basic connection support for all those versions I just need proper palettes for blocks and items to make it somewhat playable.


RE: Generating palette files - NiLSPACE - 10-10-2024

Then I'm afraid I don't know either. You could try sending tigerw a message. I believe he has some contact options on his Github page.


RE: Generating palette files - MightyFilipns - 10-21-2024

So, I have managed to recreate the scripts for generating the BlockStates.cp/h files
Also, I created scripts for generating the following:
Palette_1_XX files
BlockItemConverter.cpp
Items.h
CustomStatistics.h
BlockTypes.h
All functions except those related to banners patterns and entities in NamespaceSerializer.cpp
Maps for converting particle names into protocol_ids

With all this, I have managed to add connection support for all versions up to 1.21.1 Currently only 1.21.1 has proper palettes as I had to disable old ones as they have to be regenerated for the new BlockState.cpp/h files.

However, when my script for generating Palette_1_XX files sees that the block states of some block have changed in between versions it simply skips that block. It looks like tigerw attempted to translate block states in cases like this, but I consider this a waste of time since it basically has to be done on a block-by-block basis.

You can find the scripts here: https://github.com/MightyFilipns/CuberiteScripts/tree/main
The repo where is implemented all this: https://github.com/MightyFilipns/cuberite/tree/NewChunkFormat