Jump to content

[1.5.2]Configuration Files


vandy22

Recommended Posts

In my configuration file I dont know if everyone has this problem just until they recomplie and rebofuscate or whatever but for example here is my config:

 

# Configuration file

####################
# block
####################

block {
    I:CGrassID=243
    I:cdirt=242
    I:coral_block=31719
    I:coral_ore=650
    I:lime_block=31682
    I:lime_ore=654
    I:lust_block=31695
    I:lust_ore=653
    I:magenta_block=31669
    I:magenta_ore=665
    I:royal_block=31732
    I:royal_ore=652
    I:snow_block=31707
    I:snow_ore=651
}


####################
# general
####################

general {
    B:does_shinetoolpack_contain_spawneggs=true
}


####################
# item
####################

item {
    I:coral_axe=31720
    I:coral_boots=31727
    I:coral_dust=31725
    I:coral_helmet=31730
    I:coral_ingot=31726
    I:coral_leggings=31728
    I:coral_pickaxe=31722
    I:coral_plate=31729
    I:coral_spade=31721
    I:coral_sword=31723
    I:coral_toolfragment=31724
    I:lime_axe=31683
    I:lime_boots=31690
    I:lime_dust=31688
    I:lime_helmet=31693
    I:lime_ingot=31689
    I:lime_leggings=31691
    I:lime_paxel=31681
    I:lime_pickaxe=31685
    I:lime_plate=31692
    I:lime_spade=31684
    I:lime_sword=31686
    I:lime_toolfragment=31687
    I:lust_axe=31696
    I:lust_boots=31703
    I:lust_dust=31701
    I:lust_helmet=31706
    I:lust_ingot=31702
    I:lust_leggings=31704
    I:lust_paxel=31694
    I:lust_pickaxe=31698
    I:lust_plate=31705
    I:lust_spade=31697
    I:lust_sword=31699
    I:lust_toolfragment=31700
    I:magenta_axe=31670
    I:magenta_boots=31677
    I:magenta_dust=31675
    I:magenta_helmet=31680
    I:magenta_ingot=31676
    I:magenta_leggings=31678
    I:magenta_paxel=31668
    I:magenta_pickaxe=31672
    I:magenta_plate=31679
    I:magenta_spade=31671
    I:magenta_sword=31673
    I:magenta_toolfragment=31674
    I:royal_axe=31733
    I:royal_boots=31740
    I:royal_dust=31738
    I:royal_helmet=31743
    I:royal_ingot=31739
    I:royal_leggings=31741
    I:royal_paxel=31731
    I:royal_pickaxe=31735
    I:royal_plate=31742
    I:royal_spade=31734
    I:royal_sword=31736
    I:royal_toolfragment=31737
    I:snow_axe=31708
    I:snow_boots=31715
    I:snow_dust=31713
    I:snow_helmet=31718
    I:snow_ingot=31714
    I:snow_leggings=31716
    I:snow_pickaxe=31710
    I:snow_plate=31717
    I:snow_spade=31709
    I:snow_sword=31711
    I:snow_toolfragment=31712
    I:tutorialhelmet=31743
}

 

Like my snow spade and stuff is not 31709 its 506. Why does it say that large number? It also doesnt seem like it does it as much when dealing with blocks.

Link to comment
Share on other sites

31000 is too great a number for an ID, it needs to be less than 5000 as far as I know.

 

Please show us your main mod class, you might not have set the shovel as a tool.

"Thinking that coding is the nerdy IT guy at work rebooting your computer is like thinking that music is what happens when the piano tuner comes round." - Ed Rex

Link to comment
Share on other sites

31000 is too great a number for an ID, it needs to be less than 5000 as far as I know.

 

Less than 4096 actually.  Powers of 2.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

What? Did you not see like all the ids in the 30,000's not just the shovel, that was an example. I didnt make them that id, I have them set. Here is where I have them set:

 

