tutorial:blockappearance
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:blockappearance [2020/01/17 13:53] – 1.15 juuz | tutorial:blockappearance [2020/04/04 20:25] – [Making a block transparent] Add clarification to non-opaque earthcomputer | ||
---|---|---|---|
Line 13: | Line 13: | ||
</ | </ | ||
- | You probably also want to make your block transparent. To do that, use the '' | + | You probably also want to make your block transparent. To do that, use the '' |
<code java> | <code java> | ||
class MyBlock extends Block { | class MyBlock extends Block { | ||
- | | ||
- | MaterialColor.AIR, | ||
- | false, // isLiquid, | ||
- | false, // isSolid, | ||
- | true, // blocksMovement, | ||
- | false, // blocksLight, | ||
- | true, // !requiresTool, | ||
- | false, // burnable, | ||
- | false, // replaceable, | ||
- | PistonBehavior.NORMAL // pistonBehavior | ||
- | ); | ||
- | |||
public MyBlock() { | public MyBlock() { | ||
- | super(Settings.of(MY_MATERIAL)); | + | super(Settings.of(Material.STONE).nonOpaque()); |
} | } | ||
[...] | [...] | ||
} | } | ||
+ | |||
+ | If you do not mark your block as non-opaque like this, then block faces behind the block will not render and you will be able to see through the world. | ||
</ | </ | ||
Line 51: | Line 41: | ||
@Override | @Override | ||
public VoxelShape getOutlineShape(BlockState blockState, BlockView blockView, BlockPos blockPos, EntityContext entityContext) { | public VoxelShape getOutlineShape(BlockState blockState, BlockView blockView, BlockPos blockPos, EntityContext entityContext) { | ||
- | | + | |
} | } | ||
</ | </ |
tutorial/blockappearance.txt · Last modified: 2024/02/05 16:03 by haykam