@Nullable private ItemBlock constructItemFromBlock( Block block ) { if( this.disableItem ) { return null; } if( this.itemFactory != null ) { return this.itemFactory.apply( block ); } else if( block instanceof AEBaseBlock ) { return new AEBaseItemBlock( block ); } else { return new ItemBlock( block ); } } }
@Override public ItemBlock getItem() { return new ItemBlock(this); } }
@Override public ItemBlock getItem() { return new ItemBlock(this); } }
@Override public ItemBlock getItem() { return new ItemBlock(this); } }
@Override public ItemBlock getItem() { return new ItemBlock(this); } }
@Override public ItemBlock getItem() { return new ItemBlock(this); } }
private static void registerMarket() { pamMarket = new BlockPamMarket(); marketItemBlock = new ItemBlock(pamMarket); ItemRegistry.items.put(marketItemName, marketItemBlock); registerBlock(marketItemName, marketItemBlock, pamMarket); pamShippingbin = new BlockPamShippingBin(); shippingbinItemBlock = new ItemBlock(pamShippingbin); ItemRegistry.items.put(shippingbinItemName, shippingbinItemBlock); registerBlock(shippingbinItemName, shippingbinItemBlock, pamShippingbin); }
private static void registerGrinder() { grinder = new GrinderBlock(); grinderItemBlock = new ItemBlock(grinder); ItemRegistry.items.put(GrinderBlock.registryName, grinderItemBlock); registerBlock(GrinderBlock.registryName, grinderItemBlock, grinder); }
final Item uvlblockItem = new ItemBlock( uvlblock ).setRegistryName( uvlblockR );
/** * Registery block at gameregistry. * * @param registry the registry to use. */ @Override public void registerItemBlock(final IForgeRegistry<Item> registry) { registry.register((new ItemBlock(this)).setRegistryName(this.getRegistryName())); } }
/** * Registery block at gameregistry. * * @param registry the registry to use. */ @Override public void registerItemBlock(final IForgeRegistry<Item> registry) { registry.register((new ItemBlock(this)).setRegistryName(this.getRegistryName())); } }
@SubscribeEvent public static void registerItemBlocks(RegistryEvent.Register<Item> event) { LOGGER.info("Registering ItemBlocks"); ThEBlocks.BLOCKS.forEach(block -> event.getRegistry().register(new ItemBlock(block).setRegistryName(block.getRegistryName()))); }
private static void registerItemBlock(IForgeRegistry<Item> registry, Block block) { Item item = new ItemBlock(block); ResourceLocation registryName = block.getRegistryName(); // noinspection ConstantConditions registry.register(item.setRegistryName(registryName)); } }
@Override public boolean preInit() { this.setRegistryName("fluid_ender"); ForgeRegistries.BLOCKS.register(this); ItemBlock itemBlock = new ItemBlock(this); itemBlock.setRegistryName(this.getRegistryName()); ForgeRegistries.ITEMS.register(itemBlock); config(); return true; }
@Override public boolean preInit() { this.setRegistryName("fluid_crude_oil"); ForgeRegistries.BLOCKS.register(this); ItemBlock itemBlock = new ItemBlock(this); itemBlock.setRegistryName(this.getRegistryName()); ForgeRegistries.ITEMS.register(itemBlock); config(); return true; }
@Override public boolean preInit() { this.setRegistryName("fluid_aerotheum"); ForgeRegistries.BLOCKS.register(this); ItemBlock itemBlock = new ItemBlock(this); itemBlock.setRegistryName(this.getRegistryName()); ForgeRegistries.ITEMS.register(itemBlock); config(); return true; }
public static void preInitCommon() { // each instance of your block should have a name that is unique within your mod. use lower case. blockFlameEmitter = (BlockFlameEmitter)(new BlockFlameEmitter().setUnlocalizedName("mbe50_block_flame_emitter_unlocalised_name")); blockFlameEmitter.setRegistryName("mbe50_block_flame_emitter_registry_name"); ForgeRegistries.BLOCKS.register(blockFlameEmitter); // We also need to create and register an ItemBlock for this block otherwise it won't appear in the inventory itemBlockFlameEmitter = new ItemBlock(blockFlameEmitter); itemBlockFlameEmitter.setRegistryName(blockFlameEmitter.getRegistryName()); ForgeRegistries.ITEMS.register(itemBlockFlameEmitter); }
@Load public void loadFruits() { register(); getInstanceMap(BlockFruitSapling.class).values().forEach(sapling -> ForgeRegistries.ITEMS.register(new ItemBlock(sapling).setTranslationKey(NameBuilder.buildUnlocalizedName(sapling.getType().toString(), "sapling")).setRegistryName(FoodCraftReloadedMod.MODID, NameBuilder.buildRegistryName(sapling.getType().toString(), "sapling")).setCreativeTab(FCRCreativeTabs.BASE))); }
@Override public boolean preInit() { this.setRegistryName("fluid_petrotheum"); ForgeRegistries.BLOCKS.register(this); ItemBlock itemBlock = new ItemBlock(this); itemBlock.setRegistryName(this.getRegistryName()); ForgeRegistries.ITEMS.register(itemBlock); config(); addInteractions(); return true; }
public static Block registerBlock (Block block, Class<? extends TileEntity> tileEntityClass, String name) { block.setRegistryName(name); GameRegistry.registerTileEntity(tileEntityClass, block.getRegistryName().toString()); block.setCreativeTab(tab); registerItem(new ItemBlock(block), name); blocks.add(block); return block; }