EssentialGG / Vigilance

Configuration Utility using Elementa
GNU Lesser General Public License v3.0
54 stars 12 forks source link

Obfuscation problem [1.8.9] #67

Closed Soqva closed 1 year ago

Soqva commented 1 year ago

I tried to develop a forge mod for minecraft 1.8.9 using this library for creating mod's config GUI but I faced a problem with Minecraft code obfuscation. When I execute the 'runClient' gradle task the mod works fine but when I place the mod into the mods folder and run the launcher it instantly crashes with 'NoSuchMethodException' because of calling non-existing methods in the Minecraft class.

When PlatformImpl object tries to call 'getMinecraft()' method in the Minecraft class the execution crashes because there is no 'getMinecraft()' method because of Minecraft code obfuscation. This method is called 'func_71410_x' at runtime in the launcher (I used java Reflection API to find out the name of the method).

public void enableStencil() {
    FrameBuffer framebuffer = Minecraft.getMinecraft().getFramebuffer();
    if (!framebuffer.isStencilEnabled()) {
        framebuffer.enableStencil();
    }
}

Is it even possible to solve this problem somehow or what am I doing wrong?

P.S. I downloaded the latest MDK for mod development from Forge and added the dependency nothing more.