This repository has been archived by the owner on May 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Optifine pre10 support, shaders seemed to work in the very limite…
…d testing I did.
- Loading branch information
Showing
3 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
src/main/java/me/modmuss50/optifabric/patcher/fixes/SpriteAtlasTextureFix.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package me.modmuss50.optifabric.patcher.fixes; | ||
|
||
import me.modmuss50.optifabric.util.RemappingUtils; | ||
import org.objectweb.asm.tree.ClassNode; | ||
import org.objectweb.asm.tree.LocalVariableNode; | ||
import org.objectweb.asm.tree.MethodNode; | ||
|
||
public class SpriteAtlasTextureFix implements ClassFixer { | ||
|
||
private String stitchName = RemappingUtils.getMethodName("class_1059", "method_18163", "(Lnet/minecraft/class_3300;Ljava/util/stream/Stream;Lnet/minecraft/class_3695;I)Lnet/minecraft/class_1059$class_4007;"); | ||
|
||
@Override | ||
public void fix(ClassNode optifine, ClassNode minecraft) { | ||
for (MethodNode methodNode : optifine.methods) { | ||
if (methodNode.name.equals(stitchName)) { | ||
for (LocalVariableNode localVariable : methodNode.localVariables) { | ||
if (localVariable.name.equals("locsEmissive")) { | ||
//Make this a HashSet and not just a Set so mixin only has 1 target | ||
localVariable.desc = "Ljava/util/HashSet;"; | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |