Skip to content

Commit

Permalink
sync 1.20.4/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Jun 1, 2024
1 parent 2d6dcf5 commit d6341b6
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 467 deletions.
14 changes: 1 addition & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<img height="200" width="200" src="https://github.com/HO-Artisan/AzusaConfig/blob/artwork/icon.png" alt="AzusaConfig Icon"/>

# AzusaConfig
# AzusaConfig for 1.20.1

###### A library to bring the Quilt Loader's Config system into Fabric/Forge/NeoForge.

Expand All @@ -11,18 +11,6 @@
> [!NOTE]
> Quilt is not supported because the [Quilt Loader](https://github.com/QuiltMC/quilt-loader) contains these functions natively. you can think of AzusaConfig as a port of [Quilt's Config system (quilt-config)](https://github.com/QuiltMC/quilt-config) to the Fabric/Forge/NeoForge.
## Use In Your Project

```groovy
repositories {
maven { url "https://jitpack.io" }
}
dependencies {
modImplementation "com.github.HO-Artisan:AzusaConfig:Tag"
}
```

## License
This mod under Apache-2.0 License.
Quilt Loader part under Apache-2.0 License.
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.4-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.5-SNAPSHOT" apply false
id "com.hypherionmc.modutils.modpublisher" version "2.0.+" apply false
}

Expand Down
6 changes: 3 additions & 3 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ dependencies {
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"

implementation "org.quiltmc:quilt-config:${rootProject.quiltconfig_version}"
implementation "org.quiltmc.parsers:json:${project.quiltparsers_version}"
implementation "com.electronwill.night-config:core:${rootProject.nightconfig_version}"
implementation "com.electronwill.night-config:toml:${rootProject.nightconfig_version}"
implementation "org.quiltmc.parsers:json:${rootProject.quiltparsers_version}"
implementation "org.quiltmc.quilt-config.serializers:toml:${rootProject.quiltconfig_version}"
implementation "org.quiltmc.quilt-config.serializers:json5:${rootProject.quiltconfig_version}"
}

publishing {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,27 +21,27 @@
import java.util.LinkedHashMap;
import java.util.Map;

import com.electronwill.nightconfig.toml.TomlParser;
import com.electronwill.nightconfig.toml.TomlWriter;
import ho.artisan.azusaconfig.AzusaConfigExpectPlatform;
import ho.artisan.azusaconfig.AzusaConfigMod;
import org.quiltmc.config.api.ConfigEnvironment;
import org.quiltmc.config.api.Serializer;
import org.quiltmc.config.api.serializers.Json5Serializer;
import org.quiltmc.config.api.serializers.TomlSerializer;
import org.slf4j.Logger;

public final class AzusaConfigImpl {
private static ConfigEnvironment ENV;
private static final Path CONFIG_DIR = AzusaConfigExpectPlatform.getConfigDirectory();
private static Logger LOGGER = AzusaConfigMod.LOGGER;
private static final Logger LOGGER = AzusaConfigMod.LOGGER;

private AzusaConfigImpl() {
}

public static void init() {
Map<String, Serializer> serializerMap = new LinkedHashMap<>();

serializerMap.put("toml", new NightConfigSerializer<>("toml", new TomlParser(), new TomlWriter()));
serializerMap.put("json5", JsonFamilySerializer.JSON5);
serializerMap.put("toml", TomlSerializer.INSTANCE);
serializerMap.put("json5", Json5Serializer.INSTANCE);

for (Serializer serializer : AzusaConfigExpectPlatform.getEntrypoints("config_serializer", Serializer.class)) {
Serializer oldValue = serializerMap.put(serializer.getFileExtension(), serializer);
Expand All @@ -51,8 +51,8 @@ public static void init() {
}
}

String globalConfigExtension = System.getProperty("nakanoconfig.loader.globalConfigExtension"/*SystemProperties.GLOBAL_CONFIG_EXTENSION*/);
String defaultConfigExtension = System.getProperty("nakanoconfig.loader.defaultConfigExtension"/*SystemProperties.DEFAULT_CONFIG_EXTENSION*/);
String globalConfigExtension = System.getProperty("azusaconfig.globalConfigExtension");
String defaultConfigExtension = System.getProperty("azusaconfig.defaultConfigExtension");

Serializer[] serializers = serializerMap.values().toArray(new Serializer[0]);

Expand Down Expand Up @@ -82,4 +82,4 @@ public static void init() {
public static ConfigEnvironment getConfigEnvironment() {
return ENV;
}
}
}

This file was deleted.

Loading

0 comments on commit d6341b6

Please sign in to comment.