Open nl255 opened 5 years ago
I do not plan to implement support for the bedrock edition world format anytime soon. I will look into this however and see what I can do when I have the time :)
I have been looking into this, unfortunately there doesn't seem to be an official java library to read Mojangs custom LevelDB. Still investigating.
Heya, I'm also interested in Bedrock support.
https://github.com/tinfoiled/leveldb <- isn't that related to bedrock? At least it was referenced in the wiki (https://minecraft.gamepedia.com/Bedrock_Edition_level_format)
The problem with the library by Tinfoiled is that it only supports the ZLIB compression type, but newer Minecraft worlds actually use raw ZLIB compression. I found a fork of the original Java port of the LevelDB library with a usable raw ZLIB implementation here: https://github.com/CloudburstMC/leveldb
I'm currently trying to get this to work.
Does anyone have experience with Minecraft Bedrock textures and block models?
For Java Edition, I'm currently creating color mappings to render the top-down view in MCA Selector by looping over the block states json files, finding the top texture of each block, and then calculating the average color for this texture.
I couldn't find a way to do something similar for the Bedrock Edition: Apparently Bedrock Edition doesn't support block models, and it doesn't seem to be possible to infer from the vanilla resource pack to all possible block states and link them to textures.
Here is an example of the problem, looking at the rose bush:
In the Minecraft Java Edition assets, I first look at the file assets/minecraft/blockstates/rose_bush.json
. It contains 2 variants for its upper and lower half:
{
"variants": {
"half=lower": {
"model": "minecraft:block/rose_bush_bottom"
},
"half=upper": {
"model": "minecraft:block/rose_bush_top"
}
}
}
Then, i can look up the models in assets/minecraft/models/block/rose_bush_bottom.json
and assets/minecraft/models/block/rose_bush_top.json
. Each one of them has a parent called minecraft:block/cross
:
{
"parent": "minecraft:block/cross",
"textures": {
"cross": "minecraft:block/rose_bush_bottom"
}
}
I then look up assets/minecraft/models/block/cross.json
. It is missing an up
or top
texture, so I use its particle
texture, which is linked to #cross
in assets/minecraft/models/block/rose_bush_top.json
:
[...]
"textures": {
"particle": "#cross"
},
[...]
So I take the cross
texture, which is assets/minecraft/textures/block/rose_bush_bottom.png
to calculate the average color, which is #454003 for rose_bush_bottom and #733d07 for rose_bush_top.
Based on the assets/minecraft/blockstates/rose_bush.json
file, I can now create 2 mappings:
rose_bush:half=lower;454003
rose_bush:half=upper;733d07
This now can be matched to what Minecraft actually saves in the palette in the mca files:
{
Name: "minecraft:rose_bush",
Properties: {
half: upper
}
}
Now this doesn't seem to work for Bedrock. A rose bush is saved as just a double_plant
with double_plant_type: rose
:
{
name: "minecraft:double_plant",
version: 17825806,
states: {
upper_block_bit: 1b,
double_plant_type: rose
}
}
But in the vanilla resource pack there is no mention of those block states.
Is there a way to cleanly extract ALL block states from Minecraft Bedrock and link them to their textures? Creating and maintaining a mapping for ~1500 block states is not something i want to do manually.
Apparently Bedrock servers send a ton of data to the client during the connection process, including the complete block palette of all registered block states on the server (see https://wiki.vg/Bedrock_Protocol#Start_Game). This packet can be intercepted (e.g. here: https://github.com/pmmp/BedrockData). This would leave me with a list of all block states in the game, but still couldn't produce a link to their textures.
It appears Amulet can perform the chunk deletion, not sure about other operations. However their interace is rather sluggish and it is quite a pain to work with.
It would be wonderful if MCA can reference their work and implement bedrock support, while keeping the nice UI.
Are there any plans to implement support for Bedrock edition format worlds? While it is possible to convert them to Java edition with MCC Toolchest and then back again it would be nice to have native support especially since most of the editors that support Bedrock are not being updated and Amulet is still a long way away from being released.