tutorial:blockappearance
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
tutorial:blockappearance [2022/08/14 04:00] – Use Yarn code blocks haykam | tutorial:blockappearance [2024/02/05 16:03] – Fix typo in environment annotation haykam | ||
---|---|---|---|
Line 7: | Line 7: | ||
To fix this, you need to set your block' | To fix this, you need to set your block' | ||
- | In a [[documentation: | + | In a [[documentation: |
< | < | ||
- | BlockRenderLayerMap.INSTANCE.putBlock(ExampleMod.MY_BLOCK, | + | @Environment(EnvType.CLIENT) |
- | // Replace `class_1921.method_23581()` with `class_1921.method_23583()` if you have a translucent texture. | + | public class ExampleModClient implements ClientModInitializer() { |
+ | public void onInitializeClient() { | ||
+ | BlockRenderLayerMap.INSTANCE.putBlock(ExampleMod.MY_BLOCK, | ||
+ | | ||
+ | } | ||
+ | } | ||
</ | </ | ||
Line 17: | Line 22: | ||
< | < | ||
- | class MyBlock extends class_2248 { | + | public |
- | | + | |
- | super(class_2251.of(class_3614.field_15914).method_22488()); | + | |
- | } | + | |
- | + | ||
- | [...] | + | |
- | } | + | |
</ | </ | ||
Line 41: | Line 40: | ||
</ | </ | ||
- | Note: For non-transparent blocks that are not full, you may have to override the '' | + | Note: For non-transparent blocks that are not full, you may have to override the '' |
===== Making a block invisible ===== | ===== Making a block invisible ===== | ||
- | First we need to make the block appear invisible. To do this, we override '' | + | First we need to make the block appear invisible. To do this, we override '' |
< | < | ||
Line 54: | Line 53: | ||
</ | </ | ||
- | We then need to make our block unselectable by making its outline shape be non-existent. So override '' | + | We then need to make our block unselectable by making its outline shape be non-existent. So override '' |
< | < |
tutorial/blockappearance.txt · Last modified: 2024/08/26 08:28 by solidblock