Compare commits

...

2 Commits

Author SHA1 Message Date
李昌哲
84fc1d0d24 Merge 0d2c952a54 into 9602736335 2025-08-14 18:42:49 +08:00
Jaffe2718
0d2c952a54 Unify the test mod ID 2025-08-14 18:41:43 +08:00
5 changed files with 12 additions and 25 deletions

View File

@@ -1,14 +0,0 @@
package eu.midnightdust.lib.util;
import java.awt.Color;
public class MidnightColorUtil {
/**
* @param colorStr e.g. "FFFFFF" or "#FFFFFF"
* @return Color as RGB
*/
public static Color hex2Rgb(String colorStr) {
try { return Color.decode("#" + colorStr.replace("#", ""));
} catch (Exception ignored) { return Color.BLACK; }
}
}

View File

@@ -1,10 +1,10 @@
{ {
"schemaVersion": 1, "schemaVersion": 1,
"id": "testmod", "id": "modid",
"version": "${version}", "version": "${version}",
"name": "MidnightLib Example", "name": "MidnightLib Test Mod",
"description": "Wow, you can do so much.", "description": "Example Mod for Team MidnightDust's mods.",
"authors": [ "MidnightDust" ], "authors": [ "MidnightDust" ],
"license": "CC0", "license": "CC0",

View File

@@ -43,7 +43,7 @@ loom {
create('midnightlib') { create('midnightlib') {
sourceSet sourceSets.main sourceSet sourceSets.main
} }
create('testmod') { create('modid') { // test mod
sourceSet sourceSets.test sourceSet sourceSets.test
} }
} }

View File

@@ -3,9 +3,10 @@ package eu.midnightdust.test.neoforge;
import eu.midnightdust.test.config.MidnightConfigExample; import eu.midnightdust.test.config.MidnightConfigExample;
import net.neoforged.fml.common.Mod; import net.neoforged.fml.common.Mod;
@Mod("testmod") @Mod(MLExampleNeoForge.MODID)
public class MLExampleNeoForge { public class MLExampleNeoForge {
public static final String MODID = "modid";
public MLExampleNeoForge() { public MLExampleNeoForge() {
MidnightConfigExample.init("modid", MidnightConfigExample.class); MidnightConfigExample.init(MODID, MidnightConfigExample.class);
} }
} }

View File

@@ -4,29 +4,29 @@ loaderVersion = "[2,)"
license = "MIT License" license = "MIT License"
[[mods]] [[mods]]
modId = "testmod" modId = "modid"
version = "${version}" version = "${version}"
displayName = "Example Mod" displayName = "MidnightLib Test Mod"
authors = "TeamMidnightDust, Motschen" authors = "TeamMidnightDust, Motschen"
description = ''' description = '''
Example Mod for Team MidnightDust's mods. Example Mod for Team MidnightDust's mods.
''' '''
[[dependencies.testmod]] [[dependencies.modid]]
modId = "neoforge" modId = "neoforge"
mandatory = true mandatory = true
versionRange = "[20.5,)" versionRange = "[20.5,)"
ordering = "NONE" ordering = "NONE"
side = "BOTH" side = "BOTH"
[[dependencies.testmod]] [[dependencies.modid]]
modId = "minecraft" modId = "minecraft"
mandatory = true mandatory = true
versionRange = "[1.20.5,)" versionRange = "[1.20.5,)"
ordering = "NONE" ordering = "NONE"
side = "BOTH" side = "BOTH"
[[dependencies.testmod]] [[dependencies.modid]]
modId = "midnightlib" modId = "midnightlib"
mandatory = true mandatory = true
versionRange = "[1.0,)" versionRange = "[1.0,)"