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
Next revision
Previous revision
tutorial:blockappearance [2022/08/14 04:02] – Inline Yarn codes haykamtutorial:blockappearance [2024/02/05 16:03] (current) – Fix typo in environment annotation haykam
Line 7: Line 7:
 To fix this, you need to set your block's render layer to cutout or transparent. To fix this, you need to set your block's render layer to cutout or transparent.
  
-In a [[documentation:entrypoint|client-sided mod initializer]], add:+In a [[documentation:entrypoint|client-sided mod initializer]]:
  
 <yarncode java> <yarncode java>
-BlockRenderLayerMap.INSTANCE.putBlock(ExampleMod.MY_BLOCK, class_1921.method_23581()); +@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, class_1921.method_23581()); 
 +         // Replace `class_1921.method_23581()` with `class_1921.method_23583()` if you have a translucent texture. 
 +    } 
 +}
 </yarncode> </yarncode>
  
Line 17: Line 22:
  
 <yarncode java> <yarncode java>
-class MyBlock extends class_2248 { +     public static final Block MY_BLOCK = new Block(FabricBlockSettings.create().method_22488());
-    public MyBlock() { +
-        super(class_2251.of(class_3614.field_15914).method_22488()); +
-    } +
- +
-    [...] +
-}+
 </yarncode> </yarncode>
  
tutorial/blockappearance.1660449746.txt.gz · Last modified: 2022/08/14 04:02 by haykam