mojira.dev
MC-263486

When placing barrels, they have placement mechanics unlike other 6 way facing blocks.

The Barrel Block Placement code uses a method that uses the players looking direction instead of the placement face like other blocks.. 

https://youtu.be/ZvBueF3fBeg

the video shows the different placement states. 

Pay close attention to how different parts of the side have an effect on the placement direction.

code review (not mojang mappings):

//Pillar Block (the block that wood inherits)
public BlockState getPlacementState(ItemPlacementContext ctx){ 
    return (BlockState)this.getDefaultState().with(AXIS, ctx.getSide().getAxis()); 
}
//Barrel Block (the barrels block class)
public BlockState getPlacementState(ItemPlacementContext ctx) {
    return (BlockState)this.getDefaultState().with(FACING, ctx.getPlayerLookDirection().getOpposite()); 
}

the naming does a good job at describing the different methods do, and most importantly how they are different.

if you are doing a 1.20.2, and this is fully considered a bug. it might be something easy to add really quick 🙂
 

Comments 2

Not a bug. Pistons, droppers, dispensers, jigsaw blocks, command blocks, etc. all face you. Axis blocks like logs and quartz pillars are not facing blocks. The only time a facing block does not behave this way is if it needs wall support (wall torches, wall signs, wall banners, etc.).

Ok. Makes sense. should I close it or let someone close it?

It seems like a weird inconsistency as the face does not do anything, the same as a log. But if it is a feature then that's fine.

Jack

(Unassigned)

Unconfirmed

(Unassigned)

1.20.1

Retrieved