SHOW:
|
|
- or go back to the newest paste.
1 | @Mod.EventBusSubscriber(modid = TutorialMod.MOD_ID, bus = Bus.MOD) | |
2 | public class ModEventBusSubscriber { | |
3 | ||
4 | @SubscribeEvent | |
5 | public static void registerItems(RegistryEvent.Register<Item> event) { | |
6 | final IForgeRegistry<Item> registry = event.getRegistry(); | |
7 | BlockInit.BLOCKS.getEntries().stream().map(RegistryObject::get) | |
8 | .forEach(block -> { | |
9 | final Item.Properties properties = new Item.Properties().group(ItemGroup.MISC); | |
10 | final BlockItem blockItem = new BlockItem(block, properties); | |
11 | blockItem.setRegistryName(block.getRegistryName()); | |
12 | registry.register(blockItem); | |
13 | }); | |
14 | } | |
15 | } |