Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
Fix Optifine pre10 support, shaders seemed to work in the very limite…
Browse files Browse the repository at this point in the history
…d testing I did.
  • Loading branch information
modmuss50 committed Mar 27, 2020
1 parent 1bd7537 commit 5ea4cd7
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ org.gradle.jvmargs=-Xmx1G

minecraft_version=1.15.2
yarn_mappings=1.15.2+build.14
loader_version=0.7.8+build.184
loader_version=0.7.8+build.189

fabric_version=0.4.32+build.292-1.15
fabric_version=0.5.1+build.294-1.15
fabric_asm_version=v2.0
zt_zip_version=1.14
slf4j_version=1.7.30

mod_version = 1.0.0-beta4
mod_version = 1.0.0-beta5
maven_group = me.modmuss50
archives_base_name = optifabric
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ private OptifineFixer() {
//net/minecraft/client/render/item/HeldItemRenderer
registerFix("class_759", new HeldItemRendererFix());

//net/minecraft/client/texture/SpriteAtlasTexture
registerFix("class_1059", new SpriteAtlasTextureFix());

//net/minecraft/client/particle/ParticleManager
skipClass("class_702");

Expand Down
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;";
}
}
}
}
}
}

0 comments on commit 5ea4cd7

Please sign in to comment.