Java Code Examples for cpw.mods.fml.common.registry.GameRegistry#registerItem()
The following examples show how to use
cpw.mods.fml.common.registry.GameRegistry#registerItem() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DefaultApiHandler.java From Gadomancy with GNU Lesser General Public License v3.0 | 6 votes |
@Override public boolean registerAdditionalGolemType(String name, String modId, AdditionalGolemType newType) { String uniqueName = name.toUpperCase(); if(!additionalGolemTypes.containsKey(uniqueName)) { GolemEnumHelper.addGolemType(uniqueName, newType); ItemAdditionalGolemPlacer placerItem = new ItemAdditionalGolemPlacer(newType); GameRegistry.registerItem(placerItem, "item" + StringHelper.firstToUpper(name.toLowerCase()) + "GolemPlacer"); newType.setModId(modId); newType.setPlacerItem(placerItem); additionalGolemTypes.put(uniqueName, newType); return true; } return false; }
Example 2
Source File: EtFuturum.java From Et-Futurum with The Unlicense | 6 votes |
@EventHandler public void init(FMLInitializationEvent event) { NetworkRegistry.INSTANCE.registerGuiHandler(instance, proxy); ModRecipes.init(); proxy.registerEvents(); proxy.registerEntities(); proxy.registerRenderers(); if (ModEntityList.hasEntitiesWithEggs()) { ModEntityList.entity_egg = new ItemEntityEgg(); GameRegistry.registerItem(ModEntityList.entity_egg, "entity_egg"); OreDictionary.registerOre("mobEgg", ModEntityList.entity_egg); } isTinkersConstructLoaded = Loader.isModLoaded("TConstruct"); }
Example 3
Source File: Registries.java From Ex-Aliquo with MIT License | 6 votes |
public static void registerItems() { if (ModsLoaded.isThaumcraftLoaded) { hammerThaum = new ThaumiumHammer(Configurations.thaumHammer).setUnlocalizedName("ExAliquo.ThaumHammer").registerItem().setCreativeTab(exatab); } hammerInvar = new AliquoHammer(Configurations.invarHammer, "invar").registerItem(); hammerCopper = new AliquoHammer(Configurations.copperHammer, "copper").registerItem(); hammerTin = new AliquoHammer(Configurations.tinHammer, "tin").registerItem(); hammerSilver = new AliquoHammer(Configurations.silverHammer, "silver").registerItem(); hammerLead = new AliquoHammer(Configurations.leadHammer, "lead").registerItem(); hammerPlatinum = new AliquoHammer(Configurations.platinumHammer, "platinum").registerItem(); hammerNickel = new AliquoHammer(Configurations.nickelHammer, "nickel").registerItem(); hammerAluminum = new AliquoHammer(Configurations.aluminumHammer, "aluminum").registerItem(); crookReed = new ReedCrook(Configurations.reedCrook).setUnlocalizedName("ExAliquo.ReedCrook").setCreativeTab(exatab); GameRegistry.registerItem(crookReed, "ExAliquo.ReedCrook"); crookGold = new GoldCrook(Configurations.goldCrook).setUnlocalizedName("ExAliquo.GoldCrook").setCreativeTab(exatab); GameRegistry.registerItem(crookGold, "ExAliquo.GoldCrook"); crookHay = new HayCrook(Configurations.hayCrook).setUnlocalizedName("ExAliquo.HayCrook").setCreativeTab(exatab); GameRegistry.registerItem(crookHay, "ExAliquo.HayCrook"); dragonEgg = new DragonEgg(Configurations.dragonEgg).setUnlocalizedName("ExAliquo.DragonEgg").setCreativeTab(exatab); GameRegistry.registerItem(dragonEgg, "ExAliquo.DragonEgg"); registerOreItems(); }
Example 4
Source File: BigReactors.java From BigReactors with MIT License | 5 votes |
public static ItemStack registerIngots(int id) { if (BigReactors.ingotGeneric == null) { BRConfig.CONFIGURATION.load(); registerYelloriumAsUranium = BRConfig.CONFIGURATION.get("Recipes", "registerYelloriumAsUranium", true, "If set, yellorium will be registered in the ore dictionary as ingotUranium as well as ingotYellorium. Otherwise, it will only be registered as ingotYellorium. (Default: true)").getBoolean(true); BigReactors.ingotGeneric = new ItemIngot(); GameRegistry.registerItem(ingotGeneric, "BRIngot"); // Register all generic ingots & dusts String itemName; for(int i = 0; i < ItemIngot.TYPES.length; i++) { itemName = ItemIngot.TYPES[i]; OreDictionary.registerOre(itemName, ingotGeneric.getItemStackForType(itemName)); } // Add aliases, if appropriate if(registerYelloriumAsUranium) { OreDictionary.registerOre("ingotUranium", ingotGeneric.getItemStackForType("ingotYellorium")); OreDictionary.registerOre("ingotPlutonium", ingotGeneric.getItemStackForType("ingotBlutonium")); OreDictionary.registerOre("dustUranium", ingotGeneric.getItemStackForType("dustYellorium")); OreDictionary.registerOre("dustPlutonium", ingotGeneric.getItemStackForType("dustBlutonium")); } BRConfig.CONFIGURATION.save(); } return new ItemStack(ingotGeneric); }
Example 5
Source File: ModItems.java From GardenCollection with MIT License | 5 votes |
public void init () { potteryPattern = new ItemPotteryPattern(makeName("potteryPattern")); potteryPatternDirty = new ItemPotteryPatternDirty(makeName("potteryPatternDirty")); GameRegistry.registerItem(potteryPattern, "pottery_pattern"); GameRegistry.registerItem(potteryPatternDirty, "pottery_pattern_dirty"); }
Example 6
Source File: RegisteredItems.java From Gadomancy with GNU Lesser General Public License v3.0 | 5 votes |
private static <T extends Item> T registerItem(String modId, T item, String name) { Injector modController = new Injector(new Injector(Loader.instance(), Loader.class).getField("modController"), LoadController.class); Object old = modController.getField("activeContainer"); modController.setField("activeContainer", Loader.instance().getIndexedModList().get(modId)); GameRegistry.registerItem(item, name); modController.setField("activeContainer", old); return item; }
Example 7
Source File: CommonProxy.java From ExtraCells1 with MIT License | 5 votes |
public void RegisterItems() { for (ItemEnum current : ItemEnum.values()) { try { current.setItemInstance(current.getItemClass().getConstructor(int.class).newInstance(current.getID())); GameRegistry.registerItem(current.getItemInstance(), current.getItemInstance().getUnlocalizedName(), "extracells"); } catch (Throwable e) { } } }
Example 8
Source File: SemiBlockManager.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
public static Item registerSemiBlock(String key, Class<? extends ISemiBlock> semiBlock, boolean addItem){ if(registeredTypes.containsKey(key)) throw new IllegalArgumentException("Duplicate registration key: " + key); registeredTypes.put(key, semiBlock); if(addItem) { ItemSemiBlockBase item = new ItemSemiBlockBase(key); GameRegistry.registerItem(item, key); PneumaticCraft.proxy.registerSemiBlockRenderer(item); registerSemiBlockToItemMapping(semiBlock, item); return item; } else { return null; } }
Example 9
Source File: WRAddonProxy.java From WirelessRedstone with MIT License | 4 votes |
private <T extends Item> T register(T item, String name) { item.setUnlocalizedName("wrcbe_addons:"+name).setTextureName("wrcbe_addons:"+name); item.setCreativeTab(CreativeTabs.tabRedstone); GameRegistry.registerItem(item, name); return item; }
Example 10
Source File: ModItems.java From LetsModReboot with GNU General Public License v3.0 | 4 votes |
public static void init() { GameRegistry.registerItem(mapleLeaf, Names.Items.MAPLE_LEAF); }
Example 11
Source File: BaseItemRegistry.java From Electro-Magic-Tools with GNU General Public License v3.0 | 4 votes |
public static void registerItems() { craftingComponents = new ItemCraftingComponents("components"); GameRegistry.registerItem(craftingComponents, "craftingComponents"); baseBaubles = new ItemBaseBaubles(); GameRegistry.registerItem(baseBaubles, "BaseBaubles"); materials = new ItemMaterials(); GameRegistry.registerItem(materials, "Materials"); thorHammer = new ItemThorHammer(); GameRegistry.registerItem(thorHammer, "ThorHammer"); thorHammerBroken = new ItemThorHammerBroken(); GameRegistry.registerItem(thorHammerBroken, "ThorHammerBroken"); focusChristmas = new ItemChristmasFocus(); GameRegistry.registerItem(focusChristmas, "FocusChristmas"); woodCarver = new ItemShardCarver(8).setUnlocalizedName(ModInformation.modid + ".carver.wood"); GameRegistry.registerItem(woodCarver, "woodCarver"); stoneCarver = new ItemShardCarver(32).setUnlocalizedName(ModInformation.modid + ".carver.stone"); GameRegistry.registerItem(stoneCarver, "stoneCarver"); ironCarver = new ItemShardCarver(128).setUnlocalizedName(ModInformation.modid + ".carver.iron"); GameRegistry.registerItem(ironCarver, "ironCarver"); obsidianCarver = new ItemShardCarver(256).setUnlocalizedName(ModInformation.modid + ".carver.obsidian"); GameRegistry.registerItem(obsidianCarver, "obsidianCarver"); diamondCarver = new ItemShardCarver(1204).setUnlocalizedName(ModInformation.modid + ".carver.diamond"); GameRegistry.registerItem(diamondCarver, "diamondCarver"); woodenDrill = new ItemVanillaDrill(Item.ToolMaterial.WOOD, 75, "drill_wood", new ItemStack(Item.getItemFromBlock(Blocks.planks))).setUnlocalizedName(ModInformation.modid + ".drill.wood"); GameRegistry.registerItem(woodenDrill, "woodenDrill"); stoneDrill = new ItemVanillaDrill(Item.ToolMaterial.STONE, 165, "drill_stone", new ItemStack(Item.getItemFromBlock(Blocks.cobblestone))).setUnlocalizedName(ModInformation.modid + ".drill.stone"); GameRegistry.registerItem(stoneDrill, "stoneDrill"); ironDrill = new ItemVanillaDrill(Item.ToolMaterial.IRON, 400, "drill_iron", new ItemStack(Items.iron_ingot)).setUnlocalizedName(ModInformation.modid + ".drill.iron"); GameRegistry.registerItem(ironDrill, "ironDrill"); goldenDrill = new ItemVanillaDrill(Item.ToolMaterial.GOLD, 55, "drill_gold", new ItemStack(Items.gold_ingot)).setUnlocalizedName(ModInformation.modid + ".drill.gold"); GameRegistry.registerItem(goldenDrill, "goldenDrill"); diamondDrill = new ItemVanillaDrill(Item.ToolMaterial.EMERALD, 2015, "drill_diamond", new ItemStack(Items.diamond)).setUnlocalizedName(ModInformation.modid + ".drill.diamond"); GameRegistry.registerItem(diamondDrill, "diamondDrill"); copperDrill = new ItemVanillaDrill(copperMaterial, 450, "drill_copper", OreDictionary.getOres("ingotCopper").get(0)).setUnlocalizedName(ModInformation.modid + ".drill.copper"); GameRegistry.registerItem(copperDrill, "copperDrill"); tinDrill = new ItemVanillaDrill(tinMaterial, 350, "drill_tin", OreDictionary.getOres("ingotTin").get(0)).setUnlocalizedName(ModInformation.modid + ".drill.tin"); GameRegistry.registerItem(tinDrill, "tinDrill"); leadDrill = new ItemVanillaDrill(leadMaterial, 400, "drill_lead", OreDictionary.getOres("ingotLead").get(0)).setUnlocalizedName(ModInformation.modid + ".drill.lead"); GameRegistry.registerItem(leadDrill, "leadDrill"); bronzeDrill = new ItemVanillaDrill(bronzeMaterial, 650, "drill_bronze", OreDictionary.getOres("ingotBronze").get(0)).setUnlocalizedName(ModInformation.modid + ".drill.bronze"); GameRegistry.registerItem(bronzeDrill, "bronzeDrill"); woodenChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.WOOD, 75, "chainsaw_wooden", Item.getItemFromBlock(Blocks.planks)).setUnlocalizedName(ModInformation.modid + ".chainsaw.wood"); GameRegistry.registerItem(woodenChainsaw, "woodenChainsaw"); stoneChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.STONE, 165, "chainsaw_stone", Item.getItemFromBlock(Blocks.cobblestone)).setUnlocalizedName(ModInformation.modid + ".chainsaw.stone"); GameRegistry.registerItem(stoneChainsaw, "stoneChainsaw"); ironChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.IRON, 315, "chainsaw_iron", Items.iron_ingot, 3F).setUnlocalizedName(ModInformation.modid + ".chainsaw.iron"); GameRegistry.registerItem(ironChainsaw, "ironChainsaw"); goldenChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.GOLD, 55, "chainsaw_gold", Items.gold_ingot).setUnlocalizedName(ModInformation.modid + ".chainsaw.gold"); GameRegistry.registerItem(goldenChainsaw, "goldenChainsaw"); diamondChainsaw = new ItemVanillaChainsaw(Item.ToolMaterial.EMERALD, 2015, "chainsaw_diamond", Items.diamond, 6F).setUnlocalizedName(ModInformation.modid + ".chainsaw.diamond"); GameRegistry.registerItem(diamondChainsaw, "diamondChainsaw"); copperChainsaw = new ItemVanillaChainsaw(copperMaterial, 450, "chainsaw_copper", OreDictionary.getOres("ingotCopper").get(0).getItem(), 3F).setUnlocalizedName(ModInformation.modid + ".chainsaw.copper"); GameRegistry.registerItem(copperChainsaw, "copperChainsaw"); tinChainsaw = new ItemVanillaChainsaw(tinMaterial, 350, "chainsaw_tin", OreDictionary.getOres("ingotTin").get(0).getItem(), 5F).setUnlocalizedName(ModInformation.modid + ".chainsaw.tin"); GameRegistry.registerItem(tinChainsaw, "tinChainsaw"); leadChainsaw = new ItemVanillaChainsaw(leadMaterial, 400, "chainsaw_lead", OreDictionary.getOres("ingotLead").get(0).getItem(), 3.5F).setUnlocalizedName(ModInformation.modid + ".chainsaw.lead"); GameRegistry.registerItem(leadChainsaw, "leadChainsaw"); bronzeChainsaw = new ItemVanillaChainsaw(bronzeMaterial, 650, "chainsaw_bronze", OreDictionary.getOres("ingotBronze").get(0).getItem(), 4F).setUnlocalizedName(ModInformation.modid + ".chainsaw.bronze"); GameRegistry.registerItem(bronzeChainsaw, "bronzeChainsaw"); ironOmnitool = new ItemVanillaOmnitool(Item.ToolMaterial.IRON, 500, "omnitool_iron", Items.iron_ingot).setUnlocalizedName(ModInformation.modid + ".omnitool.iron"); GameRegistry.registerItem(ironOmnitool, "ironOmnitool"); goldenOmnitool = new ItemVanillaOmnitool(Item.ToolMaterial.GOLD, 100, "omnitool_gold", Items.gold_ingot).setUnlocalizedName(ModInformation.modid + ".omnitool.gold"); GameRegistry.registerItem(goldenOmnitool, "goldenOmnitool"); diamondOmnitool = new ItemVanillaOmnitool(Item.ToolMaterial.EMERALD, 3900, "omnitool_diamond", Items.diamond).setUnlocalizedName(ModInformation.modid + ".omnitool.diamond"); GameRegistry.registerItem(diamondOmnitool, "diamondOmnitool"); copperOmnitool = new ItemVanillaOmnitool(copperMaterial, 850, "omnitool_copper", OreDictionary.getOres("ingotCopper").get(0).getItem()).setUnlocalizedName(ModInformation.modid + ".omnitool.copper"); GameRegistry.registerItem(copperOmnitool, "copperOmnitool"); tinOmnitool = new ItemVanillaOmnitool(tinMaterial, 640, "omnitool_tin", OreDictionary.getOres("ingotTin").get(0).getItem()).setUnlocalizedName(ModInformation.modid + ".omnitool.tin"); GameRegistry.registerItem(tinOmnitool, "tinOmnitool"); leadOmnitool = new ItemVanillaOmnitool(leadMaterial, 700, "omnitool_lead", OreDictionary.getOres("ingotLead").get(0).getItem()).setUnlocalizedName(ModInformation.modid + ".omnitool.lead"); GameRegistry.registerItem(leadOmnitool, "leadOmnitool"); bronzeOmnitool = new ItemVanillaOmnitool(bronzeMaterial, 950, "omnitool_bronze", OreDictionary.getOres("ingotBronze").get(0).getItem()).setUnlocalizedName(ModInformation.modid + ".omnitool.bronze"); GameRegistry.registerItem(bronzeOmnitool, "bronzeOmnitool"); }
Example 12
Source File: TranslocatorProxy.java From Translocators with MIT License | 4 votes |
public void init() { blockTranslocator = new BlockTranslocator(); blockTranslocator.setBlockName("translocator").setCreativeTab(CreativeTabs.tabRedstone); blockCraftingGrid = new BlockCraftingGrid(); blockCraftingGrid.setBlockName("craftingGrid"); blockCraftingGrid.setBlockTextureName("planks_oak"); itemDiamondNugget = new Item() .setUnlocalizedName("translocator:diamondNugget").setTextureName("translocator:diamondNugget") .setCreativeTab(CreativeTabs.tabMaterials); GameRegistry.registerItem(itemDiamondNugget, "diamondNugget"); OreDictionary.registerOre("nuggetDiamond", itemDiamondNugget); GameRegistry.registerBlock(blockTranslocator, ItemTranslocator.class, "translocator"); GameRegistry.registerBlock(blockCraftingGrid, "craftingGrid"); MinecraftForge.EVENT_BUS.register(blockTranslocator); MinecraftForge.EVENT_BUS.register(blockCraftingGrid); GameRegistry.registerTileEntity(TileItemTranslocator.class, "itemTranslocator"); GameRegistry.registerTileEntity(TileLiquidTranslocator.class, "liquidTranslocator"); GameRegistry.registerTileEntity(TileCraftingGrid.class, "craftingGrid"); PacketCustom.assignHandler(TranslocatorSPH.channel, new TranslocatorSPH()); GameRegistry.addRecipe(new ItemStack(blockTranslocator, 2, 0), "rer", "ipi", "rgr", 'r', Items.redstone, 'e', Items.ender_pearl, 'i', Items.iron_ingot, 'g', Items.gold_ingot, 'p', Blocks.piston); GameRegistry.addRecipe(new ItemStack(blockTranslocator, 2, 1), "rer", "ipi", "rlr", 'r', Items.redstone, 'e', Items.ender_pearl, 'i', Items.iron_ingot, 'l', new ItemStack(Items.dye, 1, 4), 'p', Blocks.piston); API.hideItem(new ItemStack(blockCraftingGrid)); GameRegistry.addShapelessRecipe(new ItemStack(Items.diamond), itemDiamondNugget, itemDiamondNugget, itemDiamondNugget, itemDiamondNugget, itemDiamondNugget, itemDiamondNugget, itemDiamondNugget, itemDiamondNugget, itemDiamondNugget); GameRegistry.addShapelessRecipe(new ItemStack(itemDiamondNugget, 9), Items.diamond); }
Example 13
Source File: Itemss.java From PneumaticCraft with GNU General Public License v3.0 | 4 votes |
public static void registerItem(Item item, String registerName){ GameRegistry.registerItem(item, registerName, Names.MOD_ID); ThirdPartyManager.instance().onItemRegistry(item); //GameData.newItemAdded(item); }
Example 14
Source File: FramezItems.java From Framez with GNU General Public License v3.0 | 4 votes |
public static void register() { GameRegistry.registerItem(frame, References.Item.FRAME); GameRegistry.registerItem(wrench, References.Item.WRENCH); }
Example 15
Source File: BigReactors.java From BigReactors with MIT License | 4 votes |
public static void registerItems() { if(itemDebugTool == null) { itemDebugTool = new ItemBeefDebugTool(); GameRegistry.registerItem(itemDebugTool, "BRDebugTool"); } }
Example 16
Source File: RegisteredItems.java From Gadomancy with GNU Lesser General Public License v3.0 | 4 votes |
private static <T extends Item> T registerItem(T item, String name) { GameRegistry.registerItem(item, name); return item; }
Example 17
Source File: ItemRegistered.java From SimplyJetpacks with MIT License | 4 votes |
public ItemRegistered(String registryName) { GameRegistry.registerItem(this, registryName); }
Example 18
Source File: Chisel.java From Chisel with GNU General Public License v2.0 | 4 votes |
@EventHandler public void preInit(FMLPreInitializationEvent event) { File configFile = event.getSuggestedConfigurationFile(); Configurations.configExists = configFile.exists(); Configurations.config = new Configuration(configFile); Configurations.config.load(); Configurations.refreshConfig(); tabChisel = new CreativeTabs("tabChisel") { @Override public Item getTabIconItem() { return chisel; } }; chisel = (ItemChisel) new ItemChisel(Carving.chisel).setTextureName("chisel:chisel").setCreativeTab(CreativeTabs.tabTools); GameRegistry.registerItem(chisel, "chisel"); if(Configurations.featureEnabled("cloud")) { itemCloudInABottle = (ItemCloudInABottle) new ItemCloudInABottle().setTextureName("Chisel:cloudinabottle").setCreativeTab(CreativeTabs.tabTools); EntityRegistry.registerModEntity(EntityCloudInABottle.class, "CloudInABottle", 1, this, 40, 1, true); GameRegistry.registerItem(itemCloudInABottle, "cloudinabottle"); } if(Configurations.featureEnabled("ballOfMoss")) { itemBallOMoss = (ItemBallOMoss) new ItemBallOMoss().setTextureName("Chisel:ballomoss").setCreativeTab(CreativeTabs.tabTools); EntityRegistry.registerModEntity(EntityBallOMoss.class, "BallOMoss", 2, this, 40, 1, true); GameRegistry.registerItem(itemBallOMoss, "ballomoss"); } if(Configurations.featureEnabled("smashingRock")) { smashingRock = (ItemSmashingRock) new ItemSmashingRock().setTextureName("Chisel:smashingrock").setCreativeTab(CreativeTabs.tabTools); EntityRegistry.registerModEntity(EntitySmashingRock.class, "SmashingRock", 2, this, 40, 1, true); GameRegistry.registerItem(smashingRock, "smashingrock"); } ChiselBlocks.load(); proxy.preInit(); }
Example 19
Source File: GT_TileEntity_THTR.java From bartworks with MIT License | 4 votes |
public static void registeraTHR_Materials(){ GameRegistry.registerItem(GT_TileEntity_THTR.THTRMaterials.aTHTR_Materials,"bw.THTRMaterials"); }
Example 20
Source File: BioItemList.java From bartworks with MIT License | 4 votes |
public static void registerBioItems(){ GameRegistry.registerItem(BioItemList.mItemBioLabParts, "BioLabModules"); GameRegistry.registerItem(BioItemList.vanillaBioLabParts, "BioLabParts"); }