diff --git a/build.gradle b/build.gradle index dacfc75..bdd8be0 100644 --- a/build.gradle +++ b/build.gradle @@ -70,6 +70,13 @@ dependencies { compile group: "org.jetbrains.kotlin", name: "kotlin-runtime", version: kotlin_version } +jar { + manifest { + attributes "FMLCorePlugin": "net.shadowfacts.forgelin.preloader.ForgelinPlugin", + "FMLCorePluginContainsFMLMod": "true" + } +} + shadowJar { classifier = "" dependencies { @@ -77,6 +84,10 @@ shadowJar { include(dependency("org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}")) include(dependency("org.jetbrains.kotlin:kotlin-runtime:${kotlin_version}")) } + manifest { + attributes "FMLCorePlugin": "net.shadowfacts.forgelin.preloader.ForgelinPlugin", + "FMLCorePluginContainsFMLMod": "true" + } } tasks.build.dependsOn shadowJar diff --git a/gradle.properties b/gradle.properties index 75cbe36..6833908 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,4 +1,4 @@ -mod_version = 1.3.0 +mod_version = 1.3.1 group = net.shadowfacts archivesBaseName = Forgelin diff --git a/src/main/java/net/shadowfacts/forgelin/preloader/ForgelinPlugin.java b/src/main/java/net/shadowfacts/forgelin/preloader/ForgelinPlugin.java new file mode 100644 index 0000000..164c397 --- /dev/null +++ b/src/main/java/net/shadowfacts/forgelin/preloader/ForgelinPlugin.java @@ -0,0 +1,37 @@ +package net.shadowfacts.forgelin.preloader; + +import net.minecraftforge.fml.relauncher.IFMLLoadingPlugin; + +import java.util.Map; + +/** + * @author shadowfacts + */ +public class ForgelinPlugin implements IFMLLoadingPlugin { + + @Override + public String[] getASMTransformerClass() { + return new String[0]; + } + + @Override + public String getModContainerClass() { + return null; + } + + @Override + public String getSetupClass() { + return "net.shadowfacts.forgelin.preloader.ForgelinSetup"; + } + + @Override + public void injectData(Map data) { + + } + + @Override + public String getAccessTransformerClass() { + return null; + } + +} diff --git a/src/main/java/net/shadowfacts/forgelin/preloader/ForgelinSetup.java b/src/main/java/net/shadowfacts/forgelin/preloader/ForgelinSetup.java new file mode 100644 index 0000000..b437ba8 --- /dev/null +++ b/src/main/java/net/shadowfacts/forgelin/preloader/ForgelinSetup.java @@ -0,0 +1,28 @@ +package net.shadowfacts.forgelin.preloader; + +import net.minecraftforge.fml.relauncher.IFMLCallHook; + +import java.util.Map; + +/** + * @author shadowfacts + */ +public class ForgelinSetup implements IFMLCallHook { + + @Override + public void injectData(Map data) { + ClassLoader loader = (ClassLoader)data.get("classLoader"); + try { + loader.loadClass("net.shadowfacts.forgelin.KotlinAdapter"); + } catch (ClassNotFoundException e) { + // this should never happen + throw new RuntimeException("Couldn't find Forgelin langague adapter, this shouldn't be happening", e); + } + } + + @Override + public Void call() throws Exception { + return null; + } + +} diff --git a/src/main/kotlin/net/shadowfacts/forgelin/Forgelin.kt b/src/main/kotlin/net/shadowfacts/forgelin/Forgelin.kt index 0bd4973..e1e7330 100644 --- a/src/main/kotlin/net/shadowfacts/forgelin/Forgelin.kt +++ b/src/main/kotlin/net/shadowfacts/forgelin/Forgelin.kt @@ -10,6 +10,6 @@ object Forgelin { const val MOD_ID = "forgelin" const val NAME = "Forgelin" - const val VERSION = "1.3.0" + const val VERSION = "1.3.1" } \ No newline at end of file