Skip to content

Commit

Permalink
load test mod entrypoint via raw reflection in fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Dec 30, 2024
1 parent 5f84253 commit e7c5f33
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
12 changes: 0 additions & 12 deletions versions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,6 @@ tasks {
exclude("mcmod.info")
}
}

// Removes the test-related stuff from everything
doLast {
val mainResources = layout.buildDirectory.get().asFile.resolve("resources")
.resolve("main")
val fabricModJson = mainResources.resolve("fabric.mod.json")
if (fabricModJson.exists()) {
val lines = fabricModJson.readLines().toMutableList()
lines.removeIf { it.contains("TestMod") }
fabricModJson.writeText(lines.joinToString("\n"))
}
}
exclude("**/**_Test.**")
exclude("**/**_Test$**.**")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ private void onInit(net.minecraftforge.fml.common.event.FMLPostInitializationEve


private void init() {
//#if FABRIC
//$$ try {
//$$ Class.forName("org.polyfrost.oneconfig.test.TestMod_Test", false, getClass().getClassLoader());
//$$ Class<?> test = Class.forName("org.polyfrost.oneconfig.test.TestMod_Test");
//$$ org.polyfrost.oneconfig.utils.v1.MHUtils.getMethodHandle(test, "onInitializeClient", void.class).getOrThrow().invoke(test.getConstructor().newInstance());
//$$ } catch (Throwable ignored) {
//$$ }
//#endif
LoaderPlatform.ActiveMod self = Platform.loader().getLoadedMod("oneconfig");
String v = self == null ? "LOCAL" : self.version;
LOGGER.info("Loading OneConfig v{}", v);
Expand Down
1 change: 0 additions & 1 deletion versions/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
],
"entrypoints": {
"client": [
"org.polyfrost.oneconfig.test.TestMod_Test",
"org.polyfrost.oneconfig.internal.OneConfig"
]
},
Expand Down

0 comments on commit e7c5f33

Please sign in to comment.