Java Code Examples for net.minecraft.item.Item.setRegistryName()

The following are Jave code examples for showing how to use setRegistryName() of the net.minecraft.item.Item class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: Randores2   File: CraftingItems.java   View Source Code Vote up 5 votes
public static void init() {
    items = new ArrayList<>();

    craftiniumLump = new Item().setUnlocalizedName("craftinium_lump").setCreativeTab(Randores.TAB_CRAFTING);
    items.add(craftiniumLump);

    tome = new TomeItem().setUnlocalizedName("material_tome").setMaxStackSize(1);
    tome.setCreativeTab(new TomeTab());
    items.add(tome);

    for(Item item : items) {
        item.setRegistryName(item.getUnlocalizedName().substring(5));
    }
}
 
Example 2
Project: Anima-Mundi   File: AnimaItems.java   View Source Code Vote up 5 votes
public static void generalRegisterItem(String name, Item item, boolean genericModel)
{
	item.setUnlocalizedName(ModConstants.MODID + ":" + name);
	item.setRegistryName(name);
	item.setCreativeTab(AnimaTab.Tab);

	if(genericModel)
		items.add(item);
}
 
Example 3
Project: customstuff4   File: ContentBlockBase.java   View Source Code Vote up 5 votes
protected void initItem(Item item, ContentHelper helper)
{
    this.item = item;

    item.setUnlocalizedName(helper.getModId() + "." + id);
    item.setRegistryName(id);
}
 
Example 4
Project: Soot   File: Registry.java   View Source Code Vote up 4 votes
public static void registerItem(String id,Item item)
{
    item.setRegistryName(Soot.MODID,id);
    item.setUnlocalizedName(id);
    registerItem(item,true);
}
 
Example 5
Project: Randores2   File: RandoresItems.java   View Source Code Vote up 4 votes
public static void init() {
    items = new ArrayList<>();

    RandoresTab materialsTab = null;
    for(MaterialType type : Randores.getDefaultMaterials()) {
        RandoresMaterial material = new RandoresMaterial(type);
        material.setUnlocalizedName(type.getName()).setCreativeTab(materialsTab == null ? (materialsTab = new RandoresTab("randores_materials", material)) : materialsTab);
        items.add(material);
        RandoresItemRegistry.instance().register(material);
    }

    pickaxe = new RandoresItem(RandoresKeys.PICKAXE);
    pickaxe.setUnlocalizedName(RandoresKeys.PICKAXE).setCreativeTab(new RandoresTab("randores_pickaxes", pickaxe));
    items.add(pickaxe);

    axe = new RandoresItem(RandoresKeys.AXE);
    axe.setUnlocalizedName(RandoresKeys.AXE).setCreativeTab(new RandoresTab("randores_axes", axe));
    items.add(axe);

    shovel = new RandoresItem(RandoresKeys.SHOVEL);
    shovel.setUnlocalizedName(RandoresKeys.SHOVEL).setCreativeTab(new RandoresTab("randores_spades", shovel));
    items.add(shovel);

    hoe = new RandoresItem(RandoresKeys.HOE);
    hoe.setUnlocalizedName(RandoresKeys.HOE).setCreativeTab(new RandoresTab("randores_hoes", hoe));
    items.add(hoe);

    sword = new RandoresItem(RandoresKeys.SWORD);
    sword.setUnlocalizedName(RandoresKeys.SWORD).setCreativeTab(new RandoresTab("randores_swords", sword));
    items.add(sword);

    bow = new RandoresBow(ComponentType.craftable(RandoresKeys.BOW));
    bow.setUnlocalizedName(RandoresKeys.BOW).setCreativeTab(new RandoresTab("randores_bows", bow));
    items.add(bow);

    stick = new RandoresBasicItem(ComponentType.craftable(RandoresKeys.STICK));
    stick.setUnlocalizedName(RandoresKeys.STICK).setCreativeTab(new RandoresTab("randores_sticks", stick));
    items.add(stick);

    battleaxe = new RandoresBattleaxe(ComponentType.craftable(RandoresKeys.BATTLEAXE));
    battleaxe.setUnlocalizedName(RandoresKeys.BATTLEAXE).setCreativeTab(new RandoresTab("randores_battleaxes", battleaxe));
    items.add(battleaxe);

    sledgehammer = new RandoresSledgehammer(ComponentType.craftable(RandoresKeys.SLEDGEHAMMER));
    sledgehammer.setUnlocalizedName(RandoresKeys.SLEDGEHAMMER).setCreativeTab(new RandoresTab("randores_sledgehammers", sledgehammer));
    items.add(sledgehammer);

    helmet = new RandoresItemArmor(CraftableTypeRegistry.instance().get(RandoresKeys.HELMET));
    helmet.setUnlocalizedName(RandoresKeys.HELMET).setCreativeTab(Randores.TAB_ARMOR);
    items.add(helmet);

    chestplate = new RandoresItemArmor(CraftableTypeRegistry.instance().get(RandoresKeys.CHESTPLATE));
    chestplate.setUnlocalizedName(RandoresKeys.CHESTPLATE).setCreativeTab(Randores.TAB_ARMOR);
    items.add(chestplate);

    leggings = new RandoresItemArmor(CraftableTypeRegistry.instance().get(RandoresKeys.LEGGINGS));
    leggings.setUnlocalizedName(RandoresKeys.LEGGINGS).setCreativeTab(Randores.TAB_ARMOR);
    items.add(leggings);

    boots = new RandoresItemArmor(CraftableTypeRegistry.instance().get(RandoresKeys.BOOTS));
    boots.setUnlocalizedName(RandoresKeys.BOOTS).setCreativeTab(Randores.TAB_ARMOR);
    items.add(boots);

    for(Item item : items) {
        item.setRegistryName(item.getUnlocalizedName().substring(5));
    }
}
 
