Search in sources :

Example 11 with BlockItem

use of net.minecraft.item.BlockItem in project Geolosys by oitsjustjose.

the class ModBlocks method registerItemBlocks.

public void registerItemBlocks(RegistryEvent.Register<Item> itemRegistryEvent) {
    for (Types.Ores oreType : Types.Ores.values()) {
        Item iBlock = new BlockItem(oreType.getBlock(), new Item.Properties().group(GeolosysGroup.getInstance())).setRegistryName(oreType.getBlock().getRegistryName());
        itemRegistryEvent.getRegistry().register(iBlock);
    }
    for (Types.Ores oreType : Types.Ores.values()) {
        Item iBlock = new BlockItem(oreType.getSample(), new Item.Properties().group(GeolosysGroup.getInstance())).setRegistryName(oreType.getSample().getRegistryName());
        itemRegistryEvent.getRegistry().register(iBlock);
    }
    for (Block extra : extras) {
        Item iBlock = new BlockItem(extra, new Item.Properties().group(GeolosysGroup.getInstance())).setRegistryName(extra.getRegistryName());
        itemRegistryEvent.getRegistry().register(iBlock);
    }
}
Also used : BlockItem(net.minecraft.item.BlockItem) Item(net.minecraft.item.Item) Block(net.minecraft.block.Block) BlockItem(net.minecraft.item.BlockItem)

Aggregations

BlockItem (net.minecraft.item.BlockItem)11 ItemStack (net.minecraft.item.ItemStack)5 Item (net.minecraft.item.Item)4 Block (net.minecraft.block.Block)2 BlockState (net.minecraft.block.BlockState)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 BlockRayTraceResult (net.minecraft.util.math.BlockRayTraceResult)2 SubscribeEvent (net.minecraftforge.eventbus.api.SubscribeEvent)2 BlockBPMicroblock (com.bluepowermod.block.BlockBPMicroblock)1 ItemSaw (com.bluepowermod.item.ItemSaw)1 BlockItemUseContextPublic (com.cjm721.overloaded.util.BlockItemUseContextPublic)1 ModBlocks (com.oitsjustjose.geolosys.common.blocks.ModBlocks)1 Nonnull (javax.annotation.Nonnull)1 ExperienceDroppingBlock (logictechcorp.libraryex.block.ExperienceDroppingBlock)1 FireSustainingBlock (logictechcorp.libraryex.block.FireSustainingBlock)1 ModBreakableBlock (logictechcorp.libraryex.block.ModBreakableBlock)1 PathBlock (logictechcorp.libraryex.block.PathBlock)1 IBookshelfBlock (net.darkhax.bookshelf.block.IBookshelfBlock)1 ClientPlayerEntity (net.minecraft.client.entity.player.ClientPlayerEntity)1 BufferBuilder (net.minecraft.client.renderer.BufferBuilder)1