@PreInit
public void preInit(FMLPreInitializationEvent event) {
	//any time you want to make a block that will be a biome block, use .getTerrainBlock(). any other block use .getBlock.
	Configuration config = new Configuration(event.getSuggestedConfigurationFile());
	config.load();

	/* Blue-Set-Config */
	TutorialHelmetID = config.getItem(config.CATEGORY_ITEM, "royal_helmet", 502).getInt();
	TutorialPlateID = config.getItem(config.CATEGORY_ITEM, "royal_plate", 511).getInt();
	TutorialLegsID = config.getItem(config.CATEGORY_ITEM, "royal_leggings", 529).getInt();
	TutorialBootsID = config.getItem(config.CATEGORY_ITEM, "royal_boots", 668).getInt();
	BlueIngotID = config.getItem(config.CATEGORY_ITEM, "royal_ingot", 632).getInt();
	BlueDustID = config.getItem(config.CATEGORY_ITEM, "royal_dust", 623).getInt();
	BlueToolFragmentID = config.getItem(config.CATEGORY_ITEM, "royal_toolfragment", 641).getInt();
	BlueSwordID = config.getItem(config.CATEGORY_ITEM, "royal_sword", 538).getInt();
	BluePickaxeID = config.getItem(config.CATEGORY_ITEM, "royal_pickaxe", 546).getInt();
	BlueSpadeID = config.getItem(config.CATEGORY_ITEM, "royal_spade", 555).getInt();
	BlueAxeID = config.getItem(config.CATEGORY_ITEM, "royal_axe", 604).getInt();
	BlueOreID = config.getBlock(config.CATEGORY_BLOCK, "royal_ore", 652).getInt();
	BlueBlockID = config.getItem(config.CATEGORY_BLOCK, "royal_block", 700).getInt();
	BluePaxelID = config.getItem(config.CATEGORY_ITEM, "royal_paxel", 800).getInt();
	/* Spawn-Eggs-Config */
	RespawnEggs = config.get(config.CATEGORY_GENERAL, "does_shinetoolpack_contain_spawneggs", false).getBoolean(false);
	/* Yellow-Set-Config */
	YellowHelmetID = config.getItem(config.CATEGORY_ITEM, "coral_helmet", 500).getInt();
	YellowPlateID = config.getItem(config.CATEGORY_ITEM, "coral_plate", 509).getInt();
	YellowLegsID = config.getItem(config.CATEGORY_ITEM, "coral_leggings", 518).getInt();
	YellowBootsID = config.getItem(config.CATEGORY_ITEM, "coral_boots", 527).getInt();
	YellowIngotID = config.getItem(config.CATEGORY_ITEM, "coral_ingot", 630).getInt();
	YellowDustID = config.getItem(config.CATEGORY_ITEM, "coral_dust", 611).getInt();
	YellowToolFragmentID = config.getItem(config.CATEGORY_ITEM, "coral_toolfragment", 639).getInt();
	YellowSwordID = config.getItem(config.CATEGORY_ITEM, "coral_sword", 536).getInt();
	YellowPickaxeID = config.getItem(config.CATEGORY_ITEM, "coral_pickaxe", 669).getInt();
	YellowSpadeID = config.getItem(config.CATEGORY_ITEM, "coral_spade", 553).getInt();
	YellowAxeID = config.getItem(config.CATEGORY_ITEM, "coral_axe", 602).getInt();
	YellowOreID = config.getBlock(config.CATEGORY_BLOCK, "coral_ore", 650).getInt();
	YellowBlockID = config.getItem(config.CATEGORY_BLOCK, "coral_block", 701).getInt();
	/*White-Set-Config */
	WhiteHelmetID = config.getItem(config.CATEGORY_ITEM, "snow_helmet", 501).getInt();
	WhitePlateID = config.getItem(config.CATEGORY_ITEM, "snow_plate", 519).getInt();
	WhiteLegsID = config.getItem(config.CATEGORY_ITEM, "snow_leggings", 519).getInt();
	WhiteBootsID = config.getItem(config.CATEGORY_ITEM, "snow_boots", 528).getInt();
	WhiteIngotID = config.getItem(config.CATEGORY_ITEM, "snow_ingot", 631).getInt();
	SilverIngotID = config.getItem(config.CATEGORY_ITEM, "snow_ingot", 649).getInt();
	SilverDustID = config.getItem(config.CATEGORY_ITEM, "snow_dust", 622).getInt();
	WhitePowderID = config.getItem(config.CATEGORY_ITEM, "snow_dust", 648).getInt();
	WhiteToolFragmentID = config.getItem(config.CATEGORY_ITEM, "snow_toolfragment", 640).getInt();
	WhiteSwordID = config.getItem(config.CATEGORY_ITEM, "snow_sword", 537).getInt();
	WhitePickaxeID = config.getItem(config.CATEGORY_ITEM, "snow_pickaxe", 545).getInt();
	WhiteSpadeID = config.getItem(config.CATEGORY_ITEM, "snow_spade", 554).getInt();
	WhiteAxeID = config.getItem(config.CATEGORY_ITEM, "snow_axe", 603).getInt();
	SilverOreID = config.getBlock(config.CATEGORY_BLOCK, "snow_ore", 651).getInt();
	WhiteBlockID = config.getItem(config.CATEGORY_BLOCK, "snow_block", 702).getInt();
	/*Red-Set-Config*/
	RedHelmetID = config.getItem(config.CATEGORY_ITEM, "lust_helmet", 503).getInt();
	RedPlateID = config.getItem(config.CATEGORY_ITEM, "lust_plate", 512).getInt();
	RedLegsID = config.getItem(config.CATEGORY_ITEM, "lust_leggings", 521).getInt();
	RedBootsID = config.getItem(config.CATEGORY_ITEM, "lust_boots", 530).getInt();
	RedIngotID = config.getItem(config.CATEGORY_ITEM, "lust_ingot", 633).getInt();
	RedDustID = config.getItem(config.CATEGORY_ITEM, "lust_dust", 624).getInt();
	RedToolFragmentID = config.getItem(config.CATEGORY_ITEM, "lust_toolfragment", 642).getInt();
	RedSwordID = config.getItem(config.CATEGORY_ITEM, "lust_sword", 539).getInt();
	RedPickaxeID = config.getItem(config.CATEGORY_ITEM, "lust_pickaxe", 547).getInt();
	RedSpadeID = config.getItem(config.CATEGORY_ITEM, "lust_spade", 556).getInt();
	RedAxeID = config.getItem(config.CATEGORY_ITEM, "lust_axe", 605).getInt();
	RedOreID = config.getBlock(config.CATEGORY_BLOCK, "lust_ore", 653).getInt();
	RedBlockID = config.getItem(config.CATEGORY_BLOCK, "lust_block", 703).getInt();
	RedPaxelID = config.getItem(config.CATEGORY_ITEM, "lust_paxel", 801).getInt();
	/*Green-Set-Config*/
	GreenHelmetID = config.getItem(config.CATEGORY_ITEM, "lime_helmet", 504).getInt();
	GreenPlateID = config.getItem(config.CATEGORY_ITEM, "lime_plate", 513).getInt();
	GreenLegsID = config.getItem(config.CATEGORY_ITEM, "lime_leggings", 522).getInt();
	GreenBootsID = config.getItem(config.CATEGORY_ITEM, "lime_boots", 531).getInt();
	GreenIngotID = config.getItem(config.CATEGORY_ITEM, "lime_ingot", 634).getInt();
	GreenDustID = config.getItem(config.CATEGORY_ITEM, "lime_dust", 625).getInt();
	GreenToolFragmentID = config.getItem(config.CATEGORY_ITEM, "lime_toolfragment", 643).getInt();
	GreenSwordID = config.getItem(config.CATEGORY_ITEM, "lime_sword", 540).getInt();
	GreenPickaxeID = config.getItem(config.CATEGORY_ITEM, "lime_pickaxe", 548).getInt();
	GreenSpadeID = config.getItem(config.CATEGORY_ITEM, "lime_spade", 557).getInt();
	GreenAxeID = config.getItem(config.CATEGORY_ITEM, "lime_axe", 571).getInt();
	GreenOreID = config.getBlock(config.CATEGORY_BLOCK, "lime_ore", 654).getInt();
	GreenBlockID = config.getItem(config.CATEGORY_BLOCK, "lime_block", 704).getInt();
	GreenPaxelID = config.getItem(config.CATEGORY_ITEM, "lime_paxel", 802).getInt();
	/*Pink-Set-Config */
	PinkHelmetID = config.getItem(config.CATEGORY_ITEM, "magenta_helmet", 505).getInt();
	PinkPlateID = config.getItem(config.CATEGORY_ITEM, "magenta_plate", 514).getInt();
	PinkLegsID = config.getItem(config.CATEGORY_ITEM, "magenta_leggings", 523).getInt();
	PinkBootsID = config.getItem(config.CATEGORY_ITEM, "magenta_boots", 532).getInt();
	PinkIngotID = config.getItem(config.CATEGORY_ITEM, "magenta_ingot", 635).getInt();
	PinkDustID = config.getItem(config.CATEGORY_ITEM, "magenta_dust", 626).getInt();
	PinkToolFragmentID = config.getItem(config.CATEGORY_ITEM, "magenta_toolfragment", 644).getInt();
	PinkSwordID = config.getItem(config.CATEGORY_ITEM, "magenta_sword", 541).getInt();
	PinkPickaxeID = config.getItem(config.CATEGORY_ITEM, "magenta_pickaxe", 549).getInt();
	PinkSpadeID = config.getItem(config.CATEGORY_ITEM, "magenta_spade", 558).getInt();
	PinkAxeID = config.getItem(config.CATEGORY_ITEM, "magenta_axe", 606).getInt();
	PinkOreID = config.getBlock(config.CATEGORY_BLOCK, "magenta_ore", 665).getInt();
	PinkBlockID = config.getItem(config.CATEGORY_BLOCK, "magenta_block", 705).getInt();
	PinkPaxelID = config.getItem(config.CATEGORY_ITEM, "magenta_paxel", 803).getInt();
	config.save();
}	 

 

