From 0aa12c21b0923d6f753527ee8f75024d69a4f368 Mon Sep 17 00:00:00 2001 From: glowredman <35727266+glowredman@users.noreply.github.com> Date: Mon, 12 Feb 2024 19:47:37 +0100 Subject: [PATCH] Add annotations to coremod class --- gradle.properties | 19 ++++++++++--------- settings.gradle | 2 +- .../net/shadowfacts/forgelin/Forgelin.kt | 3 +-- .../forgelin/preloader/ForgelinPlugin.kt | 4 ++++ 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/gradle.properties b/gradle.properties index e748631..69c1379 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,7 +11,7 @@ modId = forgelin # Root package of the mod, used to find various classes in other properties, # mcmod.info substitution, enabling assertions in run tasks, etc. -modGroup = net.shadowfacts +modGroup = net.shadowfacts.forgelin # Whether to use modGroup as the maven publishing group. # Due to a history of using JitPack, the default is com.github.GTNewHorizons for all mods. @@ -33,7 +33,7 @@ channel = stable mappingsVersion = 12 # Defines other MCP mappings for dependency deobfuscation. -remoteMappings = https://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ +remoteMappings = https\://raw.githubusercontent.com/MinecraftForge/FML/1.7.10/conf/ # Select a default username for testing your mod. You can always override this per-run by running # `./gradlew runClient --username=AnotherPlayer`, or configuring this command in your IDE. @@ -50,10 +50,10 @@ enableGenericInjection = false # Generate a class with a String field for the mod version named as defined below. # If generateGradleTokenClass is empty or not missing, no such class will be generated. # If gradleTokenVersion is empty or missing, the field will not be present in the class. -generateGradleTokenClass = +generateGradleTokenClass = net.shadowfacts.forgelin.Tags # Name of the token containing the project's current version to generate/replace. -gradleTokenVersion = GRADLETOKEN_VERSION +gradleTokenVersion = VERSION # [DEPRECATED] Mod ID replacement token. gradleTokenModId = @@ -61,13 +61,16 @@ gradleTokenModId = # [DEPRECATED] Mod name replacement token. gradleTokenModName = +# [DEPRECATED] Mod Group replacement token. +gradleTokenGroupName = + # [DEPRECATED] # Multiple source files can be defined here by providing a comma-separated list: Class1.java,Class2.java,Class3.java # public static final String VERSION = "GRADLETOKEN_VERSION"; # The string's content will be replaced with your mod's version when compiled. You should use this to specify your mod's # version in @Mod([...], version = VERSION, [...]). # Leave these properties empty to skip individual token replacements. -replaceGradleTokenInFile = Forgelin.kt +replaceGradleTokenInFile = # In case your mod provides an API for other mods to implement you may declare its package here. Otherwise, you can # leave this property empty. @@ -94,7 +97,7 @@ mixinsPackage = # Specify the core mod entry class if you use a core mod. This class must implement IFMLLoadingPlugin! # This parameter is for legacy compatibility only # Example value: (coreModClass = asm.FMLPlugin) + (modGroup = com.myname.mymodid) -> com.myname.mymodid.asm.FMLPlugin -coreModClass = forgelin.preloader.ForgelinPlugin +coreModClass = preloader.ForgelinPlugin # If your project is only a consolidation of mixins or a core mod and does NOT contain a 'normal' mod ( = some class # that is annotated with @Mod) you want this to be true. When in doubt: leave it on false! @@ -123,7 +126,7 @@ includeWellKnownRepositories = true usesMavenPublishing = true # Maven repository to publish the mod to. -# mavenPublishUrl = https://nexus.gtnewhorizons.com/repository/releases/ +# mavenPublishUrl = https\://nexus.gtnewhorizons.com/repository/releases/ # Publishing to Modrinth requires you to set the MODRINTH_TOKEN environment variable to your current Modrinth API token. # @@ -187,5 +190,3 @@ disableSpotless = true # This is meant to be set in $HOME/.gradle/gradle.properties. # ideaCheckSpotlessOnBuild = true -# Non-GTNH properties -gradleTokenGroupName = diff --git a/settings.gradle b/settings.gradle index e8946ad..16a5b4c 100644 --- a/settings.gradle +++ b/settings.gradle @@ -17,7 +17,7 @@ pluginManagement { } plugins { - id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.8' + id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.14' } diff --git a/src/main/kotlin/net/shadowfacts/forgelin/Forgelin.kt b/src/main/kotlin/net/shadowfacts/forgelin/Forgelin.kt index c75ccec..3267219 100644 --- a/src/main/kotlin/net/shadowfacts/forgelin/Forgelin.kt +++ b/src/main/kotlin/net/shadowfacts/forgelin/Forgelin.kt @@ -8,8 +8,7 @@ import cpw.mods.fml.common.event.FMLPreInitializationEvent /** * @author shadowfacts */ -// kotlin doesn't work with the current variable substitute system, so... -@Mod(modid = Forgelin.MOD_ID, name = Forgelin.NAME, version = "1.9.6-GTNH", acceptableRemoteVersions = "*", acceptedMinecraftVersions = "*", modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter") +@Mod(modid = Forgelin.MOD_ID, name = Forgelin.NAME, version = Tags.VERSION, acceptableRemoteVersions = "*", acceptedMinecraftVersions = "*", modLanguageAdapter = "net.shadowfacts.forgelin.KotlinAdapter") object Forgelin { const val MOD_ID = "forgelin" diff --git a/src/main/kotlin/net/shadowfacts/forgelin/preloader/ForgelinPlugin.kt b/src/main/kotlin/net/shadowfacts/forgelin/preloader/ForgelinPlugin.kt index 33a7d21..0c71e2a 100644 --- a/src/main/kotlin/net/shadowfacts/forgelin/preloader/ForgelinPlugin.kt +++ b/src/main/kotlin/net/shadowfacts/forgelin/preloader/ForgelinPlugin.kt @@ -1,10 +1,14 @@ package net.shadowfacts.forgelin.preloader import cpw.mods.fml.relauncher.IFMLLoadingPlugin +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion +import cpw.mods.fml.relauncher.IFMLLoadingPlugin.Name /** * @author shadowfacts */ +@MCVersion("1.7.10") +@Name("Forgelin Core") class ForgelinPlugin : IFMLLoadingPlugin { override fun getASMTransformerClass(): Array? { return arrayOfNulls(0)