Mojira Archive
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
 

Works As Intended

Jack

2023-06-13, 03:45 AM

2023-06-18, 05:44 AM

2023-06-18, 05:44 AM

0

1

Unconfirmed

(Unassigned)

1.20.1

-