Example 6
Project: Randores2   File: RandoresBlocks.java   View Source Code Vote up 4 votes
public static void init() {
    blocks = new ArrayList<>();

    blockItems = new ArrayList<>();
    RandoresTab oreTab = null;
    for(OreType oreType : Randores.getDefaultOres()) {
        for(MaterialType materialType : Randores.getDefaultMaterials()) {
            RandoresOre ore = new RandoresOre(Material.ROCK, oreType, materialType);

            RandoresItemBlock oreItem = new RandoresItemBlock(ore);
            oreItem.setUnlocalizedName(RandoresKeys.ORE + "_" + materialType.getOreName() + "_" + oreType.getName());
            blockItems.add(oreItem);

            ore.setUnlocalizedName(RandoresKeys.ORE + "_" + materialType.getOreName() + "_" + oreType.getName()).setHardness(3.0F).setResistance(5.0F).setCreativeTab(oreTab == null ? (oreTab = new RandoresTab("randores_ores", ore)) : oreTab);
            blocks.add(ore);
            RandoresItemRegistry.instance().register(ore);
        }
    }

    brick = new RandoresBlock(Material.ROCK, ComponentType.craftable(CraftableTypeRegistry.instance().get(RandoresKeys.BRICKS)), SoundType.STONE);
    brick.setHarvestLevel("pickaxe", 1);

    brickItem = new RandoresItemBlock(brick);
    brickItem.setUnlocalizedName(RandoresKeys.BRICKS);
    blockItems.add(brickItem);

    brick.setUnlocalizedName(RandoresKeys.BRICKS).setHardness(2f).setResistance(10f).setCreativeTab(new RandoresTab("randores_bricks", brick));
    blocks.add(brick);


    torch = new RandoresTorch();

    torchItem = new RandoresItemBlock(torch);
    torchItem.setUnlocalizedName(RandoresKeys.TORCH);
    blockItems.add(torchItem);

    torch.setUnlocalizedName(RandoresKeys.TORCH).setHardness(0.0F).setLightLevel(0.9375F).setCreativeTab(new RandoresTab("randores_torches", torch));
    blocks.add(torch);

    for(Item item : blockItems) {
        item.setRegistryName(item.getUnlocalizedName().substring(5));
    }

    for(Block block : blocks) {
        block.setRegistryName(block.getUnlocalizedName().substring(5));
    }
}
 
Example 7
Project: Randores2   File: CraftingBlocks.java   View Source Code Vote up 4 votes
public static void init() {
    blocks = new ArrayList<>();

    craftiniumTable = new CraftiniumTable();
    craftiniumTable.setCreativeTab(Randores.TAB_CRAFTING);
    blocks.add(craftiniumTable);

    craftiniumForge = new CraftiniumForge(false);
    craftiniumForge.setCreativeTab(Randores.TAB_CRAFTING);
    blocks.add(craftiniumForge);

    craftiniumOre = new CraftiniumOre();
    craftiniumOre.setCreativeTab(Randores.TAB_CRAFTING);
    blocks.add(craftiniumOre);

    craftiniumConverter = new CraftiniumConverter();
    craftiniumConverter.setCreativeTab(Randores.TAB_CRAFTING);
    blocks.add(craftiniumConverter);

    craftiniumForgeLit = new CraftiniumForge(true);
    blocks.add(craftiniumForgeLit);


    blockItems = new ArrayList<>();

    tableItem = new ItemBlock(craftiniumTable);
    tableItem.setUnlocalizedName("craftinium_table");
    blockItems.add(tableItem);

    forgeItem = new ItemBlock(craftiniumForge);
    forgeItem.setUnlocalizedName("craftinium_forge");
    blockItems.add(forgeItem);

    forgeLitItem = new ItemBlock(craftiniumForgeLit);
    forgeLitItem.setUnlocalizedName("craftinium_forge_lit");
    blockItems.add(forgeLitItem);

    converterItem = new ItemBlock(craftiniumConverter);
    converterItem.setUnlocalizedName("craftinium_converter");
    blockItems.add(converterItem);

    oreItem = new ItemBlock(craftiniumOre);
    oreItem.setUnlocalizedName("craftinium_ore");
    blockItems.add(oreItem);

    for(Item item : blockItems) {
        item.setRegistryName(item.getUnlocalizedName().substring(5));
    }

    for(Block block : blocks) {
        block.setRegistryName(block.getUnlocalizedName().substring(5));
    }
}
 
Example 8
Project: Genesis   File: GenesisItems.java   View Source Code Vote up 4 votes
private static void registerItem(final IForgeRegistry<Item> registry, final Item item, final String name) {
    item.setRegistryName(GenesisMod.MOD_ID, name);
    item.setUnlocalizedName(GenesisMod.MOD_ID + "." + name);
    registry.register(item);
    ITEMS.add(item);
}
 
Example 9
Project: CompositeGear   File: ItemsCG.java   View Source Code Vote up 4 votes
public static Item registerItem(Item item, ResourceLocation rl) {
	item.setRegistryName(rl);
	return registerItem(item);
}