-
Bug
-
Resolution: Fixed
-
Minecraft 1.12.2
-
None
-
Confirmed
The bug
When you setblock a lit redstone block without an power source powering it, it will turn off, unlike all other blocks. Lit furnaces, repeaters, comparators, wire, etc. all remain lit, but lamps turn off.
Steps to reproduce:
- Make sure you stand near nothing that could power the block in your feet.
- Use
setblock ~ ~ ~ minecraft:lit_redstone_lamp
Code analysis
The reason this happens is because of a check when a lit redstone lamp is setblock-ed:
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state) { if (!worldIn.isRemote) { if (this.isOn && !worldIn.isBlockPowered(pos)) { worldIn.setBlockState(pos, Blocks.REDSTONE_LAMP.getDefaultState(), 2); } else if (!this.isOn && worldIn.isBlockPowered(pos)) { worldIn.setBlockState(pos, Blocks.LIT_REDSTONE_LAMP.getDefaultState(), 2); } } }
However, this check does not exist for:
- pistons (extended)
- dispensers, droppers (triggered)
- comparators, doors, fence gates (powered)
- furnace, repeater (lit block variant)
- redstone torches (unlit block variant)