mojira.dev
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.

Attachments

Comments 6

-This seems to have been fixed in 1.16 - no cactus generates with the given preset.-

Because of MC-188569, you have to select Desert or Overworld preset before using the given preset.

Can confirm for 1.16.5

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?

Cannot reproduce the bug as described in the description or the comment about cobwebs. 

marcono1234

(Unassigned)

Confirmed

World generation

cactus, world-generation

Minecraft 1.11.2, Minecraft 1.12 Pre-Release 6, Minecraft 1.12 Pre-Release 7, Minecraft 1.12.1, Minecraft 1.12.2, ..., 1.15 Pre-release 3, 20w13b, 20w17a, 1.16.5, 1.17.1

Retrieved