-
Bug
-
Resolution: Fixed
-
Minecraft 18w49a, Minecraft 18w50a, Minecraft 19w02a
-
Confirmed
-
Structures
-
Normal
The bug
Structures can provide multiple palette variants, however their selection looks faulty:
(MCP: net.minecraft.world.gen.feature.template.PlacementSettings.func_204764_a(List<List<BlockInfo>>, BlockPos))
18w49a, ccf.java
public List<cci.b> a(List<List<cci.b>> list, @Nullable et et2) { this.j = 8; if (this.j != null && this.j >= 0 && this.j < list.size()) { return list.get(this.j); } this.j = this.b(et2).nextInt(list.size()); return list.get(this.j); }
There are two checks (non-null and >= 0) which will always succeed. And for structures with more than 8 palette variants (currently not the case for vanilla structures) always the 9th palette variant is loaded.
How to reproduce
Seems like variant selection is position dependent, therefore the following steps load the structure at multiple positions.
Structures have to be placed inside the generated/minecraft/structures directory of a world.
- Load the structure 8-variants.nbt at multiple positions
/fill ~1 ~1 ~1 ~10 ~1 ~10 structure_block[mode=load]{mode:"LOAD",posX:0,posY:1,posZ:0,sizeX:1,sizeY:1,sizeZ:1,name:"8-variants"}
/fill ~1 ~ ~1 ~10 ~ ~10 redstone_block
→ Different wool types are placed
- Load the structure 9-variants.nbt at multiple positions
/fill ~1 ~1 ~1 ~10 ~1 ~10 structure_block[mode=load]{mode:"LOAD",posX:0,posY:1,posZ:0,sizeX:1,sizeY:1,sizeZ:1,name:"9-variants"}
/fill ~1 ~ ~1 ~10 ~ ~10 redstone_block
→ It always places the 9th variant, light gray wool
How to verify code-wise
- Decompile Minecraft or use a viewer such as Bytecode Viewer
- Search for the string
fossil/spine_1
- In the source look for the first line of code containing
16 -
- Open the type of the local variable two lines above
- Search for a method containing
= 8;