Jump to content

[SOLVED] Is there any tool to update obfuscation mapping for mod codes?


Recommended Posts

Posted

For example, now I have these codes in my mod:

    @Override
    public void func_180434_a(WorldRenderer worldRenderer, Entity entity, float time, float f4, float f5, float f6, float f7, float f8) {
        ...
    }

Maybe in another obfuscation mapping, func_180434_a is replaced by renderParticle. If I changed the mapping, a compile error occurs.

So is there any tool that input two mappings and my codes, output rewrited codes that replaced all obfuscated methods and fields? So that I could focus on issues such as BlockPos replacing x,y,z instead of renaming func_180434_a to renderParticle.

 

Any clue could help.  :D

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

Posted

If you change the mappings, to what mappings did you change it and what is the compile error?

 

It's just an example.

I mean, if the deobfuscated name of a vanilla method changed in some mappings, the codes that follow old mappings and use the method couldn't be compiled when using new mappings. The same method, is named A in old mappings while named B in new mappings. My codes call A(). If I change to new mapping, A() doesn't exist and my codes can't be compiled until I change A() to B(). I'm seeking a way to do it automatically.

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

Posted

While a bit of a pain it isn't to bad to do it manually. Your IDE (like Eclipse) will highlight everything that changed as an error and you look at the mapping CSV file to look up what it changed to. You can usually do it in about 15 minutes.

 

Yes. It's easy to replace func_aaa_b to something, since aaa is an unique number. And I can simply use text replacement to achieve this.

However, if func_aaa_b is mapped to A in old mappings and B in new mappings. I have to look up A in old mappings to get func_aaa_b, and then look up it in new mappings to get B. It cost more time and I can't simply replace text because it's not unique. I have to do it manually in case change other methods with the same name. That's why I am looking for a tool.

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

Posted

While a bit of a pain it isn't to bad to do it manually. Your IDE (like Eclipse) will highlight everything that changed as an error and you look at the mapping CSV file to look up what it changed to. You can usually do it in about 15 minutes.

 

Yes. It's easy to replace func_aaa_b to something, since aaa is an unique number. And I can simply use text replacement to achieve this.

However, if func_aaa_b is mapped to A in old mappings and B in new mappings. I have to look up A in old mappings to get func_aaa_b, and then look up it in new mappings to get B. It cost more time and I can't simply replace text because it's not unique. I have to do it manually in case change other methods with the same name. That's why I am looking for a tool.

 

I think the func_aaa_b names may be unique across entire workspace but someone else would have to confirm.

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

Posted

I think the func_aaa_b names may be unique across entire workspace but someone else would have to confirm.

 

You didn't get my point.

It's not me who defines func_aaa_b.

 

Correct.  They're SRG names.  And the way SRG works is that they are 100% identical between different versions of Forge and usually the same across versions of Minecraft (a major rewrite of a class can throw that out the window though).

 

But your point doesn't make any sense because we don't know where you're trying to get to and where you are coming from.  What version of Minecraft (and Forge) is A, what version of Minecraft (and Forge) is B, etc?

 

It doesn't help that you say you want to translate func_aaa_b to something, but can't because it's not func_aaa_b.

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.

Posted

The request is actually rather simple in concept, but no there is no one off tool to remail things like that. I've asked Abrar to add that functionality to FG but its far less important than other things he needs to get done.

You can work with the Srg2Source tool on the Forge github to see if you can glue something together.

But let me warn you it's no simple task, i've done the hard part for you with S2S but it has no simple front end.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Posted

The request is actually rather simple in concept, but no there is no one off tool to remail things like that. I've asked Abrar to add that functionality to FG but its far less important than other things he needs to get done.

You can work with the Srg2Source tool on the Forge github to see if you can glue something together.

But let me warn you it's no simple task, i've done the hard part for you with S2S but it has no simple front end.

Thank you, Lex.

This may be what I'm looking for. Seems I should look at Forge repositories before I asked here.

And thanks to all who replied me.

Author of Tao Land Mod.

width=200 height=69http://taoland.herbix.me/images/1/14/TaoLandLogo.png[/img]

Also, author of RenderTo

----

I'm not an English native speaker. I just try my best.

  • 4 months later...
Posted

The request is actually rather simple in concept, but no there is no one off tool to remail things like that. I've asked Abrar to add that functionality to FG but its far less important than other things he needs to get done.

