mojira.dev
MC-11416

Dispenser / Dropper / Piston / Command block placing is not consistent

All pistons were placed standin on top of the lamp. I allways aimed for the block behind the piston.
If they placing functioned like logs placing does, they all wouuld be facing the lamp and not upwards.

Linked issues

Attachments

Comments 13

Pistons are placed always facing you.

@Tails but this is the problem here. I stood in the exact same spot. And they should be facing all the same, don't you think?

This indeed seems to have a small offset bug into it. Seems like it calculates the angle ("facing") based on the block corners, ignoring the exact position of the player. Lets see if I can find the relevant source code. (btw. affects 1.4.7, too)

Fix

BlockPistonBase.determineOrientation()

//if (MathHelper.abs((float)par4EntityPlayer.posX - (float)par1) < 2.0F
        //        && MathHelper.abs((float)par4EntityPlayer.posZ - (float)par3) < 2.0F)
        if (MathHelper.abs((float) player.posX - ((float) x + 0.5F)) < 2.0F
                && MathHelper.abs((float) player.posZ - ((float) z + 0.5F)) < 2.0F) {
            ...

The piston block's position was taken at its north-west corner, while player's position was its non-rounded value. This caused half-a-block shift (i.e. error) in the angle calculation.

The fix above simply adds 0.5 to both horizontal coordinates, thus calculating the angle based on the bottom center of the piston block.

This is like the crappy old behavior of placing logs. They maybe just didn’t fix placing for pistons, too.

3 more comments

logs are never a problem to place any more. why are all the sensitive components so hard to place?

Still happens in the latest snapshot, 15w51b.

Also effects command blocks in thd 1.9 snapshots

I thought they used the stairs placement algorithm?

Hannes Güdelhöfer

Erik Broes

Confirmed

facing, piston, placing

Minecraft 1.4.7, Minecraft 1.5, Minecraft 1.5.1, Minecraft 1.5.2, Minecraft 1.6.1, ..., Minecraft 14w30b, Minecraft 14w30c, Minecraft 15w36d, Minecraft 15w51b, Minecraft 16w32b

Minecraft 16w41a

Retrieved