Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[SOLVED] [1.12.2] Compatibility with Optifine (Forge 14.23.4.2729)


Cadiboo
 Share

Recommended Posts

Does anyone know how I would get a dev copy of Optifine into my workspace? I can get a partially working version by using https://github.com/OpenCubicChunks/OptiFineDevTweaker, however I want to be able to use the Optifine classes, and those classes have references to the obfuscated class names, which makes my code uncompilable.

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

5 hours ago, Cadiboo said:

I want to be able to use the Optifine classes, and those classes have references to the obfuscated class names, which makes my code uncompilable.

I don't think that matters. Forge will automatically remap obfuscated references in mods in your workspace as far as I am aware. And in any case it shouldn't make your code "uncompilable" because you are not compiling OF, you re using it as a library. 

Link to comment
Share on other sites

13 hours ago, V0idWa1k3r said:

you're using it as a library. 

I'm using the compiled binary (I can't find any other version) as a library, which directly references obfuscated Minecraft classes. For example, I get these errors 1186883117_ScreenShot2018-11-05at6_20_28pm.thumb.png.aab8f7cd15159e0996e310919cdb8ab1.png481711996_ScreenShot2018-11-05at6_19_55pm.png.78a6b5dd32ae14186299d809da37ee10.png 

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Well, optifine uses notch names. That complicates things. Try this, might still work. The last paragraph of the readme is the important part here. I don't know if it still works now, but it worked for OF for 1.11.2(I've browsed OF's issue tracker to confirm, here is the relevant issue - the OP had it working after following the instructions)

Link to comment
Share on other sites

I've tried that and I couldn't get it to work. It just made an exact copy of the Optifine jar, without renaming anything

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

16 minutes ago, Cadiboo said:

I've tried that and I couldn't get it to work. It just made an exact copy of the Optifine jar, without renaming anything

You must have done something wrong. I just used this utility and was infact able to make a remapped OF jar that works absolutely correctly. Show your command line input for running the deobfuscator, please.

Link to comment
Share on other sites

58 minutes ago, V0idWa1k3r said:

Show your command line input for running the deobfuscator, please.

java -jar ./simpledeobf-0.6.jar --input /Users/Cadiboo/Developer/Modding/forge-2729/run/mods/OptiFine_1.12.2_HD_U_E2_MOD.jar --output /Users/Cadiboo/Developer/Modding/forge-2729/run/mods/OptiFine_1.12.2_HD_U_E2_MOD-dev.jar --mapFile /Users/Cadiboo/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_snapshot/20171003/1.12.2/srgs/notch-mcp.srg --ref /Users/Cadiboo/.gradle/caches/minecraft/net/minecraft/minecraft/1.12.2/minecraft-1.12.2.jar --forcePublic --xdeltaPrefix="patch/" --xdeltaPostfix=".xdelta"

Edited by Cadiboo

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

Restarted my computer & reran the command and now I've got a functioning (compiled obviously) dev version of optifine... That was weird

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Link to comment
Share on other sites

  • 2 weeks later...

You can get a decompiled version of Optifine to use as a library by remapping the Optifine jar using simpledeobf with this command (for OSX)

Spoiler

java -jar /Path/to/simpledeobf-0.6.jar --input /Path/to/OptiFine_MOD.jar --output /Path/to/OptiFine_MOD-DEV.jar  --mapFile /Users/YOUR_USERNAME/.gradle/caches/minecraft/de/oceanlabs/mcp/mcp_snapshot/20180814/1.12.2/srgs/notch-mcp.srg --ref /Users/YOUR_USERNAME/.gradle/caches/minecraft/net/minecraft/minecraft/1.12.2/minecraft-1.12.2.jar

(You can also add --forcePublic to the end to make all methods public in the dev version)

 

You can view the source code of Optifine by decompiling the "dev" jar you just made with your preferred decompiler (I use Bytecode-Viewer with FernFlower because it spits it out as a normal zip)

 

You can run Optifine in your dev workspace by placing it and the OptiFineDevTweaker mod into your run/mods folder.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.

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

 Share



×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.