The bug
The cactus generation used in the world decoration uses always the base block for the checks instead of the vertical offset blocks. This means it can replace blocks with offset cactus blocks and they can be placed next to solid blocks.
How to reproduce
Create a Superflat world with the following preset
minecraft:stone,minecraft:sand,2*minecraft:air,minecraft:stone;minecraft:desert;decoration
→ Some cactus blocks are placed in the stone layer directly and directly next to stone
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The method net.minecraft.world.gen.feature.WorldGenCactus.generate(World, Random, BlockPos)
always uses the base position when testing if an vertical offset cactus can be placed. Additionally it does not test if the block is air for the offset cactus blocks.
Attachments
Comments 6
Because of MC-188569, you have to select Desert or Overworld preset before using the given preset.
Cannot reproduce anymore in 21w44a – following the instructions (taking into account MC-188569), the world now generates 1-block cactus, which seems correct for a 2-block space.
Don't know when the fix was.
I cannot reproduce this with stone blocks either in 1.18.1. However, I can still reproduce this with cobwebs:
minecraft:bedrock,3*minecraft:stone,52*minecraft:sandstone,8*minecraft:sand,3*minecraft:cobweb;minecraft:desert
But maybe this is a specific corner case, and the description does not match anymore, because even the base cactus block is placed next to / replaces cobweb.
Therefore I don't think this is the same bug.
Would probably make sense to resolve this report here as Cannot Reproduce. Or is anyone able to reproduce this with solid blocks in the latest version?
-This seems to have been fixed in 1.16 - no cactus generates with the given preset.-