Mojira Archive
MC-118064

Cactus (above the base) can generate next to solid blocks, and can replace blocks

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.