diff --git a/gradle.properties b/gradle.properties index 05bd21e8..05fa9444 100644 --- a/gradle.properties +++ b/gradle.properties @@ -16,10 +16,12 @@ show_testing_output = false # Mod Information # HIGHLY RECOMMEND complying with SemVer for mod_version: https://semver.org/ mod_version = 1.1.5-UES -root_package = cn.academy +root_package = cn mod_id = academy mod_name = AcademyCraft +lambdalib_mod_id = lambdalib2 + # Mod Metadata (Optional) mod_description =A mod about superability. Become an ESPer and alter your reality in Minecraft! mod_url =https://github.com/yor42/AcademyCraft diff --git a/src/main/java/cn/academy/Main.java b/src/main/java/cn/academy/Main.java index 31d01d6f..d356ba24 100644 --- a/src/main/java/cn/academy/Main.java +++ b/src/main/java/cn/academy/Main.java @@ -29,24 +29,30 @@ import java.util.Map.Entry; +import static cn.academy.Main.MODID; +import static cn.academy.Main.NAME; + /** * Academy Craft Mod Main Class * * @author acaly, WeathFolD, KS * */ -@Mod(modid = "academy", name = "AcademyCraft", version = Main.VERSION, dependencies = "required-after:lambdalib2@@LAMBDA_LIB_VERSION@") -@RegistryMod(rootPackage = "cn.academy.", resourceDomain = "academy") +@Mod(modid = MODID, name = NAME, version = Main.VERSION, dependencies = "required-after:"+Tags.LAMBDALIB_MOD_ID+"@"+Tags.LAMBDA_LIB_VERSION) +@RegistryMod(rootPackage = Tags.ROOT_PACKAGE, resourceDomain = Main.MODID) public class Main { @Instance("academy-craft") public static Main INSTANCE; - public static final String VERSION = "@VERSION@"; + public static final String MODID = Tags.MOD_ID; + public static final String NAME = Tags.MOD_NAME; + public static final String VERSION = Tags.VERSION; + public static final boolean DEBUG_MODE = FMLLaunchHandler.isDeobfuscatedEnvironment(); - public static final Logger log = LogManager.getLogger("AcademyCraft"); + public static final Logger log = LogManager.getLogger(NAME); static final String[] scripts = { "generic", "ability", "electromaster", "teleporter", "meltdowner", "generic_skills" }; @@ -57,7 +63,7 @@ public class Main { public static SimpleNetworkWrapper netHandler = NetworkRegistry.INSTANCE.newSimpleChannel("academy-network"); - public static CreativeTabs cct = new CreativeTabs("AcademyCraft") { + public static CreativeTabs cct = new CreativeTabs(NAME) { @Override public ItemStack createIcon() { return new ItemStack(ACItems.logo); diff --git a/src/main/java/cn/academy/support/groovyscript/AcademyCraftGroovyPlugin.java b/src/main/java/cn/academy/support/groovyscript/AcademyCraftGroovyPlugin.java index faefbab3..75db6540 100644 --- a/src/main/java/cn/academy/support/groovyscript/AcademyCraftGroovyPlugin.java +++ b/src/main/java/cn/academy/support/groovyscript/AcademyCraftGroovyPlugin.java @@ -1,9 +1,13 @@ package cn.academy.support.groovyscript; +import cn.academy.Main; import cn.academy.support.groovyscript.modules.ImagFusor; import cn.academy.support.groovyscript.modules.MetalFormer; import com.cleanroommc.groovyscript.api.GroovyPlugin; import com.cleanroommc.groovyscript.compat.mods.GroovyContainer; +import com.cleanroommc.groovyscript.documentation.linkgenerator.LinkGeneratorHooks; + +import static cn.academy.Main.NAME; public class AcademyCraftGroovyPlugin implements GroovyPlugin { @@ -12,17 +16,18 @@ public class AcademyCraftGroovyPlugin implements GroovyPlugin { @Override public String getModId() { - return "academy"; + return Main.MODID; } @Override public String getContainerName() { - return "AcademyCraft"; + return NAME; } @Override public void onCompatLoaded(GroovyContainer groovyContainer) { groovyContainer.addProperty(FUSOR); groovyContainer.addProperty(FORMER); + LinkGeneratorHooks.registerLinkGenerator(new LinkGenerator()); } } diff --git a/src/main/java/cn/academy/support/groovyscript/LinkGenerator.java b/src/main/java/cn/academy/support/groovyscript/LinkGenerator.java index ed5782b4..c5ebc3b8 100644 --- a/src/main/java/cn/academy/support/groovyscript/LinkGenerator.java +++ b/src/main/java/cn/academy/support/groovyscript/LinkGenerator.java @@ -1,6 +1,7 @@ package cn.academy.support.groovyscript; import cn.academy.Main; +import com.cleanroommc.groovyscript.documentation.Documentation; import com.cleanroommc.groovyscript.documentation.linkgenerator.BasicLinkGenerator; import com.cleanroommc.groovyscript.documentation.linkgenerator.ILinkGenerator; @@ -18,6 +19,6 @@ protected String version() { @Override protected String domain() { - return "https://github.com/yor42/AcademyCraft"; + return "https://github.com/yor42/AcademyCraft/"; } } diff --git a/src/main/java/cn/academy/support/groovyscript/modules/ImagFusor.java b/src/main/java/cn/academy/support/groovyscript/modules/ImagFusor.java index fc20f7d5..4c93451d 100644 --- a/src/main/java/cn/academy/support/groovyscript/modules/ImagFusor.java +++ b/src/main/java/cn/academy/support/groovyscript/modules/ImagFusor.java @@ -1,5 +1,6 @@ package cn.academy.support.groovyscript.modules; +import cn.academy.Main; import cn.academy.crafting.ImagFusorRecipes; import com.cleanroommc.groovyscript.api.IIngredient; import com.cleanroommc.groovyscript.api.documentation.annotations.Example; @@ -14,7 +15,7 @@ import java.util.Collections; import java.util.Iterator; -@RegistryDescription +@RegistryDescription(linkGenerator = Main.MODID) public class ImagFusor extends StandardListRegistry { @Override public Collection getRecipes() { diff --git a/src/main/java/cn/academy/support/groovyscript/modules/MetalFormer.java b/src/main/java/cn/academy/support/groovyscript/modules/MetalFormer.java index f9aa4986..9465629d 100644 --- a/src/main/java/cn/academy/support/groovyscript/modules/MetalFormer.java +++ b/src/main/java/cn/academy/support/groovyscript/modules/MetalFormer.java @@ -1,5 +1,6 @@ package cn.academy.support.groovyscript.modules; +import cn.academy.Main; import cn.academy.block.tileentity.TileMetalFormer; import cn.academy.crafting.ImagFusorRecipes; import cn.academy.crafting.MetalFormerRecipes; @@ -17,7 +18,7 @@ import java.util.Collections; import java.util.Iterator; -@RegistryDescription +@RegistryDescription(linkGenerator = Main.MODID) public class MetalFormer extends StandardListRegistry { @MethodDescription(description = "groovyscript.wiki.academy.metal_former.add.etch", type = MethodDescription.Type.ADDITION) diff --git a/src/main/java/cn/lambdalib2/LambdaLib2.java b/src/main/java/cn/lambdalib2/LambdaLib2.java index aa3c079e..08883476 100644 --- a/src/main/java/cn/lambdalib2/LambdaLib2.java +++ b/src/main/java/cn/lambdalib2/LambdaLib2.java @@ -1,5 +1,6 @@ package cn.lambdalib2; +import cn.academy.Tags; import cn.lambdalib2.multiblock.MsgBlockMulti; import cn.lambdalib2.registry.RegistryMod; import cn.lambdalib2.registry.impl.RegistryManager; @@ -14,21 +15,24 @@ import net.minecraftforge.fml.common.event.*; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper; +import net.minecraftforge.fml.relauncher.FMLLaunchHandler; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import org.apache.logging.log4j.Logger; -@RegistryMod(resourceDomain = "lambdalib2") -@Mod(modid = LambdaLib2.MODID, version = LambdaLib2.VERSION) +import static cn.lambdalib2.LambdaLib2.MODID; + +@RegistryMod(resourceDomain = MODID) +@Mod(modid = MODID, version = LambdaLib2.VERSION) public class LambdaLib2 { - public static final String MODID = "lambdalib2"; - public static final String VERSION = "@LAMBDA_LIB_VERSION@"; + public static final String MODID = Tags.LAMBDALIB_MOD_ID; + public static final String VERSION = Tags.LAMBDA_LIB_VERSION; /** * Whether we are in development (debug) mode. */ - public static final boolean DEBUG = VERSION.startsWith("@"); + public static final boolean DEBUG = FMLLaunchHandler.isDeobfuscatedEnvironment(); public static final SimpleNetworkWrapper channel = NetworkRegistry.INSTANCE.newSimpleChannel(MODID); public static Configuration config; diff --git a/tags.properties b/tags.properties new file mode 100644 index 00000000..039de063 --- /dev/null +++ b/tags.properties @@ -0,0 +1,6 @@ +VERSION = ${mod_version} +MOD_ID = ${mod_id} +LAMBDALIB_MOD_ID = ${lambdalib_mod_id} +MOD_NAME = ${mod_name} +LAMBDA_LIB_VERSION = ${lambdalib_ver} +ROOT_PACKAGE = ${root_package} \ No newline at end of file