User Tools

Site Tools


tutorial:directionalblock

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
tutorial:directionalblock [2019/12/24 09:35] bitmantutorial:directionalblock [2021/03/18 08:15] – fix code jummit
Line 21: Line 21:
  
  @Override  @Override
- public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext ctx) {+ public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext ctx) {
  Direction dir = state.get(FACING);  Direction dir = state.get(FACING);
  switch(dir) {  switch(dir) {
Line 38: Line 38:
  
  public BlockState getPlacementState(ItemPlacementContext ctx) {  public BlockState getPlacementState(ItemPlacementContext ctx) {
- return (BlockState)this.getDefaultState().with(FACING, ctx.getPlayerFacing());+ return (BlockState)this.getDefaultState().with(Properties.HORIZONTAL_FACING, ctx.getPlayerFacing().getOpposite());
  }  }
  
tutorial/directionalblock.txt · Last modified: 2023/09/26 05:43 by poopooracoocoo