Skip to content

Commit

Permalink
Account for simple changes to registration in NeoForge 20.2.64-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
Technici4n committed Nov 25, 2023
1 parent 00303d8 commit c6f87c2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions content/news/20.2registry-rework.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,16 @@ private static final DeferredRegister.Items ITEMS = DeferredRegister.createItems
public static final DeferredBlock<MyBlock> MY_BLOCK = BLOCKS.register("my_block", () -> new MyBlock(/* create block */));
public static final DeferredItem<MyItem> MY_ITEM = ITEMS.register("my_item", () -> new MyItem(/* create item */));

// There are also a few extra helper functions.
// `registerBlock` to directly register a `new Block` from some block properties:
// There are also a few extra helper functions, for example to register "simple" blocks.
// `registerSimpleBlock` to directly register a `new Block` from some block properties:
public static final DeferredBlock<Block> MY_SIMPLE_BLOCK =
BLOCKS.registerBlock("simple_block", BlockBehaviour.Properties.of().mapColor(MapColor.STONE));
// `registerItem` to directly register a `new Item` from some item properties:
BLOCKS.registerSimpleBlock("simple_block", BlockBehaviour.Properties.of().mapColor(MapColor.STONE));
// `registerSimpleItem` to directly register a `new Item` from some item properties:
public static final DeferredItem<Item> MY_SIMPLE_ITEM =
ITEMS.registerItem("simple_item", new Item.Properties().stacksTo(1));
// `registerBlockItem` to directly register a `new BlockItem` for a block:
ITEMS.registerSimpleItem("simple_item", new Item.Properties().stacksTo(1));
// `registerSimpleBlockItem` to directly register a `new BlockItem` for a block:
public static final DeferredItem<BlockItem> MY_BLOCK_ITEM =
ITEMS.registerBlockItem(MY_BLOCK);
ITEMS.registerSimpleBlockItem(MY_BLOCK);
```

As usual, don't forget to pass your mod bus to your `DeferredRegister`s:
Expand Down

0 comments on commit c6f87c2

Please sign in to comment.