MinecraftForge / ForgeGradle

Minecraft mod development framework used by Forge and FML for the gradle build system
GNU Lesser General Public License v2.1
520 stars 444 forks source link

updateMappings task also remaps srg in strings #714

Closed ichttt closed 4 years ago

ichttt commented 4 years ago

When using gradlew -PUPDATE_MAPPINGS=1.16.2 -PUPDATE_MAPPINGS_CHANNEL=official updateMappings to move to official mappings, all string references of srg names are also remapped to their official name. This is a problem, as ObfuscationReflectionHelper still requires srg names. and remapping that to official will cause issues (not in dev, but when running in production) Example: Running the command above will change ObfuscationReflectionHelper.findMethod(LivingEntity.class, "func_70672_c", DamageSource.class, float.class) to ObfuscationReflectionHelper.findMethod(LivingEntity.class, "getDamageAfterMagicAbsorb", DamageSource.class, float.class)

LexManos commented 4 years ago

Yes this is why forge uses strings like "func_" + "12345_a". The APPLY side of mappings is just a string replace. Not much we can do about that.

Aizistral commented 3 years ago

Okay, this doesn't relate to this the issue, but tell me someone WHERE can I find any documentation on how to use that gradlew updateMappings magic. I literally didn't know something as important as this does exist until I beheld this issue, and googling on the matter yields next to no results. Just... why? Why isn't it even mentioned anywhere that this command exists in ForgeGradle?

LexManos commented 3 years ago

Because it can cause a crapload of issues if you don't know what you're doing. Its a major automated process, that you should be careful when using.

Also, as with all other tasks in FG. You can see it's existence in our source. Documentation is crowdsourced.

Aizistral commented 3 years ago

Understandable, have a good day

alcatrazEscapee commented 3 years ago

@Extegral JDLogic has written a small little blurb on the use of the command: https://gist.github.com/JDLogic/bf16deed3bcf99bd9e1a22eb21148389

You may find that useful. :)

Aizistral commented 3 years ago

@Extegral JDLogic has written a small little blurb on the use of the command: https://gist.github.com/JDLogic/bf16deed3bcf99bd9e1a22eb21148389

You may find that useful. :)

Oh thanks, that comes in handy