Soncresity Industries Wiki

Registry Utilities

Makes the process of registering Items and Blocks easier

Introduction

A fully functional Version of this class has first been introduced in Version 2.2.0

Warning

This Utility class is currently only available for fabric!

The Registry Utilities class makes the process of registering Items and Blocks easier by providing useful helper methods.

Warning

An error was made in versions below 2.3.0 where you could only use the RegistryUtils to register items and blocks to SI: Essentials itself and not to your own mod. This has been fixed in Version 2.3.0 by introducing a new modid argument to each Method.

Class

File: RegistryUtils.java

Package: dev.soncresityindustries.es.api.v0.util

Methods

registerBlock

public static Block registerBlock(@NotNull String modid, @NotNull String name, @NotNull Function<BlockBehaviour.Properties, Block> function, boolean registerBlockItem, boolean fireResistant, boolean explosionResistant) {}

Usage

public static final Block MY_BLOCK = RegistryUtils.registerBlock(MyMod.MODID, "my_block", props -> new Block(props), registerBlockItem, fireResistant, explosionResistant);

registerBlockItem

Warning

This method should usually only be used within the registerBlock method by providing the registerBlockItem boolean

public static void registerBlockItem(@NotNull String modid, @NotNull String name, @NotNull Block block, boolean fireResistant, boolean explosionResistant) {}

Usage

RegistryUtils.registerBlockItem(MyMod.MODID, "my_block", block, fireResistant, explosionResistant);

registerItem

public static Item registerItem(@NotNull String name, @NotNull Function<Item.Properties, Item> itemFactory, @NotNull Item.Properties settings) {}

Usage

public static final Item MY_ITEM = RegistryUtils.registerItem(MyMod.MODID, "my_item", Item::new, new Item.Properties());

On this page