Skip to content

Commit

Permalink
add back the public access thing
Browse files Browse the repository at this point in the history
  • Loading branch information
tildejustin committed Dec 17, 2023
1 parent 509b4e1 commit 25e87e7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/main/java/me/modmuss50/optifabric/mod/OptifineInjector.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.chocohead.mm.api.ClassTinkerers;
import me.modmuss50.optifabric.patcher.*;
import net.fabricmc.loader.api.FabricLoader;
import org.objectweb.asm.Opcodes;
import org.objectweb.asm.tree.*;

Expand All @@ -12,7 +13,6 @@ public class OptifineInjector {
private static final List<String> patched = new ArrayList<>();
ClassCache classCache;
// i have no idea why and how this works, if you know better please let me know
@SuppressWarnings("CommentedOutCode")
public final Consumer<ClassNode> transformer = target -> {
if (patched.contains(target.name)) {
System.out.println("Already patched" + target.name);
Expand Down Expand Up @@ -40,12 +40,11 @@ public class OptifineInjector {
}

// let's make every class we touch public
// is this necessary? I don't think so
// if (!FabricLoader.getInstance().isDevelopmentEnvironment()) {
// target.access = modAccess(target.access);
// target.methods.forEach(methodNode -> methodNode.access = modAccess(methodNode.access));
// target.fields.forEach(fieldNode -> fieldNode.access = modAccess(fieldNode.access));
// }
if (!FabricLoader.getInstance().isDevelopmentEnvironment()) {
target.access = modAccess(target.access);
target.methods.forEach(methodNode -> methodNode.access = modAccess(methodNode.access));
target.fields.forEach(fieldNode -> fieldNode.access = modAccess(fieldNode.access));
}
};

public OptifineInjector(ClassCache classCache) {
Expand Down

0 comments on commit 25e87e7

Please sign in to comment.