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.)