Jump to content

(Resolved) How to create configuration file with latest forge


thepowdertoy

Recommended Posts

You need to use Get, and then specify the category you want.

Like this:

 

config.get(Configuration.CATEGORY_BLOCK, name, defaultid).getInt();

 

Where 'config' is your Configuration instance.

Did that help?

Did I help? Hitting 'Thank You' would be appreciated.

 

Soon, the lost city will rise from the bottom of the ocean, and spread it's technology across Minecraft.

Link to comment
Share on other sites

But default categories are supposed to be removed in forge 6.x, so getBlock no longer makes sense, I think.

I am still developing on forge 4 #303, so I'm not sure what changes were made in that system, but with no default categories, functions like getBlock should either get deprecated or removed.

 

.get, on the other hand, will stay for sure. Also, if you read the code, all getBlock does is call .get with Configuration.CATEGORY_BLOCK

Also .get is way easier to use in expanding mods, because you only need to know one method, instead of memorizing a method per category.

 

So, yes, you can use Configuration.getBlock(), but it's better to just use Configuration.get()

 

It's not that I'm measuring d*cks with you, because I'm not, but if we're helping / teaching / giving tips, we are at least a little bit responsible to head people the best way, in order to avoid future incompatibilities when porting to later forge versions and avoid other kinds of problems. I believe that's what you'd like to happen when someone explains something to you too, so as a community, we should make this little effort to enhance new modders' experience. (I know of people who quit modding because they had some problems with the code, and no one explained them things properly)

 

And this was a little bit of a stretch for what should have been a short answer, so I'll just shut up now.

Did I help? Hitting 'Thank You' would be appreciated.

 

Soon, the lost city will rise from the bottom of the ocean, and spread it's technology across Minecraft.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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