User Tools

Site Tools


tutorial:blocks

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
tutorial:blocks [2022/04/29 09:35]
solidblock [Next Steps]
tutorial:blocks [2022/04/29 09:57] (current)
solidblock [Custom VoxelShape]
Line 221: Line 221:
 To fix this, we have to define the ''​VoxelShape''​ of the new block: To fix this, we have to define the ''​VoxelShape''​ of the new block:
  
-<​code>​ +<​code ​java
- ​@Override +public class ExambleBlock extends Block { 
- ​public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) { +    [...] 
-     ​return VoxelShapes.cuboid(0f,​ 0f, 0f, 1f, 1.0f, 0.5f); +    ​@Override 
- }+    public VoxelShape getOutlineShape(BlockState state, BlockView view, BlockPos pos, ShapeContext context) { 
 +        return VoxelShapes.cuboid(0f,​ 0f, 0f, 1f, 1.0f, 0.5f); 
 +    } 
 +}
 </​code>​ </​code>​
  
tutorial/blocks.1651224913.txt.gz · Last modified: 2022/04/29 09:35 by solidblock