As you can see all the ids are not even close to 30,000. So im not sure what the probelm is...

Link to comment
Share on other sites

Actually, the maximum ID that can be used is 31999. There is support for item ID's up to 31999. Or was 32000? One of those...

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Guys you may need to see a doctor or something because your obviously not answering the question correctly. I asked why if I programmed my mod to have id's in like the 500-1000 range, why would they show up as 30000 in the config file. I dont need to know the maximum ID, I want to know why it shows the ID's as like 30000 in the config, but also in the config some of the blocks actually worked, and there the right ID's. If you look at my first post it shows the config. In the blocks section some of the ID's are actually correct, there not listed as somewhere in the 30,000's. Please answer the right question, as in why this is happening. Not that minecraft can support certain ID's. Thanks.

Link to comment
Share on other sites

To clarify:

 

Blocks go from ID 0 to ID 4095. (4096 distinct IDs.)

 

Items go from ID 0 to ID 32767 (32768 distinct IDs.)

 

Items can have IDs < 4096, but it's not recommended so as to prevent conflicts with blocks. (The vanilla items, for instance, are in the 256+ area). The game will add 256 to whatever item ID you specify in the config to get the real value for the in-game item.

 

In the config:

 

Blocks - (0-4095).

Items - (3840-32511).

 

Going outside these ranges will do very strange things.

