Jump to content

Configurable item ID question


DoktuhParadox

Recommended Posts

Hi,

 

I would like to add configurable item IDs in to my mod. I know how to make the file and things, but I looked around and found out you need the item declaration inside your @Init (load) method, but I can't do that because of achievements and a few other conditions (the functions that the achievements are in void methods themselves, like onItemPickup and stuff).

 

So, is there a way I could add configurable item ids without completely reformatting everything?

Link to comment
Share on other sites

Well, the file's there, but it keeps saying this in the console

 

2012-08-22 17:31:09 [iNFO] [sTDOUT] CONFLICT @ 0 item slot already occupied by net.minecraft.src.ItemSpade@62029d75 while adding com.rushmods.powermod.PowerModItemPickaxe@19af9e98

 

Even when the file's there and the property is, too. Here are the areas of interest:

 

private static int PickItemID;

 

public static final Item PowerPick = new PowerModItemPickaxe(PickItemID, POWER_TOOL);

 

@PreInit

public void preInit(FMLPreInitializationEvent event)

{

 

event.getModMetadata().version = Version.getVersion();

Configuration cfg = new Configuration(event.getSuggestedConfigurationFile());

try {

cfg.load();

PickItemID = cfg.getOrCreateBlockIdProperty("PowerPickID", 9000).getInt(9000);

} catch (Exception e) {

 

} finally {

cfg.save();

}

}

 

And I get no errors but the one about the conflict, and the tool doesn't show up.

Link to comment
Share on other sites

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.



×
×
  • Create New...

Important Information

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