mojira.dev
MC-70188

Some blocks cannot be placed facing a wall with /setblock or /fill + datavalues or block states

When using /setblock to place a dispenser with a rotation datavalue, if the front of the block is against a wall the dispenser will point the opposite direction when placed.

To Replicate: Place a block. Attempt to spawn a dispenser one block north of it, with a rotation data value of 3 (Telling the dispenser to "look" south). The block will instead face north. Same happens for east/west.

Affects the following blocks:

  • dropper

  • dispenser

  • observer ❓ (can't see due to MC-108054, may be affected if that's fixed)

  • (lit_)furnace


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

Linked issues

Comments

Aerotactics

Confirmed.

qmagnet

Possible related to MC-12437

ddavid135

Hi Q!

Torabi

Cannot reproduce in 1.8.2-pre6, resolving to MC-31365.

marcono1234

Confirmed for

marcono1234

Confirmed for

  • 15w37a

marcono1234

Confirmed for

  • 1.9.2

marcono1234

Please link to this comment in the description

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

The reason why this happens is because the method net.minecraft.block.BlockDispenser.setDefaultDirection(World, BlockPos, IBlockState) is called after the block was placed. This means the method is also called when a player places a dispenser, despite the fact that afterwards the method net.minecraft.block.BlockDispenser.onBlockPlacedBy(World, BlockPos, IBlockState, EntityLivingBase, ItemStack) is called which uses the old rotation again.

James Ryan Friz

Confirmed for 1.10

Also tested with fill command and got the same result. The command should have placed six droppers facing north. The first two had stone north of them and faced south instead. The next three had air and faced north. The last one had glass and faced north.

Daniel Burnett

Can confirm in 1.11 snapshots easily using blockstates: /fill ~ ~ ~ ~2 ~ ~ minecraft:dropper facing=west will have two droppers facing the wrong direction.

tryashtar

Confirmed up through 17w16a.

Arcensoth

Confirmed for 1.12-pre5. Also happens with structure blocks.

Chris Walker

(Unassigned)

Confirmed

/fill, /setblock, block-state, data-value, dispenser, dropper, observer

Minecraft 1.8-pre3, Minecraft 1.8, Minecraft 1.8.4, Minecraft 15w37a, Minecraft 1.9.1, ..., Minecraft 16w39b, Minecraft 16w39c, Minecraft 1.11.2, Minecraft 17w16a, Minecraft 1.12 Pre-Release 5

Minecraft 17w47a

Retrieved