mojira.dev
MC-210810

Additional candles cannot be added to the same block as candles if they have non-solid blocks below them

The Bug:

Additional candles cannot be added to the same block as candles if they have non-solid blocks below them.

Just for clarification reasons, non-solid blocks are blocks such as air, leaves, honey blocks, etc...

Steps to Reproduce:

  1. Place a candle on top of a block, and then destroy the block that's under the candle.

  2. Attempt to add additional candles to the same block as the candle you just placed.

  3. Take note as to whether or not additional candles can be added to the same block as candles if they have non-solid blocks below them.

Observed Behavior:

Additional candles cannot be added to the same block as candles if they have non-solid blocks below them.

Expected Behavior:

Additional candles would be able to be added to the same block as candles even if they have non-solid blocks below them.

Code Analysis:

Code analysis by @unknown can be found below.

The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.

net.minecraft.world.level.block.CandleBlock.java

public class CandleBlock extends AbstractCandleBlock implements SimpleWaterloggedBlock {
   ...
   public boolean canSurvive(BlockState blockState, LevelReader levelReader, BlockPos blockPos) {
      return Block.canSupportCenter(levelReader, blockPos.below(), Direction.UP);
   }
   ...

Looking above, we can see that the canSurvive() method is present within the CandleBlock.java class. This method basically restricts candles from being able to be placed unless certain requirements are met. In this particular case, only one requirement is needed, and this is that the block below the desired location of placement must be solid and able to support the center of a candle block. With this being said, additional candles cannot be added to the same block as a candle if it has a non-solid block below it, thus resulting in this problem occurring.

Fix:

Simply removing the canSurvive() method from the CandleBlock.java class will allow additional candles to be added to the same block as a candle regardless of the block below it, thus fixing this issue.

Linked issues

Attachments

Comments 15

[media][media][media]

I can confirm. I think this is probably intended, but mojang decides that.

I can confirm. I think this is probably intended, but mojang decides that.

Can confirm in 21w03a.

Can confirm in 21w05b.

5 more comments

Can confirm in 1.18.

Can confirm in 1.18.1.

Can confirm in 1.18.2.

Can confirm in 1.19.

I can confirm this behavior in 1.19.2. This problem can also be seen with candles that have non-solid blocks below them, such as honey blocks and leaves.

Here's a code analysis regarding this issue along with a fix.

Code Analysis:

The following is based on a decompiled version of Minecraft 1.19.2 using MCP-Reborn.

net.minecraft.world.level.block.CandleBlock.java

public class CandleBlock extends AbstractCandleBlock implements SimpleWaterloggedBlock {
   ...
   public boolean canSurvive(BlockState blockState, LevelReader levelReader, BlockPos blockPos) {
      return Block.canSupportCenter(levelReader, blockPos.below(), Direction.UP);
   }
   ...

Looking above, we can see that the canSurvive() method is present within the CandleBlock.java class. This method basically restricts candles from being able to be placed unless certain requirements are met. In this particular case, only one requirement is needed, and this is that the block below the desired location of placement must be solid and able to support the center of a candle block. With this being said, additional candles cannot be added to the same block as a candle if it has a non-solid block below it, thus resulting in this problem occurring.

Fix:

Simply removing the canSurvive() method from the CandleBlock.java class will allow additional candles to be added to the same block as a candle regardless of the block below it, thus fixing this issue.

Gavino Lucero

Avoma

(Unassigned)

Confirmed

Platform

Normal

Block states

candle

20w51a, 21w03a, 21w05b, 21w06a, 21w11a, ..., 1.21, 1.21.3, 1.21.4, 1.21.5, 1.21.7

Retrieved