DoktuhParadox Posted August 22, 2012 Posted August 22, 2012 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? Quote
Texasjake95 Posted August 22, 2012 Posted August 22, 2012 Go look at IronChest on GitHub look at the @Preinit part Found here: https://github.com/cpw/ironchest/blob/master/IronChests2/common/cpw/mods/ironchest/IronChest.java also go look at Helfull's Config/Prop file tutorial found here: http://www.minecraftforge.net/forum/index.php/topic,614.msg4490.html#msg4490 Quote
DoktuhParadox Posted August 22, 2012 Author Posted August 22, 2012 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. Quote
LexManos Posted August 22, 2012 Posted August 22, 2012 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? Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
DoktuhParadox Posted August 23, 2012 Author Posted August 23, 2012 On 8/22/2012 at 11:19 PM, LexManos said: 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? Isn't that why I'm here? Quote
LexManos Posted August 23, 2012 Posted August 23, 2012 -.- Initialize your item AFTER you load your config! Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
Recommended Posts
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.