Link to comment
Share on other sites

Thanks, now thats the type of comment I need. Now please dont tell me im going to have to recode all my Items so there in the < 4096 section if I wana use a config? So thats why the blocks are working, but only some of them are which is weird! Im still kinda confused on this whole thing. Can you explain a bit more, on why my some of my blocks are in the 30k range, and do I need to recode my items?

Link to comment
Share on other sites

I know what the problem is.

 

WhiteBlockID = config.getItem(config.CATEGORY_BLOCK, "snow_block", 702).getInt();

 

This is one of the lines causing the issue.  This item is a BLOCK item, what kind of ID are you requesting from config?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

I know what the problem is.

 

WhiteBlockID = config.getItem(config.CATEGORY_BLOCK, "snow_block", 702).getInt();

 

This is one of the lines causing the issue.  This item is a BLOCK item, what kind of ID are you requesting from config?

 

No, thats an actual block mate xD I am pretty sure that if he calls the variable "WhiteBlockID" and the little notation that goes next to the id in the config is "snow_block".

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

I know what the problem is.

 

WhiteBlockID = config.getItem(config.CATEGORY_BLOCK, "snow_block", 702).getInt();

 

This is one of the lines causing the issue.  This item is a BLOCK item, what kind of ID are you requesting from config?

 

