Created
June 7, 2020 13:57
-
-
Save Umpaz/19eefdfbb188ff92219b1c8cde6f9b39 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SubscribeEvent | |
public static void onRegisterItems(final RegistryEvent.Register<Item> event) { | |
final IForgeRegistry<Item> registry = event.getRegistry(); | |
BlockInit.BLOCKS.getEntries().stream().map(RegistryObject::get).forEach(block -> { | |
final Item.Properties properties = new Item.Properties().group(ItemGroup.BUILDING_BLOCKS); | |
final BlockItem blockItem = new BlockItem(block, properties); | |
blockItem.setRegistryName(block.getRegistryName()); | |
registry.register(blockItem); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment