tutorial:directionalblock
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
tutorial:directionalblock [2019/12/22 09:08] – bitman | tutorial:directionalblock [2021/08/11 02:53] – use auto uv and uvlock solidblock | ||
---|---|---|---|
Line 7: | Line 7: | ||
{{: | {{: | ||
- | < | + | < |
public class PolishedAndesiteSideBlock extends HorizontalFacingBlock { | public class PolishedAndesiteSideBlock extends HorizontalFacingBlock { | ||
Line 21: | Line 21: | ||
@Override | @Override | ||
- | public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, EntityContext | + | public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext |
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()); |
} | } | ||
Line 51: | Line 51: | ||
{ | { | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
} | } | ||
} | } | ||
Line 73: | Line 73: | ||
" | " | ||
" | " | ||
- | " | + | " |
- | " | + | " |
- | " | + | " |
- | " | + | " |
" | " | ||
" | " |
tutorial/directionalblock.txt · Last modified: 2023/09/26 05:43 by poopooracoocoo