Jump to content

Recommended Posts

Posted

I am trying to make a mod which adds a new pickaxe to the game and I cant create a new tool material.

 

Mod Code:

 

package Fel.Cri;

 

import net.minecraft.src.Block;

import net.minecraft.src.EnumToolMaterial;

import net.minecraft.src.Item;

import net.minecraft.src.ItemStack;

import net.minecraftforge.common.EnumHelper;

import Felcri.Common.CommonProxyFelcri;

import cpw.mods.fml.common.Mod;

import cpw.mods.fml.common.Mod.Init;

import cpw.mods.fml.common.SidedProxy;

import cpw.mods.fml.common.event.FMLInitializationEvent;

import cpw.mods.fml.common.network.NetworkMod;

import cpw.mods.fml.common.registry.GameRegistry;

import cpw.mods.fml.common.registry.LanguageRegistry;

 

//Info

 

@Mod(modid="Felcri",name="Fel",version="1.0.0")

@NetworkMod(clientSideRequired=true,serverSideRequired = false)

 

public class mod_Fel {

 

//blocks/items

 

public static Block BlockFelIron_Ore;

public static Item ItemFelIron_Bar;

public static Item ItemFelIron_Pick;

 

//texture proxy

 

@SidedProxy(clientSide="Felcri.Client.ClientProxyFelcri", serverSide= "Felcri.Common.ClientProxyFelcri")

public static CommonProxyFelcri proxy;

 

@Init

public void load(FMLInitializationEvent event){

 

//blocks/items information

 

BlockFelIron_Ore = new BlockFelIron_Ore(255, 0).setBlockName("BlockFelIron_Ore").setHardness(3F).setResistance(5F);

ItemFelIron_Bar= new ItemFelIron_Bar(500).setItemName("ItemFelIron_Bar").setIconIndex(1);

ItemFelIron_Pick = new ItemFelIron_Pick(501, Feliron).setIconIndex(0).setItemName("ItemFelIron_Pick");

The error is in the ItemFelIron_Pick and it says Feliron can not be resolved to a variable.

 

//Block Registry

 

GameRegistry.registerBlock(BlockFelIron_Ore);

 

//Material

 

EnumToolMaterial Feliron = EnumHelper.addToolMaterial("Feliron", 2, 300, 6.0F, 2, 14);

 

//Language Registry

 

LanguageRegistry.addName(BlockFelIron_Ore, "Fel Iron Ore");

LanguageRegistry.addName(ItemFelIron_Bar, "Fel Iron Ingot");

LanguageRegistry.addName(ItemFelIron_Pick, "Fel Iron Pickaxe");

 

//Recipe Registry

 

GameRegistry.addRecipe(new ItemStack(ItemFelIron_Pick,1), new Object[]{

" X ","XSX"," S ", 'X', mod_Fel.ItemFelIron_Bar, 'S', Item.stick

});

 

 

//Proxy

 

proxy.registerRenderThings();

}

}

Posted

You haven't declared Feliron yet. Move your declaration up.

There's an EAQ for a reason. Read it!

"Note that failure to read this will make you look idiotic. You don't want that do you?" -- luacs1998

 

First rule of bug reports: More information is always better.

Oh, and logs OR IT DIDN'T HAPPEN!!

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



×
×
  • Create New...

Important Information

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