From ae4f4ef9f8a1e1eadbed44c7d8b2bcf21d3bc00d Mon Sep 17 00:00:00 2001 From: KrLite <68179735+KrLite@users.noreply.github.com> Date: Wed, 1 May 2024 12:35:57 +0800 Subject: [PATCH] init --- build.gradle.kts | 7 ++++++ gradle/libs.versions.toml | 21 +++++++++++++---- .../band/kessokuteatime/modid/ExampleMod.java | 14 ----------- .../nightautoconfig/NightAutoConfig.java | 15 ++++++++++++ .../JsonNightConfigSerializer.java | 4 ++++ .../{modid => nightautoconfig}/icon.png | Bin .../lang/zh_cn.json | 0 src/main/resources/fabric.mod.json | 22 +++++++++++------- src/main/resources/modid.mixins.json | 2 +- 9 files changed, 56 insertions(+), 29 deletions(-) delete mode 100644 src/main/java/band/kessokuteatime/modid/ExampleMod.java create mode 100644 src/main/java/band/kessokuteatime/nightautoconfig/NightAutoConfig.java create mode 100644 src/main/java/band/kessokuteatime/nightautoconfig/serializers/JsonNightConfigSerializer.java rename src/main/resources/assets/{modid => nightautoconfig}/icon.png (100%) rename src/main/resources/assets/{modid => nightautoconfig}/lang/zh_cn.json (100%) diff --git a/build.gradle.kts b/build.gradle.kts index 15cbb86..b03a1f2 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -28,12 +28,19 @@ base { repositories { mavenCentral() + maven { url = uri("https://maven.shedaniel.me/") } + maven { url = uri("https://maven.terraformersmc.com/releases/") } } dependencies { minecraft(libs.minecraft) mappings(libs.yarn) modImplementation(libs.bundles.fabric) + + modImplementation(libs.cloth.config) + + implementation(libs.bundles.night.config) + include(libs.bundles.night.config) } java { diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5bfea88..737230d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,22 +1,25 @@ [versions] maven-group = "band.kessokuteatime" -archives-name = "modid" +archives-name = "nightautoconfig" mod = "1.0.0" loader = "fabric" -minecraft = "1.20" -yarn = "1.20+build.1" +minecraft = "1.18" +yarn = "1.18+build.1" fabric-loader = "0.15.10" -fabric-api = "0.83.0+1.20" +fabric-api = "0.44.0+1.18" fabric-loom = "1.6-SNAPSHOT" modpublisher = "2.1.0" +cloth-config = "6.5.116" +night-config = "3.6.0" + # id id-modrinth = "id" id-curseforge = "id" # display -display-name = "Example" +display-name = "Night Auto Config" display-loader = "Fabric" display-version = "1.20.x" @@ -26,9 +29,17 @@ yarn = { group = "net.fabricmc", name = "yarn", version.ref = "yarn" } fabric-loader = { group = "net.fabricmc", name = "fabric-loader", version.ref = "fabric-loader" } fabric-api = { group = "net.fabricmc.fabric-api", name = "fabric-api", version.ref = "fabric-api" } +cloth-config = { group = "me.shedaniel.cloth", name = "cloth-config-fabric", version.ref = "cloth-config" } + +night-config-json = { group = "com.electronwill.night-config", name = "json", version.ref = "night-config" } +night-config-toml = { group = "com.electronwill.night-config", name = "toml", version.ref = "night-config" } +night-config-hocon = { group = "com.electronwill.night-config", name = "hocon", version.ref = "night-config" } +night-config-yaml = { group = "com.electronwill.night-config", name = "yaml", version.ref = "night-config" } + [plugins] fabric-loom = { id = "fabric-loom", version.ref = "fabric-loom" } modpublisher = { id = "com.hypherionmc.modutils.modpublisher", version.ref = "modpublisher" } [bundles] fabric = ["fabric-loader", "fabric-api"] +night-config = ["night-config-json", "night-config-toml", "night-config-hocon", "night-config-yaml"] diff --git a/src/main/java/band/kessokuteatime/modid/ExampleMod.java b/src/main/java/band/kessokuteatime/modid/ExampleMod.java deleted file mode 100644 index 9d3f788..0000000 --- a/src/main/java/band/kessokuteatime/modid/ExampleMod.java +++ /dev/null @@ -1,14 +0,0 @@ -package band.kessokuteatime.modid; - -import net.fabricmc.api.ModInitializer; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ExampleMod implements ModInitializer { - public static final String NAME = "Mod Name", ID = "modid"; - public static final Logger LOGGER = LoggerFactory.getLogger(ID); - - @Override - public void onInitialize() { - } -} diff --git a/src/main/java/band/kessokuteatime/nightautoconfig/NightAutoConfig.java b/src/main/java/band/kessokuteatime/nightautoconfig/NightAutoConfig.java new file mode 100644 index 0000000..2c0cfac --- /dev/null +++ b/src/main/java/band/kessokuteatime/nightautoconfig/NightAutoConfig.java @@ -0,0 +1,15 @@ +package band.kessokuteatime.nightautoconfig; + +import net.fabricmc.api.ClientModInitializer; +import net.fabricmc.api.ModInitializer; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class NightAutoConfig implements ClientModInitializer { + public static final String NAME = "Night Auto Config", ID = "nightautoconfig"; + public static final Logger LOGGER = LoggerFactory.getLogger(ID); + + @Override + public void onInitializeClient() { + } +} diff --git a/src/main/java/band/kessokuteatime/nightautoconfig/serializers/JsonNightConfigSerializer.java b/src/main/java/band/kessokuteatime/nightautoconfig/serializers/JsonNightConfigSerializer.java new file mode 100644 index 0000000..00ddafc --- /dev/null +++ b/src/main/java/band/kessokuteatime/nightautoconfig/serializers/JsonNightConfigSerializer.java @@ -0,0 +1,4 @@ +package band.kessokuteatime.nightautoconfig.serializers; + +public class JsonNightConfigSerializer { +} diff --git a/src/main/resources/assets/modid/icon.png b/src/main/resources/assets/nightautoconfig/icon.png similarity index 100% rename from src/main/resources/assets/modid/icon.png rename to src/main/resources/assets/nightautoconfig/icon.png diff --git a/src/main/resources/assets/modid/lang/zh_cn.json b/src/main/resources/assets/nightautoconfig/lang/zh_cn.json similarity index 100% rename from src/main/resources/assets/modid/lang/zh_cn.json rename to src/main/resources/assets/nightautoconfig/lang/zh_cn.json diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index fc0ef89..808a1c7 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,6 +1,6 @@ { "schemaVersion": 1, - "id": "modid", + "id": "nightautoconfig", "version": "${version}", "name": "${display.name}", @@ -10,27 +10,31 @@ "KrLite" ], "contact": { - "homepage": "https://modrinth.com/mod/modid", - "sources": "https://github.com/KessokuTeaTime/Example-Mod", - "issues": "https://github.com/KessokuTeaTime/Example-Mod/issues" + "homepage": "https://modrinth.com/mod/night-auto-config", + "sources": "https://github.com/KessokuTeaTime/Night-Auto-Config", + "issues": "https://github.com/KessokuTeaTime/Night-Auto-Config/issues" }, "license": "GPL-3.0", - "icon": "assets/modid/icon.png", + "icon": "assets/nightautoconfig/icon.png", "environment": "*", "entrypoints": { - "main": [ - "band.kessoku.modid.ExampleMod" + "client": [ + "band.kessokuteatime.nightautoconfig.NightAutoConfig" ] }, "mixins": [ "modid.mixins.json" ], - + "custom": { + "modmenu": { + "badges": ["library"] + } + }, "depends": { "fabricloader": "*", - "fabric-api": "*", + "cloth-config": ">=6", "minecraft": "1.20.x" }, "suggests": { diff --git a/src/main/resources/modid.mixins.json b/src/main/resources/modid.mixins.json index 006cff7..4a5769a 100644 --- a/src/main/resources/modid.mixins.json +++ b/src/main/resources/modid.mixins.json @@ -1,7 +1,7 @@ { "required": true, "minVersion": "0.8", - "package": "band.kessokuteatime.modid.mixin", + "package": "band.kessokuteatime.nightautoconfig.mixin", "compatibilityLevel": "JAVA_17", "mixins": [ ],