Skip to content

Commit

Permalink
add Working Link Generator
Browse files Browse the repository at this point in the history
  • Loading branch information
yor42 committed Nov 18, 2024
1 parent 5200d29 commit ee1a3ea
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 16 deletions.
4 changes: 3 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 11 additions & 5 deletions src/main/java/cn/academy/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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" };
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {

Expand All @@ -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());
}
}
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -18,6 +19,6 @@ protected String version() {

@Override
protected String domain() {
return "https://github.com/yor42/AcademyCraft";
return "https://github.com/yor42/AcademyCraft/";
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -14,7 +15,7 @@
import java.util.Collections;
import java.util.Iterator;

@RegistryDescription
@RegistryDescription(linkGenerator = Main.MODID)
public class ImagFusor extends StandardListRegistry<ImagFusorRecipes.IFRecipe> {
@Override
public Collection<ImagFusorRecipes.IFRecipe> getRecipes() {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -17,7 +18,7 @@
import java.util.Collections;
import java.util.Iterator;

@RegistryDescription
@RegistryDescription(linkGenerator = Main.MODID)
public class MetalFormer extends StandardListRegistry<MetalFormerRecipes.RecipeObject> {

@MethodDescription(description = "groovyscript.wiki.academy.metal_former.add.etch", type = MethodDescription.Type.ADDITION)
Expand Down
14 changes: 9 additions & 5 deletions src/main/java/cn/lambdalib2/LambdaLib2.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
6 changes: 6 additions & 0 deletions tags.properties
Original file line number Diff line number Diff line change
@@ -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}

0 comments on commit ee1a3ea

Please sign in to comment.