generated from kappa-maintainer/1.12.2-FG6-Template
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ad4706
commit aa8f3f6
Showing
7 changed files
with
32 additions
and
1 deletion.
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
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
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
23 changes: 23 additions & 0 deletions
23
src/main/java/com/cleanroommc/fugue/mixin/unilib/FileUtilsMixin.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,23 @@ | ||
package com.cleanroommc.fugue.mixin.unilib; | ||
|
||
import com.cleanroommc.fugue.common.Fugue; | ||
import io.github.cdagaming.unicore.utils.FileUtils; | ||
import net.minecraft.launchwrapper.Launch; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
|
||
import java.util.Arrays; | ||
|
||
@Mixin(value = FileUtils.class, remap = false) | ||
public class FileUtilsMixin { | ||
@Inject(method = "getValidClass(Ljava/lang/ClassLoader;ZZ[Ljava/lang/String;)Ljava/lang/Class;", at = @At("HEAD"), cancellable = true) | ||
private static void getValidClass(ClassLoader loader, boolean init, boolean forceCache, String[] paths, CallbackInfoReturnable<Class<?>> cir) { | ||
//Arrays.stream(paths).forEach(Fugue.LOGGER::info); | ||
try { | ||
Class<?> clazz = Launch.classLoader.findClass(paths[0]); | ||
cir.setReturnValue(clazz); | ||
} catch (ClassNotFoundException ignored) {} | ||
} | ||
} |
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