I am creating a simple crafting block (not using block entities) and ran into some issues.
I would like to use the onstep method inherent to the Blocks class to check whether an instanceof ItemEntity has landed on its surface (something dropped an item onto the block). I was thinking of using a map of type Item, Item to map one item into another (as a way to do recipes). For example: Items.STONE, Items.STONE_BRICKS would be implemented by my method as when you drop a stone item onto the block, it changes into a stone_brick item. I am, however, having some issues with using my modded items in the recipes. First of all: yes, the method works with all vanilla items.
The problem occurs when I try to add a modded item (of type ModItems a class that inherits from Items and declares items using a DeferredRegistry) using the syntax ModItems.SILVER_INGOT.get() (the .get() is necessary because the RegistryObject is not technically an item and you must use .get() to access the stored class). When I run the game with this, it says: java.lang.NullPointerException: Registry Object not present: <modId>:silver_ingot. I do import the class ModItems and the Modded Items are declared as public static final so I don't see a reason the class would have trouble finding them.
Any help here is appreciated. If you require any additional information about the project, just ask; I don't really know what is needed to figure out the issue.