Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions gradle/forge.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
ldlib = "1.0.40.b"
registrate = "MC1.20-1.3.11"
configuration = "2.2.0"
configuration = "3.1.0-forge"
mixinExtras = "0.5.0-rc.3"

jei = "15.20.0.115"
Expand Down Expand Up @@ -52,11 +52,10 @@ ftbteams-cm = "5267190"
ftbquests-cm = "6167056"
ftbchunks-cm = "5956390"


[libraries]
ldlib = { module = "com.lowdragmc.ldlib:ldlib-forge-1.20.1", version.ref = "ldlib" }
registrate = { module = "com.tterrag.registrate:Registrate", version.ref = "registrate" }
configuration = { module = "dev.toma.configuration:configuration-forge-1.20.1", version.ref = "configuration" }
configuration = { module = "dev.toma.configuration:configuration-1.20.1", version.ref = "configuration" }
mixinExtras-common = { module = "io.github.llamalad7:mixinextras-common", version.ref = "mixinExtras" }
mixinExtras-forge = { module = "io.github.llamalad7:mixinextras-forge", version.ref = "mixinExtras" }

Expand Down
8 changes: 8 additions & 0 deletions gradle/scripts/repositories.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ repositories {
url = "https://maven.firstdark.dev/snapshots"
}


exclusiveContent { // Create, Ponder, Flywheel
forRepository { maven { url = "https://maven.createmod.net" } }
filter {
Expand All @@ -35,6 +36,13 @@ repositories {
includeGroup("dev.engine-room.flywheel")
}
}
exclusiveContent { // Configuration
forRepositories(
maven { url = "https://repo.repsy.io/mvn/toma/public/" },
maven { url = "https://api.repsy.io/mvn/toma/public" },
)
filter { includeGroup("dev.toma.configuration")}
}
exclusiveContent { // KubeJS and Rhino
forRepository { maven { url = "https://maven.latvian.dev/releases" } }
filter { includeGroup("dev.latvian.mods")}
Expand Down
2 changes: 1 addition & 1 deletion gradle/scripts/resources.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var generateModMetadata = tasks.register("generateModMetadata", ProcessResources
minecraft_version : libs.versions.minecraft.get(),
loader_version : forgeVers,
forge_version : forgeVers, // only specify major version of forge
configuration_version: forge.versions.configuration.get(),
configuration_version: forge.versions.configuration.get().split("-")[0],
kjs_version : forge.versions.kubejs.get().split("\\.")[0], // only specify major version of kjs
ldlib_version : forge.versions.ldlib.get(),
jei_version : forge.versions.jei.get(),
Expand Down
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,7 @@
"config.jade.plugin_gtceu.steam_boiler_info": "oɟuI ɹǝןıoᗺ ɯɐǝʇS ]nƎƆ⟘⅁[",
"config.jade.plugin_gtceu.transformer": "oɟuI ɹǝɯɹoɟsuɐɹ⟘ ]nƎƆ⟘⅁[",
"config.jade.plugin_gtceu.workable_provider": "ǝןqɐʞɹoM ]nƎƆ⟘⅁[",
"config.screen.gtceu": "uoıʇɐɹnbıɟuoƆ nƎƆɥɔǝ⟘bǝɹ⅁",
"cover.advanced_detector.latch.disabled.0": "snonuıʇuoƆ :ɹoıʌɐɥǝᗺ",
"cover.advanced_detector.latch.disabled.1": "",
"cover.advanced_detector.latch.disabled.2": "˙ɹǝʌoƆ sıɥʇ ɟo ɹoıʌɐɥǝq ǝuoʇspǝɹ ǝɥʇ ǝbuɐɥƆ",
Expand Down
1 change: 1 addition & 0 deletions src/generated/resources/assets/gtceu/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1956,6 +1956,7 @@
"config.jade.plugin_gtceu.steam_boiler_info": "[GTCEu] Steam Boiler Info",
"config.jade.plugin_gtceu.transformer": "[GTCEu] Transformer Info",
"config.jade.plugin_gtceu.workable_provider": "[GTCEu] Workable",
"config.screen.gtceu": "GregTechCEu Configuration",
"cover.advanced_detector.latch.disabled.0": "Behavior: Continuous",
"cover.advanced_detector.latch.disabled.1": "",
"cover.advanced_detector.latch.disabled.2": "Change the redstone behavior of this Cover.",
Expand Down
145 changes: 111 additions & 34 deletions src/main/java/com/gregtechceu/gtceu/config/ConfigHolder.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,33 @@
import com.gregtechceu.gtceu.config.ConfigHolder;

import com.tterrag.registrate.providers.RegistrateLangProvider;
import dev.toma.configuration.Configuration;
import dev.toma.configuration.config.format.ConfigFormats;
import dev.toma.configuration.config.value.ConfigValue;
import dev.toma.configuration.config.value.ObjectValue;
import dev.toma.configuration.config.value.IConfigValue;
import dev.toma.configuration.config.value.IHierarchical;

import java.util.HashSet;
import java.util.Map;
import java.util.Set;

public class ConfigurationLang {

public static void init(RegistrateLangProvider provider) {
dfs(provider, new HashSet<>(),
Configuration.registerConfig(ConfigHolder.class, ConfigFormats.yaml()).getValueMap());
public static void init(final RegistrateLangProvider provider) {
provider.add("config.screen.gtceu", GTCEu.NAME + " Configuration");

final Set<String> added = new HashSet<>();
ConfigHolder.INTERNAL_INSTANCE.values()
.forEach((value) -> addTranslation(provider, added, value));
}

private static void dfs(RegistrateLangProvider provider, Set<String> added, Map<String, ConfigValue<?>> map) {
for (var entry : map.entrySet()) {
var id = entry.getValue().getId();
if (added.add(id)) {
provider.add(String.format("config.%s.option.%s", GTCEu.MOD_ID, id), id);
}
if (entry.getValue() instanceof ObjectValue objectValue) {
dfs(provider, added, objectValue.get());
private static void addTranslation(RegistrateLangProvider provider, Set<String> added, IConfigValue<?> value) {
var id = value.getId();
if (added.add(id)) {
provider.add("config.gtceu.option." + id, id);
}
if (value instanceof IHierarchical hierarchical) {
for (String childKey : value.getChildrenKeys()) {
IConfigValue<?> child = hierarchical.getChildById(childKey);
if (child != null) {
addTranslation(provider, added, child);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
*/
public interface IGridConnectedMachine extends IMachineFeature, IGridConnectedBlockEntity {

int ME_UPDATE_INTERVAL = ConfigHolder.INSTANCE.compat.ae2.updateIntervals;

/**
* @return return {@code true} if current machine connected to a valid ME network, {@code false} otherwise.
*/
Expand All @@ -27,7 +25,7 @@ public interface IGridConnectedMachine extends IMachineFeature, IGridConnectedBl
* @return {@code true} if current machine should interact with ME network, {@code false} otherwise.
*/
default boolean shouldSyncME() {
return self().getOffsetTimer() % ME_UPDATE_INTERVAL == 0;
return self().getOffsetTimer() % ConfigHolder.INSTANCE.compat.ae2.updateIntervals == 0;
}

default AECableType getCableConnectionType(Direction dir) {
Expand Down
Loading