Skip to content

Commit

Permalink
night auto config
Browse files Browse the repository at this point in the history
  • Loading branch information
RawDiamondMC committed Jul 13, 2024
1 parent 2e1d611 commit 23c9761
Show file tree
Hide file tree
Showing 13 changed files with 69 additions and 67 deletions.
5 changes: 4 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
base
java
alias(libs.plugins.fabric.loom)
id("org.jetbrains.kotlin.jvm") version "2.0.20-Beta1"
id("org.jetbrains.kotlin.jvm") version "2.0.20-Beta2"
}

group = libs.versions.maven.group.get()
Expand Down Expand Up @@ -125,6 +125,9 @@ dependencies {
api(libs.exp4j)?.let {
include(it)
}
api(libs.night.auto.config)?.let {
include(it)
}

// Development
api("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ rip = "1.0.0-1.20.x"
tags-binder = "0.3"
brrp = "1.0.1-mc1.20.1-fabric"
exp4j = "0.4.8"
night-auto-config = "1.0.3-fabric1.20"

[libraries]
minecraft = { group = "com.mojang", name = "minecraft", version.ref = "minecraft" }
Expand Down Expand Up @@ -80,6 +81,7 @@ rip = { group = "com.github.HO-Artisan", name = "RecipeInProgramming", version.r
tags-binder = { group = "com.github.DM-Earth", name = "Tags-Binder", version.ref = "tags-binder" }
brrp = { group = "maven.modrinth", name = "brrp", version.ref = "brrp" }
exp4j = { group = "net.objecthunter", name = "exp4j", version.ref = "exp4j" }
night-auto-config = { group = "com.github.KessokuTeaTime", name = "Night-Auto-Config", version.ref = "night-auto-config"}

[bundles]
# Implemented Mods
Expand Down
16 changes: 8 additions & 8 deletions index.toml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ metafile = true

[[files]]
file = "mods/ae2.pw.toml"
hash = "73ca8e414d5370acc3a2d6eda4f4b7f1c273c78b0f5545a8c42425dec18e22f0"
hash = "0c9015aa5398140bff02d2c2f8f837e5b903ac53ca7c2496afb98e30cf08285b"
metafile = true

[[files]]
Expand Down Expand Up @@ -197,7 +197,7 @@ metafile = true

[[files]]
file = "mods/bounced.pw.toml"
hash = "5f3a9bccd6ca727d4fcd8105320e636429c7f3c642c3a3e7689b0df25d52ff65"
hash = "0f770aa873be6fd23b6c78a8805bd7aa4d049fb173afad535f16ac6216232e77"
metafile = true

[[files]]
Expand Down Expand Up @@ -252,7 +252,7 @@ metafile = true

[[files]]
file = "mods/edgeless-cs.pw.toml"
hash = "71e6244c015ace1bced37a9a29f539ab20d3baf0de5eddf83f20c4455d32dc25"
hash = "c484b27e1c7af33f97cd8a2de843823f76a721171bff796c00ab0809595942cf"
metafile = true

[[files]]
Expand All @@ -277,7 +277,7 @@ metafile = true

[[files]]
file = "mods/faded-widgets.pw.toml"
hash = "5d8d0a6275db0f9ef98e84b756726736ccef4ea11170e4d82b7048416134c220"
hash = "eeea78d6bdc7f236aef6ea05a2be10646e5ab64d8a1c310feb66a5c7362962b5"
metafile = true

[[files]]
Expand All @@ -302,7 +302,7 @@ metafile = true

[[files]]
file = "mods/indium.pw.toml"
hash = "523659698dcfb97f79c9971a9c3ce41ba5e654d55b0464d73da01a63cd9a1824"
hash = "31278d67704a56eb32d93c240e4bfd9822e1ab6047ee14d752953dd0c24dca95"
metafile = true

[[files]]
Expand All @@ -317,7 +317,7 @@ metafile = true

[[files]]
file = "mods/ive-spoken.pw.toml"
hash = "20e036f1f205ffe46c21b06e8fd3574559756d09e793cb496766ac9cf17b114d"
hash = "ec3cc0296e021c793e020382d9ef59463f6ed82052a94cd094050e1ab5bd3da5"
metafile = true

[[files]]
Expand Down Expand Up @@ -407,12 +407,12 @@ metafile = true

[[files]]
file = "mods/sodium.pw.toml"
hash = "c3774af2e5f18da0c4cb00f95421a08bf9f0dda90a4169ce87b021d2f8d0dbce"
hash = "245530bdbb5c4127a1286f3722778d71e478194a8dcee89388c8fd247b4a57da"
metafile = true

[[files]]
file = "mods/splasher.pw.toml"
hash = "7c7abe828c08587152da0bd2af5dbba5ff896c2dc24695c71d994a384df335bb"
hash = "a982b8fd5d0f0768dc220577334496b96b4a601e96e58cdb701909545b135836"
metafile = true

[[files]]
Expand Down
8 changes: 4 additions & 4 deletions mods/ae2.pw.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "Applied Energistics 2"
filename = "appliedenergistics2-fabric-15.2.0.jar"
filename = "appliedenergistics2-fabric-15.2.9.jar"
side = "both"

[download]
url = "https://cdn.modrinth.com/data/XxWD5pD3/versions/qpG9cRjY/appliedenergistics2-fabric-15.2.0.jar"
url = "https://cdn.modrinth.com/data/XxWD5pD3/versions/fatWoH9r/appliedenergistics2-fabric-15.2.9.jar"
hash-format = "sha1"
hash = "ef1619d2a602350e6133c8471d4f2e28834d5ba3"
hash = "de1bb69a97c688ba738586278c0e25c03ad8e399"

[update]
[update.modrinth]
mod-id = "XxWD5pD3"
version = "qpG9cRjY"
version = "fatWoH9r"
8 changes: 4 additions & 4 deletions mods/bounced.pw.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "Bounced"
filename = "bounced-4.1.0-fabric1.20.jar"
filename = "bounced-4.1.1-fabric1.20.jar"
side = "client"

[download]
url = "https://cdn.modrinth.com/data/2mlOZXZr/versions/MCUZT7iQ/bounced-4.1.0-fabric1.20.jar"
url = "https://cdn.modrinth.com/data/2mlOZXZr/versions/eeS0bDZR/bounced-4.1.1-fabric1.20.jar"
hash-format = "sha1"
hash = "6618559fc878597213566aec1b500aa8bd83c3e5"
hash = "0bc3dd3a2a24707d8af50ff1f8f4440a0704d941"

[update]
[update.modrinth]
mod-id = "2mlOZXZr"
version = "MCUZT7iQ"
version = "eeS0bDZR"
8 changes: 4 additions & 4 deletions mods/edgeless-cs.pw.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "Edgeless Chat Screen"
filename = "edgelesschatscreen-1.1.2-fabric1.20.jar"
filename = "edgelesschatscreen-1.1.3-fabric1.20.jar"
side = "client"

[download]
url = "https://cdn.modrinth.com/data/lS8sHS85/versions/A4nSGhM5/edgelesschatscreen-1.1.2-fabric1.20.jar"
url = "https://cdn.modrinth.com/data/lS8sHS85/versions/qRZe4EYK/edgelesschatscreen-1.1.3-fabric1.20.jar"
hash-format = "sha1"
hash = "c226ad7db52a52ac0ab048342de22029711d06b0"
hash = "7891d245fb68b6058a1c089cb42136975e9c7142"

[update]
[update.modrinth]
mod-id = "lS8sHS85"
version = "A4nSGhM5"
version = "qRZe4EYK"
8 changes: 4 additions & 4 deletions mods/faded-widgets.pw.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "Faded Widgets"
filename = "fadedwidgets-2.1.0-fabric1.20.jar"
filename = "fadedwidgets-2.1.1-fabric1.20.jar"
side = "client"

[download]
url = "https://cdn.modrinth.com/data/uV6OSNDy/versions/MnV09kij/fadedwidgets-2.1.0-fabric1.20.jar"
url = "https://cdn.modrinth.com/data/uV6OSNDy/versions/gI5EUEgD/fadedwidgets-2.1.1-fabric1.20.jar"
hash-format = "sha1"
hash = "55882df2e1b9dcf457db3b4e0ed35cc74f5becb8"
hash = "2a67e616a70f490edb536decde5aa105f87bbd1f"

[update]
[update.modrinth]
mod-id = "uV6OSNDy"
version = "MnV09kij"
version = "gI5EUEgD"
8 changes: 4 additions & 4 deletions mods/indium.pw.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "Indium"
filename = "indium-1.0.32+mc1.20.1.jar"
filename = "indium-1.0.34+mc1.20.1.jar"
side = "client"

[download]
url = "https://cdn.modrinth.com/data/Orvt0mRa/versions/XPsoVC5n/indium-1.0.32%2Bmc1.20.1.jar"
url = "https://cdn.modrinth.com/data/Orvt0mRa/versions/gofbpynL/indium-1.0.34%2Bmc1.20.1.jar"
hash-format = "sha1"
hash = "6689db86e97a6e112c36d276070fb537a1f3596e"
hash = "a2de9ba15f155b09626995ad58b0e23803b05fe6"

[update]
[update.modrinth]
mod-id = "Orvt0mRa"
version = "XPsoVC5n"
version = "gofbpynL"
8 changes: 4 additions & 4 deletions mods/ive-spoken.pw.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "I've Spoken"
filename = "ivespoken-2.1.0-fabric1.20.jar"
filename = "ivespoken-2.2.0-fabric1.20.jar"
side = "both"

[download]
url = "https://cdn.modrinth.com/data/OidSa416/versions/N1k1TgUo/ivespoken-2.1.0-fabric1.20.jar"
url = "https://cdn.modrinth.com/data/OidSa416/versions/vNVnAgca/ivespoken-2.2.0-fabric1.20.jar"
hash-format = "sha1"
hash = "ae39ea51190b5b95b522c6c18e5ae3581effa24c"
hash = "95a4657b63f79a4206362e3078141e9df53c7ca6"

[update]
[update.modrinth]
mod-id = "OidSa416"
version = "N1k1TgUo"
version = "vNVnAgca"
8 changes: 4 additions & 4 deletions mods/sodium.pw.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "Sodium"
filename = "sodium-fabric-0.5.10+mc1.20.1.jar"
filename = "sodium-fabric-0.5.11+mc1.20.1.jar"
side = "client"

[download]
url = "https://cdn.modrinth.com/data/AANobbMI/versions/dEpHs0Hg/sodium-fabric-0.5.10%2Bmc1.20.1.jar"
url = "https://cdn.modrinth.com/data/AANobbMI/versions/ygf8cVZg/sodium-fabric-0.5.11%2Bmc1.20.1.jar"
hash-format = "sha1"
hash = "0a47b4930e2340173e00470f8f9da51374aa765d"
hash = "c4293c1483f3b39c1c6c4c69143e8bb2c6e53daf"

[update]
[update.modrinth]
mod-id = "AANobbMI"
version = "dEpHs0Hg"
version = "ygf8cVZg"
8 changes: 4 additions & 4 deletions mods/splasher.pw.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name = "Splasher!"
filename = "splasher-6.1.0-fabric1.20.jar"
filename = "splasher-6.2.0-fabric1.20.jar"
side = "client"

[download]
url = "https://cdn.modrinth.com/data/4yIZUuyx/versions/uL5uQolp/splasher-6.1.0-fabric1.20.jar"
url = "https://cdn.modrinth.com/data/4yIZUuyx/versions/gtoNK8dP/splasher-6.2.0-fabric1.20.jar"
hash-format = "sha1"
hash = "d4af99a54b8b64b3cc8e0510bfc57816e6d6f34c"
hash = "b1eef0ec9983ff1155b54b2b5a6e1990f73fe9fb"

[update]
[update.modrinth]
mod-id = "4yIZUuyx"
version = "uL5uQolp"
version = "gtoNK8dP"
2 changes: 1 addition & 1 deletion pack.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pack-format = "packwiz:1.1.0"
[index]
file = "index.toml"
hash-format = "sha256"
hash = "9b747ab73be44953fd81f1af93187714b7683da098510736144ecf7a24fe0a21"
hash = "fe902bff53c92426161b5988ffd50589c164fdd5f30a792d2b9808cfc401d5b5"

[versions]
fabric = "0.15.11"
Expand Down
47 changes: 22 additions & 25 deletions src/main/java/dm/earth/cabricality/config/CabfConfig.java
Original file line number Diff line number Diff line change
@@ -1,56 +1,53 @@
package dm.earth.cabricality.config;

import net.fabricmc.loader.api.FabricLoader;
import net.krlite.pierced.annotation.Silent;
import net.krlite.pierced.annotation.Table;
import net.krlite.pierced.config.Pierced;
import dm.earth.cabricality.Cabricality;
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;
import me.shedaniel.autoconfig.annotation.ConfigEntry;

import java.io.File;

public class CabfConfig extends Pierced {
private static @Silent final File FILE = FabricLoader.getInstance().getConfigDir().resolve("cabricality.toml").toFile();
private static @Silent final CabfConfig INSTANCE = new CabfConfig();

private CabfConfig() {
super(CabfConfig.class, FILE);
load();
}
@Config(name = Cabricality.ID)
public class CabfConfig implements ConfigData {

public static void override() {
INSTANCE.save();
AutoConfig.getConfigHolder(CabfConfig.class).save();
}

private boolean includeVersionInWindowTitle = false;

public static boolean includeVersionInWindowTitle() {
return INSTANCE.includeVersionInWindowTitle;
return CabfConfig.getConfig().includeVersionInWindowTitle;
}

public static void includeVersionInWindowTitle(boolean includeVersionInGameTitle) {
INSTANCE.includeVersionInWindowTitle = includeVersionInGameTitle;
INSTANCE.save();
CabfConfig.getConfig().includeVersionInWindowTitle = includeVersionInGameTitle;
CabfConfig.override();
}

public static CabfConfig getConfig() {
return AutoConfig.getConfigHolder(CabfConfig.class).getConfig();
}

private boolean fadeScreenBackground = true;

public static boolean fadeScreenBackground() {
return INSTANCE.fadeScreenBackground;
return CabfConfig.getConfig().fadeScreenBackground;
}

public static void fadeScreenBackground(boolean fadeScreenBackground) {
INSTANCE.fadeScreenBackground = fadeScreenBackground;
INSTANCE.save();
CabfConfig.getConfig().fadeScreenBackground = fadeScreenBackground;
CabfConfig.override();
}

@Table("debug")
@ConfigEntry.Category("debug")
private boolean debugInfo = false;

public static boolean debugInfo() {
return INSTANCE.debugInfo;
return CabfConfig.getConfig().debugInfo;
}

public static void debugInfo(boolean debugInfo) {
INSTANCE.debugInfo = debugInfo;
INSTANCE.save();
CabfConfig.getConfig().debugInfo = debugInfo;
CabfConfig.override();
}
}

0 comments on commit 23c9761

Please sign in to comment.