Jump to content

[1.16.3] New to Forge modding and have some questions


HeavensSword

Recommended Posts

Hello all, as the title says I've recently decided to get into modding with forge and for Minecraft in general.

 

I'm currently forking an existing mod that I'm looking to enhance. This mod seems to have been written with an old version of the forge API so I've been working through updating and refactoring using whatever resources I've been able to find.

I've run into some issues though that I figured would just be easier to ask those who would me more knowledgeable than I am with forge.

 

Most of my issues fall under "replace X with which modern equivalent?".
 

What do these event types equate to now?

FMLPreInitializationEvent 

FMLInitializationEvent

 

Is the following now Biome.getRegistryName()?"

Biome.getBiomeName()

 

What should be used for logging instead of this call? :

FMLLog.log()

 

I've changed:

Chunk chunk = world.getChunkFromBlockCoords(pos);
Biome biome = chunk.getBiome(pos, world.getBiomeProvider());

Into:

Biome biome = world.getBiomeManager().getBiomeAtPosition( pos );

Is this correct?

Would this also be equivalent? :

Biome biome = world.getBiome( pos );

 

One section that's been causing more grief has been:

Set<BiomeDictionary.Type> types = BiomeDictionary.getTypes( biome );
for( Type t : types )
 ...

BiomeDictionary.getTypes() no longer takes the type Biome, but instead now takes RegistryKey<Biome>. I'm not sure where I can get a Biome as this RegistryKey type.

Should I even bother with getTypes or should I use Biome.getCategory() instead? What's the real difference between type and category?

 

Am I correct in assuming that:

ReflectionHelper.getPrivateValue() 

Has become:

ObfuscationReflectionHelper.getPrivateValue()

?

If so, the original mod was passing a String[] into the final parameter of getPrivateValue, e.g.:  { "g", "field_184060_g", "mapBossInfos" }

It seems the new getPrivateValue only takes a single string for the fieldName paramter now. What is the proper string to pass/how should it be used? (I've been assuming "mapBossInfos" in the example array, but want to be sure.)

Edited by HeavensSword
Link to comment
Share on other sites

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

Hey Draco, thanks for the link! There's definitely some helpful information in there, unfortunately it doesn't address some of the specific issues I'm running into.

 

Btw, is there an official API doc somewhere? I've been using: https://forge.yue.moe/javadoc/1.16.3/ which seems accurate for the most part, but is missing a few things.

Link to comment
Share on other sites

There's also:

https://mcforge.readthedocs.io/en/1.15.x/

 

And that site is simply an extraction of the in-code Javadoc, so its likely out of date. Not to mention that 1.16 is not fully deobfuscated yet.

 

Anyway, what things do you still need? I know there were a few more changes from 1.14 to 1.15 (and again to 1.16) but I've lost track of the gist for them.

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 still need answers for the majority of what I listed in my OP; yea I was trying to find a gist between some of the other versions as well after reading through the one you gave me.

 

I can probably figure out the earlier issues I listed with some trial and error, but I'd say the BiomeDictionary issue and the ReflectionHelper would be the two main ones I'd hope to get some insight on. Like when it comes to the old version of ReflectionHelper, I can only guess that it was taking a String array because you had to pass in parts of the obfuscated method name, whereas the new ObfuscationRelectionHelper maybe doesn't require that anymore? Again that's just a guess on my part.

Link to comment
Share on other sites

2 hours ago, HeavensSword said:

Like when it comes to the old version of ReflectionHelper, I can only guess that it was taking a String array because you had to pass in parts of the obfuscated method name, whereas the new ObfuscationRelectionHelper maybe doesn't require that anymore? Again that's just a guess on my part.

ObfuscationRelectionHelper expects the srg names, i.e. "field_184060_g" from your example. This reason for this is that the srg names doesn't change. "mapBossInfos" for example could change between versions, if the community decides to give it a new mcp name.

Edited by vemerion
Link to comment
Share on other sites

22 minutes ago, vemerion said:

ObfuscationRelectionHelper expects the srg names, i.e. "field_184060_g" from your example. This reason for this is that the srg names doesn't change. "mapBossInfos" for example could change between versions, if the community decides to give it a new mcp name.

Ok, perfect, thanks for the clarification!

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.