User Tools

Site Tools


tutorial:blocks

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
Next revisionBoth sides next revision
tutorial:blocks [2021/02/27 07:51] – Fix misleading highlight siglongtutorial:blocks [2021/06/17 13:56] – Fix typo redgrapefruit
Line 137: Line 137:
 ===== Creating a Custom Block Class ===== ===== Creating a Custom Block Class =====
  
-The above approach works well for simple items but falls short when you want a block with //unique// mechanics. We'll create a //separate// class that extends ''Block'' to do this. The class needs a constructor that takes in an ''AbstractBlock.Settings'' argument:+The above approach works well for simple blocks but falls short when you want a block with //unique// mechanics. We'll create a //separate// class that extends ''Block'' to do this. The class needs a constructor that takes in an ''AbstractBlock.Settings'' argument:
  
 <code java [enable_line_numbers="true"]> <code java [enable_line_numbers="true"]>
Line 173: Line 173:
 public class ExampleMod implements ModInitializer { public class ExampleMod implements ModInitializer {
  
-    public static final ExampleBlock EXAMPLE_BLOCK = new ExampleBlock(Block.Settings.of(Material.STONE).hardness(4.0f));+    public static final ExampleBlock EXAMPLE_BLOCK = new ExampleBlock(FabricBlockSettings.of(Material.STONE).hardness(4.0f));
          
     @Override     @Override
tutorial/blocks.txt · Last modified: 2024/04/15 01:52 by solidblock