Jump to content

Recommended Posts

Posted

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?

Posted

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.

Posted

Soo.. you're loading the config in the PreInit

But you're creating your item in the static init...

How, exactly, did you expect that to work?

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

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.