Update to LibJF 3

This commit is contained in:
Johannes Frohnmeyer 2022-08-28 16:42:27 +02:00
parent df9deeb570
commit 59f4ef0e62
Signed by: Johannes
GPG Key ID: E76429612C2929F4
8 changed files with 876 additions and 880 deletions

View File

@ -1,12 +1,12 @@
apply from: "https://jfmods.gitlab.io/scripts/jfmod.gradle"
apply from: "https://jfmods.gitlab.io/scripts/gradle/v2.gradle"
dependencies {
modImplementation("io.gitlab.jfronny.libjf:libjf-config-v0:${project.jfapi_version}")
modImplementation("io.gitlab.jfronny.libjf:libjf-translate-v1:${project.jfapi_version}")
modImplementation("io.gitlab.jfronny.libjf:libjf-config-core-v1:${project.libjf_version}")
modImplementation("io.gitlab.jfronny.libjf:libjf-translate-v1:${project.libjf_version}")
modRuntimeOnly("io.gitlab.jfronny.libjf:libjf-devutil-v0:${project.jfapi_version}")
modImplementation "com.terraformersmc:modmenu:4.0.5"
modImplementation(fabricApi.module("fabric-command-api-v2", "${project.fabric_version}"))
// Dev env
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-reflect-v1:${project.libjf_version}")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-config-ui-tiny-v1:${project.libjf_version}")
modLocalRuntime("io.gitlab.jfronny.libjf:libjf-devutil:${project.libjf_version}")
modLocalRuntime("com.terraformersmc:modmenu:4.0.6")
}

View File

@ -1,12 +1,12 @@
# https://fabricmc.net/develop/
minecraft_version=1.19.1
yarn_mappings=build.1
loader_version=0.14.8
minecraft_version=1.19.2
yarn_mappings=build.8
loader_version=0.14.9
maven_group=io.gitlab.jfronny
archives_base_name=translater
jfapi_version=2.10.0
fabric_version=0.58.0+1.19.1
libjf_version=3.0.3
fabric_version=0.60.0+1.19.2
modrinth_id=translater
modrinth_required_dependencies=libjf

View File

@ -1,24 +1,13 @@
package io.gitlab.jfronny.translater;
import io.gitlab.jfronny.libjf.config.api.Entry;
import io.gitlab.jfronny.libjf.config.api.JfConfig;
import io.gitlab.jfronny.libjf.config.api.v1.Entry;
import io.gitlab.jfronny.libjf.config.api.v1.JfConfig;
public class Cfg implements JfConfig {
@Entry
public static int rounds = 5;
@Entry
public static boolean breakFully = false;
@Entry
public static String targetLanguage = "en";
@Entry
public static ProgressMode renderProgress = ProgressMode.None;
@Entry
public static boolean forceRegenerate = false;
public enum ProgressMode {
Full,
Gui,
Console,
None
}
@JfConfig(referencedConfigs = "libjf-translate-v1")
public class Cfg {
@Entry public static int rounds = 5;
@Entry public static boolean breakFully = false;
@Entry public static String targetLanguage = "en";
@Entry public static ProgressMode renderProgress = ProgressMode.None;
@Entry public static boolean forceRegenerate = false;
}

View File

@ -0,0 +1,8 @@
package io.gitlab.jfronny.translater;
public enum ProgressMode {
Full,
Gui,
Console,
None
}

View File

@ -20,10 +20,10 @@ public class Translater {
private static final TransformingMap map = new TransformingMap(new CachingTransformer(new TranslatingTransformer<>(TranslateService.getConfigured())));
public static boolean progressUIEnabled() {
return Cfg.renderProgress == Cfg.ProgressMode.Full || Cfg.renderProgress == Cfg.ProgressMode.Gui;
return Cfg.renderProgress == ProgressMode.Full || Cfg.renderProgress == ProgressMode.Gui;
}
public static boolean progressLogsEnabled() {
return Cfg.renderProgress == Cfg.ProgressMode.Full || Cfg.renderProgress == Cfg.ProgressMode.Console;
return Cfg.renderProgress == ProgressMode.Full || Cfg.renderProgress == ProgressMode.Console;
}
public static @NotNull TransformingMap getMap(@Nullable Map<String, String> base) {

View File

@ -1,6 +1,6 @@
package io.gitlab.jfronny.translater.transformer;
import io.gitlab.jfronny.libjf.config.api.ConfigHolder;
import io.gitlab.jfronny.libjf.config.api.v1.ConfigHolder;
import io.gitlab.jfronny.translater.Cfg;
import io.gitlab.jfronny.translater.Translater;
import net.fabricmc.loader.api.FabricLoader;

File diff suppressed because it is too large Load Diff

View File

@ -23,16 +23,13 @@
"depends": {
"fabricloader": ">=0.12.12",
"minecraft": "*",
"libjf-config-v0": ">=2.7.0",
"libjf-translate-v1": ">=2.7.0"
"libjf-config-core-v1": ">=3.0.3",
"libjf-translate-v1": ">=3.0.3"
},
"custom": {
"modupdater": {
"strategy": "curseforge",
"projectID": 394823
},
"libjf:config": {
"referencedConfigs": ["libjf-translate-v1"]
}
}
}