tutorial:blockappearance
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| tutorial:blockappearance [2025/12/06 21:44] – cassiancc | tutorial:blockappearance [2026/03/05 19:25] (current) – Mojang mappings cassiancc | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| //For version 1.21.5 and before:// | //For version 1.21.5 and before:// | ||
| < | < | ||
| - | @Environment(EnvType.CLIENT) | ||
| public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
| public void onInitializeClient() { | public void onInitializeClient() { | ||
| // To make some parts of the block transparent (like glass, saplings and doors): | // To make some parts of the block transparent (like glass, saplings and doors): | ||
| - | BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, | + | BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, |
| | | ||
| // To make some parts of the block translucent (like ice, stained glass and portal) | // To make some parts of the block translucent (like ice, stained glass and portal) | ||
| - | BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, | + | BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, |
| } | } | ||
| } | } | ||
| Line 25: | Line 24: | ||
| //For version 1.21.6 and after: // | //For version 1.21.6 and after: // | ||
| < | < | ||
| - | @Environment(EnvType.CLIENT) | ||
| public class ExampleModClient implements ClientModInitializer { | public class ExampleModClient implements ClientModInitializer { | ||
| public void onInitializeClient() { | public void onInitializeClient() { | ||
| // To make some parts of the block transparent (like glass, saplings and doors): | // To make some parts of the block transparent (like glass, saplings and doors): | ||
| - | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, | + | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, |
| | | ||
| // To make some parts of the block translucent (like ice, stained glass and portal) | // To make some parts of the block translucent (like ice, stained glass and portal) | ||
| - | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, | + | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, |
| } | } | ||
| } | } | ||
| </ | </ | ||
| - | You probably also want to make your block non-opaque. To do that, use the '' | + | You probably also want to make your block non-opaque. To do that, use the '' |
| < | < | ||
| - | | + | |
| </ | </ | ||
| Line 69: | Line 67: | ||
| < | < | ||
| @Override | @Override | ||
| - | public | + | public |
| - | return | + | return |
| } | } | ||
| </ | </ | ||
| Line 78: | Line 76: | ||
| < | < | ||
| @Override | @Override | ||
| - | public | + | public |
| - | | + | |
| } | } | ||
| </ | </ | ||
tutorial/blockappearance.txt · Last modified: 2026/03/05 19:25 by cassiancc