tutorial:blockappearance
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
tutorial:blockappearance [2024/08/26 08:28] – solidblock | tutorial:blockappearance [2025/06/10 16:40] (current) – solidblock | ||
---|---|---|---|
Line 8: | Line 8: | ||
In a [[documentation: | In a [[documentation: | ||
- | < | + | //For version 1.21.5 and before:// |
+ | < | ||
@Environment(EnvType.CLIENT) | @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, |
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | //For version 1.21.6 and after: // | ||
+ | < | ||
+ | @Environment(EnvType.CLIENT) | ||
+ | public class ExampleModClient implements ClientModInitializer { | ||
+ | public void onInitializeClient() { | ||
+ | // To make some parts of the block transparent (like glass, saplings and doors): | ||
+ | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, | ||
+ | |||
+ | // To make some parts of the block translucent (like ice, stained glass and portal) | ||
+ | BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, | ||
} | } | ||
} | } |
tutorial/blockappearance.txt · Last modified: 2025/06/10 16:40 by solidblock