Mojira Archive
MC-94675

Huge red mushroom blocks will replace non full (translucent) blocks upon growth

The bug

Upon growing huge red mushrooms, if there are any non full blocks around it, there's a chance they can be replaced by the red mushroom blocks. This doesn't apply to brown mushrooms as their structure doesn't have "walls" as the red mushrooms do.

Steps To Recreate

  1. Dig down two blocks
  2. Place any kind of slab on the bottom half of the block up to 2 blocks away from the hole in all directions (making sure the bottom block is dirt/mycelium/any block mushrooms can grow into large mushrooms). E.g:
    S S S S S
    S S S S S
    S S H S S
    S S S S S
    S S S S S
    

    (S = Slab, H = Hole)

  3. Place a block seven blocks above the dirt to make sure the smallest mushroom variant grows
  4. Place red mushroom in the hole and grow it with bonemeal and there's a chance the grown mushroom structure will replace the slab blocks (see attached screenshots)

Code analysis

Based on 1.11.2 decompiled using MCP 9.35 rc1

This happens because the method net.minecraft.world.gen.feature.WorldGenBigMushroom.generate(World, Random, BlockPos) does the "is space empty" check only for the brown mushroom and therefor does not test if there are any blocks in the lower parts.

Suggested fix
//  int k = 3;
//
//  if (j <= position.getY() + 3)
//  {
//      k = 0;
//  }

int k = 0;

if (block == Blocks.BROWN_MUSHROOM_BLOCK) {
    if (j == position.getY() + i) {
        k = 3;
    }
}
else if (j >= position.getY() + i - 3) {
    k = 2;
}

This would also make the net.minecraft.block.state.IBlockProperties.isFullBlock() calls before placing the mushroom blocks redundant.

Fixed

PythonGB

2015-12-22, 12:31 PM

2018-07-18, 06:54 PM

2017-12-15, 12:33 AM

5

3

Confirmed

block, block-replacement, full-block, grow, mushroom, red-mushroom

Minecraft 15w50a, Minecraft 16w36a, Minecraft 1.11.2, Minecraft 1.12.2

Minecraft 17w50a