Skip to content

Commit

Permalink
Merge branch 'refs/heads/1.20.4' into 1.20.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	gradle.properties
  • Loading branch information
Treetrain1 committed Jun 13, 2024
2 parents 9bb9429 + 517d170 commit 59a3436
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
4 changes: 1 addition & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,4 @@ Make sure to clear this after each release
Put changelog here:

-----------------
- Added `Config.onSync()`
- Allows configs to have special post-sync behavior
- Fixed licenses in Kotlin files
- Configs now save after the game loads to ensure they're loaded properly.
11 changes: 8 additions & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import groovy.xml.XmlSlurper
import org.codehaus.groovy.runtime.ResourceGroovyMethods
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.kohsuke.github.GHReleaseBuilder
import org.kohsuke.github.GitHub
Expand All @@ -20,7 +21,7 @@ buildscript {
}

plugins {
id("fabric-loom") version("+")
id("fabric-loom") version("1.6.+")
id("org.ajoberstar.grgit") version("+")
id("org.quiltmc.gradle.licenser") version("+")
id("com.modrinth.minotaur") version("+")
Expand All @@ -30,7 +31,7 @@ plugins {
idea
`java-library`
java
kotlin("jvm") version("1.9.23")
kotlin("jvm") version("2.0.0")
}

val minecraft_version: String by project
Expand Down Expand Up @@ -345,7 +346,11 @@ tasks {
}

withType(KotlinCompile::class) {
compilerOptions.jvmTarget = JvmTarget.JVM_17
compilerOptions {
jvmTarget = JvmTarget.JVM_17
languageVersion.set(KotlinVersion.KOTLIN_1_9)
apiVersion.set(KotlinVersion.KOTLIN_1_9)
}
}

withType(Test::class) {
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
minecraft_version=1.20.2
quilt_mappings=1.20.2+build.2
parchment_mappings=1.20.2:2023.12.10
loader_version=0.15.10
loader_version=0.15.11
min_loader_version=0.15.10

# Mod Properties
mod_version = 1.7.2
mod_version = 1.7.3
mod_loader = Fabric
maven_group = net.frozenblock
archives_base_name = FrozenLib

# Dependencies
fabric_api_version=0.91.6+1.20.2
fabric_kotlin_version=1.10.19+kotlin.1.9.23
fabric_kotlin_version=1.11.0+kotlin.2.0.0
toml4j_version=0.7.2
jankson_version=1.2.3
xjs_data_version=0.5
xjs_data_version=0.6
xjs_compat_version=0.8
fresult_version=3.0
fresult_version=3.1

# External Mods
modmenu_version=8.0.0
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/net/frozenblock/lib/FrozenMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerWorldEvents;
import net.fabricmc.loader.api.ModContainer;
import net.frozenblock.lib.config.api.instance.Config;
import net.frozenblock.lib.config.api.registry.ConfigRegistry;
import net.frozenblock.lib.config.frozenlib_config.FrozenLibConfig;
import net.frozenblock.lib.config.impl.ConfigCommand;
import net.frozenblock.lib.core.impl.DataPackReloadMarker;
Expand Down Expand Up @@ -142,6 +144,12 @@ public void onInitialize(String modId, ModContainer container) {
if (!allRegistries) return;
ModIntegrations.initialize();
});

RegistryFreezeEvents.END_REGISTRY_FREEZE.register((registry, allRegistries) -> {
for (Config<?> config : ConfigRegistry.getAllConfigs()) {
config.save();
}
});
}

@Contract("_ -> new")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.jetbrains.annotations.Unmodifiable;

public class ConfigRegistry {

private static final List<Config<?>> CONFIG_REGISTRY = new ObjectArrayList<>();
private static final Map<String, List<Config<?>>> MOD_CONFIG_REGISTRY = new Object2ObjectOpenHashMap<>();

Expand Down

0 comments on commit 59a3436

Please sign in to comment.