Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-263486

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • 1.20.1
    • None
    • Unconfirmed
    • (Unassigned)

      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
       

            Unassigned Unassigned
            JackMC Jack
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: