User Tools

Site Tools


tutorial:blockappearance

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
tutorial:blockappearance [2024/08/26 08:28] solidblocktutorial:blockappearance [2025/06/10 16:40] (current) solidblock
Line 8: Line 8:
 In a [[documentation:entrypoint|client-sided mod initializer]]: In a [[documentation:entrypoint|client-sided mod initializer]]:
  
-<yarncode java>+//For version 1.21.5 and before:// 
 +<yarncode java ExampleModClient.java>
 @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, class_1921.method_23581());+        BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, RenderLayer.getCutout());
                  
         // 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, class_1921.method_23583());+        BlockRenderLayerMap.INSTANCE.putBlock(TutorialBlocks.MY_BLOCK, RenderLayer.getTranslucent()); 
 +    } 
 +
 +</yarncode> 
 + 
 +//For version 1.21.6 and after: // 
 +<yarncode java ExampleModClient.java> 
 +@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, BlockRenderLayer.CUTOUT); 
 +         
 +        // To make some parts of the block translucent (like ice, stained glass and portal) 
 +        BlockRenderLayerMap.putBlock(TutorialBlocks.MY_BLOCK, BlockRenderLayer.TRANSLUCENT);
     }     }
 } }
tutorial/blockappearance.txt · Last modified: 2025/06/10 16:40 by solidblock