Custom blocks can declare custom culling layers to set up advanced culling scenarios. Unfortunately, culling using such breaks whenever the following 2 conditions are met:
The
minecraft:geometrycomponent is implied due to component inheritance across permutations.The
minecraft:transformationcomponent is present.
Workaround possible
It is possible to get around this issue by redundantly declaring the geometry component across all permutation declarations that require the transformation component.
Demonstration
Demos only show secondary permutations
All demos shown in screenshots (and included in the attached world below) are secondary permutations of demo blocks.
The following screenshot shows a correct scenario. Note that the connecting faces of the center block are culled.
The following 3 all show bugged scenarios involving a glowstone-textured block whose culling layer is not being respected. Note that no culling is occurring.
Reproduction
The bugged glowstone-textured block from above has the following code:
{
"format_version": "1.26",
"minecraft:block": {
"description": {
"identifier": "bug_culling:custom_block_with_bugged_culling",
"states": {
"bug_culling:activated": [false, true]
}
},
"components": {
"minecraft:geometry": {
"identifier": "geometry.bug_culling.inset_cube",
"culling": "bug_culling:cull_east_and_south",
"culling_layer": "bug_culling:inset_cube"
},
"minecraft:material_instances": {
"*": {"texture": "glowstone"}
}
},
"permutations": [
{
"condition": "q.block_state('bug_culling:activated')",
"components": {
"minecraft:transformation": {}
}
}
]
}
}The culling layer, bug_culling:inset_cube, is disabled in the “activated” permutation. Given that it is set in the root components object, it should be inherited across all permutations that don’t override it.
This example is taken from the behavior pack in the following world attached for convenience:
This world can be opened (in Minecraft Preview) for inspection or unzipped to access the code associated with such. Note that this bug is observed with non-default permutations. Therefore, it’s recommended to use the provided command blocks to reset demos.
Attachments
Comments 0
No comments.