forked from RedLime/OptiFabric-Pre1.14
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
suppress launchwrapper classloading failure
- Loading branch information
1 parent
96ebff4
commit ecf33f7
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/me/modmuss50/optifabric/mixin/ReflectorClassMixin.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,27 @@ | ||
package me.modmuss50.optifabric.mixin; | ||
|
||
import org.spongepowered.asm.mixin.*; | ||
import org.spongepowered.asm.mixin.injection.*; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
// suppresses some warnings in the log | ||
@Pseudo | ||
@Mixin(targets = "ReflectorClass") | ||
public class ReflectorClassMixin { | ||
@Shadow | ||
private String targetClassName; | ||
|
||
@Shadow | ||
private boolean checked; | ||
|
||
@SuppressWarnings("UnresolvedMixinReference") | ||
@Inject(method = "getTargetClass", at = @At("HEAD"), remap = false) | ||
private void getTargetClass(CallbackInfoReturnable<Class<?>> infoReturnable) { | ||
if (!checked) { // only check the target if it hasn't been done yet | ||
String name = targetClassName.replaceAll("/", "."); | ||
if (name.startsWith("net.minecraft.launchwrapper") || name.startsWith("net.minecraftforge") || "optifine.OptiFineClassTransformer".equals(name)) { | ||
checked = true; | ||
} | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"required": true, | ||
"package": "me.modmuss50.optifabric.mixin", | ||
"compatibilityLevel": "JAVA_8", | ||
"mixins": [ | ||
"ReflectorClassMixin" | ||
] | ||
} |