mojira.dev
MC-118408

Torches and redstone torches cannot be placed on top of a Jack o'Lantern but can be placed on pumpkin

The bug

Torches and redstone torches cannot be placed on top of a Jack o'Lantern but can be placed on pumpkin.

MC-118112 (same/similar issue) has status as this being resolved yet one still cannot place torches or redstone torches on top of Jack o'Lanterns but can do so on pumpkins.

Code analysis

Code analysis by @unknown can be found in this comment.

Linked issues

Attachments

Comments 2

The following is based on a decompiled version of Minecraft 1.12 using MCP 9.40pre-1.

I think this might be intended since the game explicitly checks if the torch is placed on a LIT_PUMPKIN in the method net.minecraft.block.BlockTorch.canPlaceOn(). With this check removed, torches can be placed on Jack o'Lanterns.

private boolean canPlaceOn(World worldIn, BlockPos pos)
{
	Block block = worldIn.getBlockState(pos).getBlock();
	// This is the line where the game checks if the target block is a ÉND_GATEWAY or a LIT_PUMPKIN
	// If it is, this method will return false and the torch won't be placed
	boolean flag = block == Blocks.END_GATEWAY || block == Blocks.LIT_PUMPKIN;

	if (worldIn.getBlockState(pos).isFullyOpaque())
	{
		return !flag;
	}
	else
	{
		boolean flag1 = block instanceof BlockFence || block == Blocks.GLASS || block == Blocks.COBBLESTONE_WALL || block == Blocks.STAINED_GLASS;
		return flag1 && !flag;
	}
}

Confirmed also affects version 1.12.2

This bug just broke a bunch of redstone machines on my server. (I use jack o lanterns liberally in my redstone as a convenient way of keeping things lit - and a good way to keep track of which blocks shouldn't be broken.

Xavom

migrated

Confirmed

jack_o_lantern, pumpkin, redstone_torch, torch

Minecraft 1.12, Minecraft 1.12.1 Pre-Release 1, Minecraft 1.12.1, Minecraft 1.12.2 Pre-Release 1, Minecraft 1.12.2 Pre-Release 2, Minecraft 1.12.2, Minecraft 17w43b, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47b

Minecraft 17w48a

Retrieved