herbix Posted May 9, 2015 Posted May 9, 2015 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. Quote Author of Tao Land Mod. http://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.
larsgerrits Posted May 9, 2015 Posted May 9, 2015 If you change the mappings, to what mappings did you change it and what is the compile error? Quote 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/
herbix Posted May 9, 2015 Author Posted May 9, 2015 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. Quote Author of Tao Land Mod. http://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.
shadowfacts Posted May 9, 2015 Posted May 9, 2015 AFAIK there's no tool that can do that for you, but you could always build one yourself. It would be a pretty interesting exercise. Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
jabelar Posted May 10, 2015 Posted May 10, 2015 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. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
herbix Posted May 10, 2015 Author Posted May 10, 2015 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. Quote Author of Tao Land Mod. http://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.
jabelar Posted May 10, 2015 Posted May 10, 2015 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. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
herbix Posted May 11, 2015 Author Posted May 11, 2015 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. Quote Author of Tao Land Mod. http://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.
Draco18s Posted May 11, 2015 Posted May 11, 2015 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. Quote 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.
LexManos Posted May 11, 2015 Posted May 11, 2015 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. Quote I do Forge for free, however the servers to run it arn't free, so anything is appreciated. Consider supporting the team on Patreon
herbix Posted May 12, 2015 Author Posted May 12, 2015 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. Quote Author of Tao Land Mod. http://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.
EoD Posted September 20, 2015 Posted September 20, 2015 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? Quote
larsgerrits Posted September 20, 2015 Posted September 20, 2015 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. Quote 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/
EoD Posted September 20, 2015 Posted September 20, 2015 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. Quote
shadowfacts Posted September 20, 2015 Posted September 20, 2015 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. Quote Don't make mods if you don't know Java. Check out my website: http://shadowfacts.net Developer of many mods
EoD Posted September 20, 2015 Posted September 20, 2015 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. Quote
EoD Posted September 27, 2015 Posted September 27, 2015 I created a bash script which takes care of the renaming: https://github.com/EoD/mcp-tools/tree/master/mapping-updater I hope someone else finds this useful, too. Quote
Recommended Posts
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.