No, thats an actual block mate xD I am pretty sure that if he calls the variable "WhiteBlockID" and the little notation that goes next to the id in the config is "snow_block".

 

Yes.

 

Now what FUNCTION is being called?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Okay so actually you caught a mistake all the blocks are supposed to be config.getBlock. Im not sure why whenever I call the getItem function no matter what ID I write, in the config it jumps to somewhere in the 30,000's! Thanks for helping guys, I hope we can figure out the problem!

Link to comment
Share on other sites

Okay so actually you caught a mistake all the blocks are supposed to be config.getBlock. Im not sure why whenever I call the getItem function no matter what ID I write, in the config it jumps to somewhere in the 30,000's! Thanks for helping guys, I hope we can figure out the problem!

 

Because every time it loads the ID it increases it by 256.

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Ok i get that but for example Green legs which is 522 in the code. If you add 522 + 256 = 778. If you look in the config file it lists lime_legs as 31691 not 778.

 

So it saves 778, then it loads, adds 256...

(Although I do admit that it shouldn't be doing that, but that would give the observed behavior.  All of your blocks which are using getBlock are fine, but all of your blocks using getItem are not)

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Exactly but what about my Items using getItem, all those are giving the wrong id. So my question is why?!!

 

Because getItem is for items! D:

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Link to comment
Share on other sites

Just use configInstance.get(); thats what I use. And it works :P

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Draco getItem I do use for my items but nvm, im gonna try to use what mew does. Hopefully it works!

 

here is an example of my config file:

# Configuration file

####################
# block
####################

block {
    I:"Minotaur Portal ID"=1102
    I:"Taurite Block ID"=250
    I:"Taurite Ore ID"=1101
}


####################
# item
####################

item {
    I:"Taurite Cloth ID"=1101
    I:"Taurite ID"=1100
    I:"Training Arrow ID"=1013
    I:"Training Bow ID"=1012
    I:"Training Cuirass ID"=1009
    I:"Training Greaves ID"=1010
    I:"Training Helm ID"=1005
    I:"Training Helmet ID"=1008
    I:"Training Pants ID"=1003
    I:"Training Robe ID"=1006
    I:"Training Sabatons ID"=1011
    I:"Training Sandals ID"=1007
    I:"Training Shoes ID"=1004
    I:"Training Staff ID"=1014
    I:"Training Sword ID"=1017
    I:"Training Tunic ID"=1002
    I:"Training Wand ID"=1015
    I:"Training WarAxe ID"=1016
}

 

and here is how I did some of the ID's:

Item:
bowTrainingID = config.get(Configuration.CATEGORY_ITEM, "Training Bow ID", 1012).getInt();
arrowTrainingID = config.get(Configuration.CATEGORY_ITEM, "Training Arrow ID", 1013).getInt();

Block:
tauriteBlockID = config.get(Configuration.CATEGORY_BLOCK, "Taurite Block ID", 250).getInt();
oreTauriteID = config.get(Configuration.CATEGORY_BLOCK, "Taurite Ore ID", 1101).getInt();
portalMinoID = config.get(Configuration.CATEGORY_BLOCK, "Minotaur Portal ID", 1102).getInt();

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

Link to comment
Share on other sites

Your welcome. I can't believe that I didn't think of that earlier....

 

I hope nothing else botches on ya.

I am Mew. The Legendary Psychic. I behave oddly and am always playing practical jokes.

 

I have also found that I really love making extremely long and extremely but sometimes not so descriptive variables. Sort of like what I just did there xD

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.

Announcements



×
×
  • Create New...

Important Information

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