Better Slabs

Better Slabs

30.1k Downloads

[1.16.3-1.1.0] Better Slabs breaks Repurposed Structures's structure json files

TelepathicGrunt opened this issue ยท 7 comments

commented

h\Hello! I am the mod author of Repurposed Structures.
https://www.curseforge.com/minecraft/mc-mods/repurposed-structures-fabric

I had an issue report about my villages crashing and when looking at the logs, it stated that there was no village pieces in the starting pool. I couldn't reproduced the crash at all until the person provided me with the mod list. After some trial and error, I found that Minecraft fails to parse my mod's structure json files only when Better Slabs is on. I don't know why but just wondering, are you modifying properties of blocks? If so, that might be a cause for why Minecraft is unable to parse my json as some of the json has slabs in them. Examples:

https://github.com/TelepathicGrunt/RepurposedStructures-Fabric/blob/58a4efac524370068cda7e176a657b19452b9da6/src/main/resources/data/repurposed_structures/worldgen/processor_list/village/jungle/mossify.json#L63-L79

https://github.com/TelepathicGrunt/RepurposedStructures-Fabric/blob/58a4efac524370068cda7e176a657b19452b9da6/src/main/resources/data/repurposed_structures/worldgen/processor_list/village/giant_taiga/mossify.json#L140-L156

Here's the crashlog with just Better Slabs, Repurposed Structures, and Fabric API on: https://hatebin.com/paqlysoiuf
It got a bit cutoff because the json is so long but it does show two lines of failed json parsing.
[12:01:32] [main/ERROR]: Error loading registry data: Not a json array: {
[12:01:32] [main/ERROR]: Pool element: Not a json array: {

And since the structure processor json dies due to something with how Better Slabs works, it causes my Village piece's json to also explode and make my Villages crash upon attempting to generate.

I hope this helps!

commented

Did a quick test before I go to class. I removed the type property from the processor json and got the exact same error. So it seems Minecraft needs all properties defined in the Properties tag in the json. So when the new property was added to the slab, it makes the json explode as it now has a property that it's looking for that isn't defined in the json. Hmm. Finding where the json parsing is done for blocks might make a good place to check out. I have a feeling this might also be something to bring to fabric api's attention too as mods adding properties breaking json sounds like a pretty nasty issue that's gonna grow as people start using more json.

        {
          "output_state": {
            "Properties": {
              "waterlogged": "false",
              "type": "bottom"
            },
            "Name": "minecraft:mossy_stone_brick_slab"
          },
          "input_predicate": {
            "block": "minecraft:stone_brick_slab",
            "probability": 0.1,
            "predicate_type": "minecraft:random_block_match"
          },
          "location_predicate": {
            "predicate_type": "minecraft:always_true"
          }
        },
commented

Linking the crash report I gotten so the user can keep track on this issue too to know our progress on a fix
TelepathicGrunt/RepurposedStructures-Quilt#32

commented

My mod works by adding a new property to slabs, it works with vanilla structures fine, so this is a bit odd I will take a look at it
by default slabs have the proprieties TYPE (an enum) and WATERLOGGED (a boolean), my mod adds NEW_TYPE (also an enum) that contains the new blockstates.

commented

Yeah. vanilla structures are still done by code and not actually json yet. I do have a vanilla json datapack that mojang released. In theory, the snowy zombie village processor should also crash as it has a slab in it. Most others doesn't seem to have slabs
vanillatest.zip

commented

I am currently rewriting some stuff that should:
A) optimize my mod,
B) make it work with yours and probably any other mods that would have this same issue

commented

Alright new version is out, I have tested it with your mod and it works

commented

Awesome thank you!