You can work with the Srg2Source tool on the Forge github to see if you can glue something together.

But let me warn you it's no simple task, i've done the hard part for you with S2S but it has no simple front end.

Thank you, Lex.

This may be what I'm looking for. Seems I should look at Forge repositories before I asked here.

And thanks to all who replied me.

 

I am looking for something like this to update some mods. Were you able to create some easier-to-use tool to update minecraft mod source?

Posted

1) Don't hijack threads. Make your own.

2) If I understand you correctly, you want to update a mod for an older Minecraft version to a newer one? You'd have to do it yourself, which means you have to decompile an deobfuscate the mod source, make changes to the source, obfuscate and compile it again.

Don't PM me with questions. They will be ignored! Make a thread on the appropriate board for support.

 

1.12 -> 1.13 primer by williewillus.

 

1.7.10 and older versions of Minecraft are no longer supported due to it's age! Update to the latest version for support.

 

http://www.howoldisminecraft1710.today/

Posted

1) Don't hijack threads. Make your own.

2) If I understand you correctly, you want to update a mod for an older Minecraft version to a newer one? You'd have to do it yourself, which means you have to decompile an deobfuscate the mod source, make changes to the source, obfuscate and compile it again.

 

I have exactly the same problem as the original author of this topic and I wanted to know if he was able to create some script which helps with the problem.

Posted

There is no tool to magically update an old mod. More changes in different versions than just mappings. If you want to update an old mod, you'll have to do as larsgerrits said. Obtain the source code (preferably by completely legal means), make any necessary changes, and then recompile it.

Don't make mods if you don't know Java.

Check out my website: http://shadowfacts.net

Developer of many mods

Posted

There is no tool to magically update an old mod. More changes in different versions than just mappings. If you want to update an old mod, you'll have to do as larsgerrits said. Obtain the source code (preferably by completely legal means), make any necessary changes, and then recompile it.

 

Thanks guys, but I am neither new to coding, nor to minecraft modding. I am looking for a tool which uses a mapping list (like the MCP Mapping table) and updates all obfuscation mapping variable, methods, classes in my code to the readable ones from the list.

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



  • Recently Browsing

    • No registered users viewing this page.
  • Posts

    • Hello , when I try to launch the forge installer it just crash with a message for 0,5 secondes. I'm using java 17 to launch it. Here's the link of the error :https://cdn.corenexis.com/view/?img=d/ma24/qs7u4U.jpg  
    • You will find the crash-report or log in your minecraft directory (crash-report or logs folder)
    • Use a modpack which is using these 2 mods as working base:   https://www.curseforge.com/minecraft/modpacks/life-in-the-village-3
    • inicie un mundo donde instale Croptopia y Farmer's Delight, entonces instale el addon Croptopia Delight pero no funciona. es la version 1.18.2
    • Hello all. I'm currently grappling with the updateShape method in a custom class extending Block.  My code currently looks like this: The conditionals in CheckState are there to switch blockstate properties, which is working fine, as it functions correctly every time in getStateForPlacement.  The problem I'm running into is that when I update a state, the blocks seem to call CheckState with the position of the block which was changed updated last.  If I build a wall I can see the same change propagate across. My question thus is this: is updateShape sending its return to the neighbouring block?  Is each block not independently executing the updateShape method, thus inserting its own current position?  The first statement appears to be true, and the second false (each block is not independently executing the method). I have tried to fix this by saving the block's own position to a variable myPos at inception, and then feeding this in as CheckState(myPos) but this causes a worse outcome, where all blocks take the update of the first modified block, rather than just their neighbour.  This raises more questions than it answers, obviously: how is a different instance's variable propagating here?  I also tried changing it so that CheckState did not take a BlockPos, but had myPos built into the body - same problem. I have previously looked at neighbourUpdate and onNeighbourUpdate, but could not find a way to get this to work at all.  One post on here about updatePostPlacement and other methods has proven itself long superceded.  All other sources on the net seem to be out of date. Many thanks in advance for any help you might offer me, it's been several days now of trying to get this work and several weeks of generally trying to get round this roadblock.  - Sandermall
  • Topics

  • Who's Online (See full list)

    • There are no registered users currently online
×
×
  • Create New...

Important Information

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