From 76a1df6effd759226fa917f6f68b49a23ac909b0 Mon Sep 17 00:00:00 2001 From: glowredman <35727266+glowredman@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:35:09 +0100 Subject: [PATCH] Add version to `@Mod` annotations (#23) --- gradle.properties | 19 ++++++++++--------- settings.gradle | 2 +- .../microblock/handler/MicroblockMod.scala | 3 +++ .../multipart/handler/MultipartMod.scala | 3 +++ .../minecraft/MinecraftMultipartMod.java | 7 ++++++- 5 files changed, 23 insertions(+), 11 deletions(-) diff --git a/gradle.properties b/gradle.properties index 7eadbba..cff79bd 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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,16 +50,19 @@ 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 = codechicken.multipart.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 = GRADLETOKEN_MODID +gradleTokenModId = # [DEPRECATED] Mod name replacement token. -gradleTokenModName = GRADLETOKEN_MODNAME +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 @@ -67,7 +70,7 @@ gradleTokenModName = GRADLETOKEN_MODNAME # 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 = Tags.java +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. @@ -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 @@ curseForgeRelations = # This is meant to be set in $HOME/.gradle/gradle.properties. # ideaCheckSpotlessOnBuild = true -# Non-GTNH properties -gradleTokenGroupName = GRADLETOKEN_GROUPNAME 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/scala/codechicken/microblock/handler/MicroblockMod.scala b/src/main/scala/codechicken/microblock/handler/MicroblockMod.scala index d13548a..eefd372 100644 --- a/src/main/scala/codechicken/microblock/handler/MicroblockMod.scala +++ b/src/main/scala/codechicken/microblock/handler/MicroblockMod.scala @@ -7,6 +7,7 @@ import cpw.mods.fml.common.Mod.EventHandler import cpw.mods.fml.common.event.FMLServerAboutToStartEvent import codechicken.microblock.MicroMaterialRegistry import codechicken.microblock.DefaultContent +import codechicken.multipart.Tags import cpw.mods.fml.common.event.FMLPostInitializationEvent import codechicken.microblock.ConfigContent import cpw.mods.fml.common.event.FMLInterModComms.IMCEvent @@ -14,8 +15,10 @@ import scala.collection.JavaConversions._ @Mod( modid = "ForgeMicroblock", + name = "Forge Microblocks", acceptedMinecraftVersions = "[1.7.10]", dependencies = "required-after:ForgeMultipart", + version = Tags.VERSION, modLanguage = "scala" ) object MicroblockMod { diff --git a/src/main/scala/codechicken/multipart/handler/MultipartMod.scala b/src/main/scala/codechicken/multipart/handler/MultipartMod.scala index a297bf1..cc05c5b 100644 --- a/src/main/scala/codechicken/multipart/handler/MultipartMod.scala +++ b/src/main/scala/codechicken/multipart/handler/MultipartMod.scala @@ -7,10 +7,13 @@ import cpw.mods.fml.common.event.FMLInitializationEvent import cpw.mods.fml.common.Mod.EventHandler import cpw.mods.fml.common.event.FMLServerAboutToStartEvent import codechicken.multipart.MultiPartRegistry +import codechicken.multipart.Tags @Mod( modid = "ForgeMultipart", + name = "Forge Multipart", acceptedMinecraftVersions = "[1.7.10]", + version = Tags.VERSION, modLanguage = "scala" ) object MultipartMod { diff --git a/src/main/scala/codechicken/multipart/minecraft/MinecraftMultipartMod.java b/src/main/scala/codechicken/multipart/minecraft/MinecraftMultipartMod.java index a9dbb1f..7a8c402 100644 --- a/src/main/scala/codechicken/multipart/minecraft/MinecraftMultipartMod.java +++ b/src/main/scala/codechicken/multipart/minecraft/MinecraftMultipartMod.java @@ -3,12 +3,17 @@ package codechicken.multipart.minecraft; import net.minecraftforge.common.MinecraftForge; import codechicken.lib.packet.PacketCustom; +import codechicken.multipart.Tags; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.event.FMLPreInitializationEvent; -@Mod(modid = "McMultipart", acceptedMinecraftVersions = "[1.7.10]") +@Mod( + modid = "McMultipart", + name = "Minecraft Multipart Plugin", + acceptedMinecraftVersions = "[1.7.10]", + version = Tags.VERSION) public class MinecraftMultipartMod { @Instance("McMultipart")