Jump to content

Recommended Posts

Posted

I'm trying to make some tools and armor for my mod but certain parts in the text get highlighted red, I've tried everything but I just don't know how to fix it. This is the only class with those kind of errors.

 

package com.mineralz.init;

import com.mineralz.Mineralz;
import com.mineralz.Reference;

import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class MineralzItems {

private static final String mineralz = null;

//Items
public static Item tin_ingot;
public static Item copper_ingot;
public static Item bronze_ingot;
public static Item silver_ingot;
public static Item platinum_ingot;
public static Item silver_nugget;
public static Item platinum_nugget;
public static Item ruby;
public static Item sapphire;
public static Item amethyst;
public static Item onyx;

// Tools
public static Item.ToolMaterial tin_pickaxe = EnumHelper.addToolMaterial("tin_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial tin_shovel = EnumHelper.addToolMaterial("tin_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial tin_axe = EnumHelper.addToolMaterial("tin_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial tin_hoe = EnumHelper.addToolMaterial("tin_hoe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial copper_pickaxe = EnumHelper.addToolMaterial("copper_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial copper_shovel = EnumHelper.addToolMaterial("copper_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial copper_axe = EnumHelper.addToolMaterial("copper_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial copper_hoe = EnumHelper.addToolMaterial("copper_hoe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial bronze_pickaxe = EnumHelper.addToolMaterial("bronze_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial bronze_shovel = EnumHelper.addToolMaterial("bronze_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial bronze_axe = EnumHelper.addToolMaterial("bronze_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial bronze_hoe = EnumHelper.addToolMaterial("bronze_hoe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial silver_pickaxe = EnumHelper.addToolMaterial("silver_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial silver_shovel = EnumHelper.addToolMaterial("silver_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial silver_axe = EnumHelper.addToolMaterial("silver_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial silver_hoe = EnumHelper.addToolMaterial("silver_hoe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial platinum_pickaxe = EnumHelper.addToolMaterial("platinum_pickaxe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial platinum_shovel = EnumHelper.addToolMaterial("platinum_shovel", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial platinum_axe = EnumHelper.addToolMaterial("platinum_axe", 2, 125, 2.0F, 2.0F, 30);
public static Item.ToolMaterial platinum_hoe = EnumHelper.addToolMaterial("platinum_hoe", 2, 125, 2.0F, 2.0F, 30);

//Weapons
public static Item tin_sword;
public static Item copper_sword;
public static Item bronze_sword;
public static Item silver_sword;
public static Item platinum_sword;

//Armor

public static ArmorMaterial tin_helmet = EnumHelper.addArmorMaterial("tin_helmet", mineralz, 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial tin_chestplate = EnumHelper.addArmorMaterial("tin_chestplate", "mineralz", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial tin_leggings = EnumHelper.addArmorMaterial("tin_leggings", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial tin_boots = EnumHelper.addArmorMaterial("tin_boots", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial copper_helmet = EnumHelper.addArmorMaterial("copper_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial copper_chestplate = EnumHelper.addArmorMaterial("copper_chestplate", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial copper_leggings = EnumHelper.addArmorMaterial("copper_leggings", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial copper_boots = EnumHelper.addArmorMaterial("copper_boots", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial bronze_helmet = EnumHelper.addArmorMaterial("bronze_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial bronze_chestplate = EnumHelper.addArmorMaterial("bronze_chestplate", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial bronze_leggings = EnumHelper.addArmorMaterial("bronze_leggings", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial bronze_boots = EnumHelper.addArmorMaterial("bronze_boots", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_iron);
public static ArmorMaterial silver_helmet = EnumHelper.addArmorMaterial("silver_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial silver_chestplate = EnumHelper.addArmorMaterial("silver_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial silver_leggings = EnumHelper.addArmorMaterial("silver_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial silver_boots = EnumHelper.addArmorMaterial("silver_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial platinum_helmet = EnumHelper.addArmorMaterial("platinum_helmet", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial platinum_chestplate = EnumHelper.addArmorMaterial("platinum_chestplate", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial platinum_leggings = EnumHelper.addArmorMaterial("platinum_leggings", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);
public static ArmorMaterial platinum_boots = EnumHelper.addArmorMaterial("platinum_boots", "mineralz:", 125, 3, 30, SoundEvents.item_armor_equip_gold);

public static void init() {

	//Items
	tin_ingot = new Item().setUnlocalizedName("tin_ingot").setCreativeTab(Mineralz.tabMineralz);
	copper_ingot = new Item().setUnlocalizedName("copper_ingot").setCreativeTab(Mineralz.tabMineralz);
	bronze_ingot = new Item().setUnlocalizedName("bronze_ingot").setCreativeTab(Mineralz.tabMineralz);
	silver_ingot = new Item().setUnlocalizedName("silver_ingot").setCreativeTab(Mineralz.tabMineralz);
	platinum_ingot = new Item().setUnlocalizedName("platinum_ingot").setCreativeTab(Mineralz.tabMineralz);
	silver_nugget = new Item().setUnlocalizedName("silver_nugget").setCreativeTab(Mineralz.tabMineralz);
	platinum_nugget = new Item().setUnlocalizedName("platinum_nugget").setCreativeTab(Mineralz.tabMineralz);
	ruby = new Item().setUnlocalizedName("ruby").setCreativeTab(Mineralz.tabMineralz);
	sapphire = new Item().setUnlocalizedName("sapphire").setCreativeTab(Mineralz.tabMineralz);
	amethyst = new Item().setUnlocalizedName("amethyst").setCreativeTab(Mineralz.tabMineralz);
	onyx = new Item().setUnlocalizedName("onyx").setCreativeTab(Mineralz.tabMineralz);

	//Tools
	tin_pickaxe = new Item().setUnlocalizedName("tin_Pickaxe").setCreativeTab(Mineralz.tabMineralz);
	tin_shovel = new Item().setUnlocalizedName("tin_shovel").setCreativeTab(Mineralz.tabMineralz);
	tin_axe = new Item().setUnlocalizedName("tin_axe").setCreativeTab(Mineralz.tabMineralz);
	tin_hoe = new Item().setUnlocalizedName("tin_hoe").setCreativeTab(Mineralz.tabMineralz);
	copper_pickaxe = new Item().setUnlocalizedName("copper_pickaxe").setCreativeTab(Mineralz.tabMineralz);
	copper_shovel = new Item().setUnlocalizedName("copper_shovel").setCreativeTab(Mineralz.tabMineralz);
	copper_axe = new Item().setUnlocalizedName("copper_axe").setCreativeTab(Mineralz.tabMineralz);
	copper_hoe = new Item().setUnlocalizedName("copper_hoe").setCreativeTab(Mineralz.tabMineralz);
	bronze_pickaxe = new Item().setUnlocalizedName("bronze_pickaxe").setCreativeTab(Mineralz.tabMineralz);
	bronze_shovel = new Item().setUnlocalizedName("bronze_shovel").setCreativeTab(Mineralz.tabMineralz);
	bronze_axe = new Item().setUnlocalizedName("bronze_axe").setCreativeTab(Mineralz.tabMineralz);
	bronze_hoe = new Item().setUnlocalizedName("bronze_hoe").setCreativeTab(Mineralz.tabMineralz);
	silver_pickaxe = new Item().setUnlocalizedName("silver_pickaxe").setCreativeTab(Mineralz.tabMineralz);
	silver_shovel = new Item().setUnlocalizedName("silver_shovel").setCreativeTab(Mineralz.tabMineralz);
	silver_axe = new Item().setUnlocalizedName("silver_axe").setCreativeTab(Mineralz.tabMineralz);
	silver_hoe = new Item().setUnlocalizedName("silver_hoe").setCreativeTab(Mineralz.tabMineralz);
	platinum_pickaxe = new Item().setUnlocalizedName("platinum_pickaxe").setCreativeTab(Mineralz.tabMineralz);
	platinum_shovel = new Item().setUnlocalizedName("platinum_shovel").setCreativeTab(Mineralz.tabMineralz);
	platinum_axe = new Item().setUnlocalizedName("platinum_axe").setCreativeTab(Mineralz.tabMineralz);
	platinum_hoe = new Item().setUnlocalizedName("platinum_hoe").setCreativeTab(Mineralz.tabMineralz);

	//Weapons
	tin_sword = new Item().setUnlocalizedName("tin_sword").setCreativeTab(Mineralz.tabMineralz);
	copper_sword = new Item().setUnlocalizedName("copper_sword").setCreativeTab(Mineralz.tabMineralz);
	bronze_sword = new Item().setUnlocalizedName("bronze_sword").setCreativeTab(Mineralz.tabMineralz);
	silver_sword = new Item().setUnlocalizedName("silver_sword").setCreativeTab(Mineralz.tabMineralz);
	platinum_sword = new Item().setUnlocalizedName("platinum_sword").setCreativeTab(Mineralz.tabMineralz);

	//Armor
	tin_helmet = new MineralzArmor(4, 6, true).setUnlocalizedName(null, tin_helmet, 1, 0).setUnlocalizedName("tin_helmet").setCreativeTab(Mineralz.tabMineralz);
	tin_chestplate = new MineralzArmor().setUnlocalizedName("tin_chestplate").setCreativeTab(Mineralz.tabMineralz);
	tin_leggings = new MineralzArmor().setUnlocalizedName("tin_leggings").setCreativeTab(Mineralz.tabMineralz);
	tin_boots = new MineralzArmor().setUnlocalizedName("tin_boots").setCreativeTab(Mineralz.tabMineralz);
	copper_helmet = new MineralzArmor().setUnlocalizedName("copper_helmet").setCreativeTab(Mineralz.tabMineralz);
	copper_chestplate = new MineralzArmor().setUnlocalizedName("copper_chestplate").setCreativeTab(Mineralz.tabMineralz);
	copper_leggings = new MineralzArmor().setUnlocalizedName("copper_leggings").setCreativeTab(Mineralz.tabMineralz);
	copper_boots = new MineralzArmor().setUnlocalizedName("copper_boots").setCreativeTab(Mineralz.tabMineralz);
	bronze_helmet = new MineralzArmor().setUnlocalizedName("bronze_helmet").setCreativeTab(Mineralz.tabMineralz);
	bronze_chestplate = new MineralzArmor().setUnlocalizedName("bronze_chestplate").setCreativeTab(Mineralz.tabMineralz);
	bronze_leggings = new MineralzArmor().setUnlocalizedName("bronze_leggings").setCreativeTab(Mineralz.tabMineralz);
	bronze_boots = new MineralzArmor().setUnlocalizedName("bronze_boots").setCreativeTab(Mineralz.tabMineralz);
	silver_helmet = new MineralzArmor().setUnlocalizedName("silver_helmet").setCreativeTab(Mineralz.tabMineralz);
	silver_chestplate = new MineralzArmor().setUnlocalizedName("silver_chestplate").setCreativeTab(Mineralz.tabMineralz);
	silver_leggings = new MineralzArmor().setUnlocalizedName("silver_leggings").setCreativeTab(Mineralz.tabMineralz);
	silver_boots = new MineralzArmor().setUnlocalizedName("silver_boots").setCreativeTab(Mineralz.tabMineralz);
	platinum_helmet = new MineralzArmor().setUnlocalizedName("platinum_helmet").setCreativeTab(Mineralz.tabMineralz);
	platinum_chestplate = new MineralzArmor().setUnlocalizedName("platinum_chestplate").setCreativeTab(Mineralz.tabMineralz);
	platinum_leggings = new MineralzArmor().setUnlocalizedName("platinum_leggings").setCreativeTab(Mineralz.tabMineralz);
	platinum_boots = new MineralzArmor().setUnlocalizedName("platinum_boots").setCreativeTab(Mineralz.tabMineralz);

}

public static void register() {
	registerItem(tin_ingot); 
	registerItem(copper_ingot);
	registerItem(bronze_ingot);
	registerItem(silver_ingot);
	registerItem(platinum_ingot);
	registerItem(silver_nugget);
	registerItem(platinum_nugget);
	registerItem(ruby);
	registerItem(sapphire);
	registerItem(amethyst);
	registerItem(onyx);
	registerItem(tin_helmet);
	registerItem(tin_chestplate);
	registerItem(tin_leggings);
	registerItem(tin_boots);
	registerItem(tin_sword);
	registerItem(tin_pickaxe);
	registerItem(tin_shovel);
	registerItem(tin_axe);
	registerItem(tin_hoe);
	registerItem(copper_helmet);
	registerItem(copper_chestplate);
	registerItem(copper_leggings);
	registerItem(copper_boots);
	registerItem(copper_sword);
	registerItem(copper_pickaxe);
	registerItem(copper_shovel);
	registerItem(copper_axe);
	registerItem(copper_hoe);
	registerItem(bronze_helmet);
	registerItem(bronze_chestplate);
	registerItem(bronze_leggings);
	registerItem(bronze_boots);
	registerItem(bronze_sword);
	registerItem(bronze_pickaxe);
	registerItem(bronze_shovel);
	registerItem(bronze_axe);
	registerItem(bronze_hoe);
	registerItem(silver_helmet);
	registerItem(silver_chestplate);
	registerItem(silver_leggings);
	registerItem(silver_boots);
	registerItem(silver_sword);
	registerItem(silver_pickaxe);
	registerItem(silver_shovel);
	registerItem(silver_axe);
	registerItem(silver_hoe);
	registerItem(platinum_helmet);
	registerItem(platinum_chestplate);
	registerItem(platinum_leggings);
	registerItem(platinum_boots);
	registerItem(platinum_sword);
	registerItem(platinum_pickaxe);
	registerItem(platinum_shovel);
	registerItem(platinum_axe);
	registerItem(platinum_hoe);
}

public static void registerRenders() {
	registerRender(tin_ingot); 
	registerRender(copper_ingot);
	registerRender(bronze_ingot);
	registerRender(silver_ingot);
	registerRender(platinum_ingot);
	registerRender(silver_nugget);
	registerRender(platinum_nugget);
	registerRender(ruby);
	registerRender(sapphire);
	registerRender(amethyst);
	registerRender(onyx);
	registerRender(tin_helmet);
	registerRender(tin_chestplate);
	registerRender(tin_leggings);
	registerRender(tin_boots);
	registerRender(tin_sword);
	registerRender(tin_pickaxe);
	registerRender(tin_shovel);
	registerRender(tin_axe);
	registerRender(tin_hoe);
	registerRender(copper_helmet);
	registerRender(copper_chestplate);
	registerRender(copper_leggings);
	registerRender(copper_boots);
	registerRender(copper_sword);
	registerRender(copper_pickaxe);
	registerRender(copper_shovel);
	registerRender(copper_axe);
	registerRender(copper_hoe);
	registerRender(bronze_helmet);
	registerRender(bronze_chestplate);
	registerRender(bronze_leggings);
	registerRender(bronze_boots);
	registerRender(bronze_sword);
	registerRender(bronze_pickaxe);
	registerRender(bronze_shovel);
	registerRender(bronze_axe);
	registerRender(bronze_hoe);
	registerRender(silver_helmet);
	registerRender(silver_chestplate);
	registerRender(silver_leggings);
	registerRender(silver_boots);
	registerRender(silver_sword);
	registerRender(silver_pickaxe);
	registerRender(silver_shovel);
	registerRender(silver_axe);
	registerRender(silver_hoe);
	registerRender(platinum_helmet);
	registerRender(platinum_chestplate);
	registerRender(platinum_leggings);
	registerRender(platinum_boots);
	registerRender(platinum_sword);
	registerRender(platinum_pickaxe);
	registerRender(platinum_shovel);
	registerRender(platinum_axe);
	registerRender(platinum_hoe); 
}

public static void registerItem(Item item) {
	GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5));
	System.out.println("Registered Item: " + item.getUnlocalizedName().substring(5));
}

public static void registerRender(Item item) {
	Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(Reference.MODID + ":" + item.getUnlocalizedName().substring(5), "inventory"));
}

}

Posted
  On 5/10/2016 at 3:56 PM, diesieben07 said:

  • Please don't spam the log files with useless information (nobody cares you successfully registered an item). And if you really must print these things use a logger with an appropriately set level (such as
    LogLevel.TRACE

    ).

 

I'm not trying to spam useless information, I'm posting this because I hope to find a solution for my problem.

I'm very new to this so it will take me a while to understand certain things. We all started somewhere didn't we?

 

But thank you for the information, I'll try to do something with it.

 

 

Posted
  On 5/10/2016 at 5:46 PM, Quizer9O8 said:

  Quote

  • Please don't spam the log files with useless information (nobody cares you successfully registered an item). And if you really must print these things use a logger with an appropriately set level (such as
    LogLevel.TRACE

    ).

 

I'm not trying to spam useless information, I'm posting this because I hope to find a solution for my problem.

I'm very new to this so it will take me a while to understand certain things. We all started somewhere didn't we?

 

But thank you for the information, I'll try to do something with it.

 

Diesieben07 was talking about the logging in your code, not your post.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hi! I've been running a server on Minecraft using the Prodigium Reforged pack on curse forge using the site exaroton. It was working fine until randomly encountering this error every time anyone tries to connect to the server, I've already reloaded backups and deleted json files  Here is the crash report https://mclo.gs/EwKw51q. Thanks for the help in advance
    • nevermind i figured out the issue  
    • I was trying to host a server with the 1.21.1 cobbleverse forge mod, but when I tried starting it, it kept giving me this error. Crash report here: https://pastebin.com/AsE1X5QY   Thanks
    • This mod lets you choose an element power, Earth, Wind, Fire, or Water. Also two secret element powers Light and Darkness. Each power gives good a bad things, Earth lets you dig through anything but ores and bedrock, Wind lets you jump high in the air every three seconds, Fir lets you throw fire balls and you are immune to any flame/lava but you can't go into water or else you take damage, Water you swim and break blocks under water quicker and you can get rid of water like a sponge but you take more damage when in fire/lava, Light makes you faster at day but slower at night you are able to throw light spears that do four hearts and can go through any armor, Darkness let's you be faster at night but slower at day mobs don't harm you but peaceful mobs run away from you you are able to spawn ink creatures around you that are like dogs but are stronger. another thing in the mod is that there are other dimensions that can get you ores to make better armor and weapons, each dimensions are are good for a certain element though each dimension has a boss depending on which dimension one dimension has more than one boss, each elements are required to defeat the bosses with each others help.
    • Read the posts above yours, it tells you exactly how to do it, instructions are the same if it's making a forge installation or a vanilla one, just make a new folder for the game directory.
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.