From d6341b61b0632abd85d522a1d74778cb3bc02e9a Mon Sep 17 00:00:00 2001 From: TexTrue <3140846162@qq.com> Date: Sat, 1 Jun 2024 12:07:54 +0800 Subject: [PATCH] sync `1.20.4/dev` --- README.md | 14 +- build.gradle | 2 +- common/build.gradle | 6 +- .../impl/config/AzusaConfigImpl.java | 16 +- .../impl/config/JsonFamilySerializer.java | 255 ------------------ .../impl/config/NightConfigSerializer.java | 165 ------------ fabric/build.gradle | 10 +- .../fabric/AzusaConfigModFabric.java | 4 +- forge/build.gradle | 6 +- .../forge/AzusaConfigExpectPlatformImpl.java | 2 +- .../forge/AzusaConfigModForge.java | 5 +- .../api}/EntrypointContainer.java | 2 +- .../api}/EntrypointLoadingException.java | 2 +- .../impl}/EntrypointStorage.java | 6 +- gradle.properties | 5 +- settings.gradle | 1 - 16 files changed, 34 insertions(+), 467 deletions(-) delete mode 100644 common/src/main/java/ho/artisan/azusaconfig/impl/config/JsonFamilySerializer.java delete mode 100644 common/src/main/java/ho/artisan/azusaconfig/impl/config/NightConfigSerializer.java rename forge/src/main/java/ho/artisan/azusaconfig/forge/{api/entrypoint => entrypoint/api}/EntrypointContainer.java (96%) rename forge/src/main/java/ho/artisan/azusaconfig/forge/{api/entrypoint => entrypoint/api}/EntrypointLoadingException.java (96%) rename forge/src/main/java/ho/artisan/azusaconfig/forge/{impl/entrypoint => entrypoint/impl}/EntrypointStorage.java (95%) diff --git a/README.md b/README.md index 528d449..1649b7b 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ AzusaConfig Icon -# AzusaConfig +# AzusaConfig for 1.20.1 ###### A library to bring the Quilt Loader's Config system into Fabric/Forge/NeoForge. @@ -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. diff --git a/build.gradle b/build.gradle index 6d416b7..62302af 100644 --- a/build.gradle +++ b/build.gradle @@ -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 } diff --git a/common/build.gradle b/common/build.gradle index 4268db4..16f3e2a 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -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 { diff --git a/common/src/main/java/ho/artisan/azusaconfig/impl/config/AzusaConfigImpl.java b/common/src/main/java/ho/artisan/azusaconfig/impl/config/AzusaConfigImpl.java index 8d1318a..7c634fb 100644 --- a/common/src/main/java/ho/artisan/azusaconfig/impl/config/AzusaConfigImpl.java +++ b/common/src/main/java/ho/artisan/azusaconfig/impl/config/AzusaConfigImpl.java @@ -21,18 +21,18 @@ 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() { } @@ -40,8 +40,8 @@ private AzusaConfigImpl() { public static void init() { Map 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); @@ -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]); @@ -82,4 +82,4 @@ public static void init() { public static ConfigEnvironment getConfigEnvironment() { return ENV; } -} +} \ No newline at end of file diff --git a/common/src/main/java/ho/artisan/azusaconfig/impl/config/JsonFamilySerializer.java b/common/src/main/java/ho/artisan/azusaconfig/impl/config/JsonFamilySerializer.java deleted file mode 100644 index fd5bd90..0000000 --- a/common/src/main/java/ho/artisan/azusaconfig/impl/config/JsonFamilySerializer.java +++ /dev/null @@ -1,255 +0,0 @@ -/* - * Copyright 2022, 2023 QuiltMC - * Copyright 2024 HO-Artisan - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ho.artisan.azusaconfig.impl.config; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.quiltmc.config.api.Config; -import org.quiltmc.config.api.Constraint; -import org.quiltmc.config.api.MarshallingUtils; -import org.quiltmc.config.api.Serializer; -import org.quiltmc.config.api.annotations.Comment; -import org.quiltmc.config.api.exceptions.ConfigParseException; -import org.quiltmc.config.api.values.CompoundConfigValue; -import org.quiltmc.config.api.values.ConfigSerializableObject; -import org.quiltmc.config.api.values.TrackedValue; -import org.quiltmc.config.api.values.ValueList; -import org.quiltmc.config.api.values.ValueMap; -import org.quiltmc.config.api.values.ValueTreeNode; -import org.quiltmc.config.impl.tree.TrackedValueImpl; -import org.quiltmc.parsers.json.JsonFormat; -import org.quiltmc.parsers.json.JsonReader; -import org.quiltmc.parsers.json.JsonToken; -import org.quiltmc.parsers.json.JsonWriter; - -final class JsonFamilySerializer implements Serializer { - static final JsonFamilySerializer JSON5 = new JsonFamilySerializer(JsonFormat.JSON5, "json5"); - // could also add jsonc and/or json here - // but what would the extension for JSONC be? .json or .jsonc? - private final JsonFormat format; - private final String extension; - - private JsonFamilySerializer(JsonFormat format, String extension) { - this.format = format; - this.extension = extension; - } - - @Override - public String getFileExtension() { - return extension; - } - - private void serialize(JsonWriter writer, Object value) throws IOException { - if (value instanceof Integer) { - writer.value((Integer) value); - } else if (value instanceof Long) { - writer.value((Long) value); - } else if (value instanceof Float) { - writer.value((Float) value); - } else if (value instanceof Double) { - writer.value((Double) value); - } else if (value instanceof Boolean) { - writer.value((Boolean) value); - } else if (value instanceof String) { - writer.value((String) value); - } else if (value instanceof ValueList) { - writer.beginArray(); - - for (Object v : (ValueList) value) { - serialize(writer, v); - } - - writer.endArray(); - } else if (value instanceof ValueMap) { - writer.beginObject(); - - for (Map.Entry entry : (ValueMap) value) { - writer.name(entry.getKey()); - serialize(writer, entry.getValue()); - } - - writer.endObject(); - } else if (value instanceof ConfigSerializableObject) { - serialize(writer, ((ConfigSerializableObject) value).getRepresentation()); - } else if (value == null) { - writer.nullValue(); - } else if (value.getClass().isEnum()) { - writer.value(((Enum) value).name()); - } else { - throw new ConfigParseException(); - } - } - - private void serialize(JsonWriter writer, ValueTreeNode node) throws IOException { - for (String comment : node.metadata(Comment.TYPE)) { - writer.comment(comment); - } - - if (node instanceof ValueTreeNode.Section) { - writer.name(node.key().getLastComponent()); - writer.beginObject(); - - for (ValueTreeNode child : ((ValueTreeNode.Section) node)) { - serialize(writer, child); - } - - writer.endObject(); - } else { - TrackedValue trackedValue = ((TrackedValue) node); - Object defaultValue = trackedValue.getDefaultValue(); - - if (defaultValue.getClass().isEnum()) { - StringBuilder options = new StringBuilder("options: "); - Object[] enumConstants = defaultValue.getClass().getEnumConstants(); - - for (int i = 0, enumConstantsLength = enumConstants.length; i < enumConstantsLength; i++) { - Object o = enumConstants[i]; - - options.append(o); - - if (i < enumConstantsLength - 1) { - options.append(", "); - } - } - - writer.comment(options.toString()); - } - - for (Constraint constraint : trackedValue.constraints()) { - writer.comment(constraint.getRepresentation()); - } - - if (!(defaultValue instanceof CompoundConfigValue)) { - writer.comment("default: " + defaultValue); - } - - writer.name(node.key().getLastComponent()); - - serialize(writer, trackedValue.getRealValue()); - } - } - - @Override - public void serialize(Config config, OutputStream to) throws IOException { - JsonWriter writer = JsonWriter.create(new OutputStreamWriter(to), format); - - for (String comment : config.metadata(Comment.TYPE)) { - writer.comment(comment); - } - - writer.beginObject(); - - for (ValueTreeNode node : config.nodes()) { - this.serialize(writer, node); - } - - writer.endObject(); - writer.close(); - } - - @Override - @SuppressWarnings({"unchecked", "rawtypes"}) - public void deserialize(Config config, InputStream from) { - try { - JsonReader reader = JsonReader.create(new InputStreamReader(from), format); - - Map values = parseObject(reader); - - for (TrackedValue value : config.values()) { - Map m = values; - - for (int i = 0; i < value.key().length(); ++i) { - String k = value.key().getKeyComponent(i); - - if (m.containsKey(k) && i != value.key().length() - 1) { - m = (Map) m.get(k); - } else if (m.containsKey(k)) { - ((TrackedValueImpl) value).setValue(MarshallingUtils.coerce(m.get(k), value.getDefaultValue(), (Map map, MarshallingUtils.MapEntryConsumer entryConsumer) -> - map.forEach(entryConsumer::put)), false); - } - } - } - } catch (Exception e) { - e.printStackTrace(); - } - } - - private static Map parseObject(JsonReader reader) throws IOException { - reader.beginObject(); - - Map object = new LinkedHashMap<>(); - - while (reader.hasNext() && reader.peek() == JsonToken.NAME) { - object.put(reader.nextName(), parseElement(reader)); - } - - reader.endObject(); - - return object; - } - - public static List parseArray(JsonReader reader) throws IOException { - reader.beginArray(); - - List array = new ArrayList<>(); - - while (reader.hasNext() && reader.peek() != JsonToken.END_ARRAY) { - array.add(parseElement(reader)); - } - - reader.endArray(); - - return array; - } - - private static Object parseElement(JsonReader reader) throws IOException { - switch (reader.peek()) { - case END_ARRAY: - throw new ConfigParseException("Unexpected end of array"); - case BEGIN_OBJECT: - return parseObject(reader); - case BEGIN_ARRAY: - return parseArray(reader); - case END_OBJECT: - throw new ConfigParseException("Unexpected end of object"); - case NAME: - throw new ConfigParseException("Unexpected name"); - case STRING: - return reader.nextString(); - case NUMBER: - return reader.nextNumber(); - case BOOLEAN: - return reader.nextBoolean(); - case NULL: - reader.nextNull(); - return null; - case END_DOCUMENT: - throw new ConfigParseException("Unexpected end of file"); - } - - throw new ConfigParseException("Encountered unknown JSON token"); - } -} diff --git a/common/src/main/java/ho/artisan/azusaconfig/impl/config/NightConfigSerializer.java b/common/src/main/java/ho/artisan/azusaconfig/impl/config/NightConfigSerializer.java deleted file mode 100644 index d047db3..0000000 --- a/common/src/main/java/ho/artisan/azusaconfig/impl/config/NightConfigSerializer.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright 2022, 2023 QuiltMC - * Copyright 2024 HO-Artisan - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package ho.artisan.azusaconfig.impl.config; - -import java.io.InputStream; -import java.io.OutputStream; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import com.electronwill.nightconfig.core.CommentedConfig; -import com.electronwill.nightconfig.core.InMemoryCommentedFormat; -import com.electronwill.nightconfig.core.UnmodifiableCommentedConfig; -import com.electronwill.nightconfig.core.io.ConfigParser; -import com.electronwill.nightconfig.core.io.ConfigWriter; -import org.quiltmc.config.api.Config; -import org.quiltmc.config.api.Constraint; -import org.quiltmc.config.api.MarshallingUtils; -import org.quiltmc.config.api.Serializer; -import org.quiltmc.config.api.annotations.Comment; -import org.quiltmc.config.api.values.CompoundConfigValue; -import org.quiltmc.config.api.values.ConfigSerializableObject; -import org.quiltmc.config.api.values.TrackedValue; -import org.quiltmc.config.api.values.ValueList; -import org.quiltmc.config.api.values.ValueMap; -import org.quiltmc.config.api.values.ValueTreeNode; - -public final class NightConfigSerializer implements Serializer { - private final String fileExtension; - private final ConfigParser parser; - private final ConfigWriter writer; - - public NightConfigSerializer(String fileExtension, ConfigParser parser, ConfigWriter writer) { - this.fileExtension = fileExtension; - this.parser = parser; - this.writer = writer; - } - - @Override - public String getFileExtension() { - return this.fileExtension; - } - - @Override - public void serialize(Config config, OutputStream to) { - this.writer.write(write(createCommentedConfig(), config.nodes()), to); - } - - @SuppressWarnings({"unchecked", "rawtypes"}) - @Override - public void deserialize(Config config, InputStream from) { - CommentedConfig read = this.parser.parse(from); - - for (TrackedValue trackedValue : config.values()) { - if (read.contains(trackedValue.key().toString())) { - ((TrackedValue) trackedValue).setValue(MarshallingUtils.coerce(read.get(trackedValue.key().toString()), trackedValue.getDefaultValue(), (CommentedConfig c, MarshallingUtils.MapEntryConsumer entryConsumer) -> - c.entrySet().forEach(e -> entryConsumer.put(e.getKey(), e.getValue()))), false); - } - } - } - - private static List convertList(List list) { - List result = new ArrayList<>(list.size()); - - for (Object value : list) { - result.add(convertAny(value)); - } - - return result; - } - - private static UnmodifiableCommentedConfig convertMap(ValueMap map) { - CommentedConfig result = createCommentedConfig(); - - for (Map.Entry entry : map.entrySet()) { - result.add(entry.getKey(), convertAny(entry.getValue())); - } - - return result; - } - - private static Object convertAny(Object value) { - if (value instanceof ValueMap) { - return convertMap((ValueMap) value); - } else if (value instanceof ValueList) { - return convertList((ValueList) value); - } else if (value instanceof ConfigSerializableObject) { - return convertAny(((ConfigSerializableObject) value).getRepresentation()); - } else { - return value; - } - } - - private static CommentedConfig write(CommentedConfig config, Iterable nodes) { - for (ValueTreeNode node : nodes) { - List comments = new ArrayList<>(); - - if (node.hasMetadata(Comment.TYPE)) { - for (String string : node.metadata(Comment.TYPE)) { - comments.add(string); - } - } - - if (node instanceof TrackedValue) { - TrackedValue trackedValue = (TrackedValue) node; - Object defaultValue = trackedValue.getDefaultValue(); - - if (defaultValue.getClass().isEnum()) { - StringBuilder options = new StringBuilder("options: "); - Object[] enumConstants = defaultValue.getClass().getEnumConstants(); - - for (int i = 0, enumConstantsLength = enumConstants.length; i < enumConstantsLength; i++) { - Object o = enumConstants[i]; - - options.append(o); - - if (i < enumConstantsLength - 1) { - options.append(", "); - } - } - - comments.add(options.toString()); - } - - for (Constraint constraint : trackedValue.constraints()) { - comments.add(constraint.getRepresentation()); - } - - if (!(defaultValue instanceof CompoundConfigValue)) { - comments.add("default: " + defaultValue); - } - - config.add(trackedValue.key().toString(), convertAny(trackedValue.getRealValue())); - } else { - write(config, ((ValueTreeNode.Section) node)); - } - - if (!comments.isEmpty()) { - config.setComment(node.key().toString(), " " + String.join("\n ", comments)); - } - } - - return config; - } - - private static CommentedConfig createCommentedConfig() { - return InMemoryCommentedFormat.defaultInstance().createConfig(LinkedHashMap::new); - } -} diff --git a/fabric/build.gradle b/fabric/build.gradle index 6a6ca55..8f26f00 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -20,10 +20,10 @@ configurations { dependencies { modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}" - include "org.quiltmc:quilt-config:${rootProject.quiltconfig_version}" - include "org.quiltmc.parsers:json:${rootProject.quiltparsers_version}" - shadowCommon "com.electronwill.night-config:core:${rootProject.nightconfig_version}" - shadowCommon "com.electronwill.night-config:toml:${rootProject.nightconfig_version}" + implementation(shadowCommon("org.quiltmc:quilt-config:${rootProject.quiltconfig_version}")) + implementation(shadowCommon("org.quiltmc.parsers:json:${rootProject.quiltparsers_version}")) + implementation(shadowCommon("org.quiltmc.quilt-config.serializers:toml:${rootProject.quiltconfig_version}")) + implementation(shadowCommon("org.quiltmc.quilt-config.serializers:json5:${rootProject.quiltconfig_version}")) common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false } @@ -40,8 +40,6 @@ processResources { shadowJar { exclude "architectury.common.json" - relocate "com.electronwill.nightconfig", "${rootProject.maven_group}.shadow.nightconfig" - configurations = [project.configurations.shadowCommon] archiveClassifier.set("dev-shadow") } diff --git a/fabric/src/main/java/ho/artisan/azusaconfig/fabric/AzusaConfigModFabric.java b/fabric/src/main/java/ho/artisan/azusaconfig/fabric/AzusaConfigModFabric.java index 998561f..05378a8 100644 --- a/fabric/src/main/java/ho/artisan/azusaconfig/fabric/AzusaConfigModFabric.java +++ b/fabric/src/main/java/ho/artisan/azusaconfig/fabric/AzusaConfigModFabric.java @@ -1,11 +1,11 @@ package ho.artisan.azusaconfig.fabric; -import ho.artisan.azusaconfig.AzusaConfigMod; +import ho.artisan.azusaconfig.impl.config.AzusaConfigImpl; import net.fabricmc.api.ModInitializer; public class AzusaConfigModFabric implements ModInitializer { @Override public void onInitialize() { - AzusaConfigMod.init(); + AzusaConfigImpl.init(); } } diff --git a/forge/build.gradle b/forge/build.gradle index 54fc6b0..0450d05 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -20,8 +20,10 @@ configurations { dependencies { forge "net.minecraftforge:forge:${rootProject.forge_version}" - include "org.quiltmc:quilt-config:${rootProject.quiltconfig_version}" - include "org.quiltmc.parsers:json:${rootProject.quiltparsers_version}" + implementation(shadowCommon("org.quiltmc:quilt-config:${rootProject.quiltconfig_version}")) + implementation(shadowCommon("org.quiltmc.parsers:json:${rootProject.quiltparsers_version}")) + implementation(shadowCommon("org.quiltmc.quilt-config.serializers:toml:${rootProject.quiltconfig_version}")) + implementation(shadowCommon("org.quiltmc.quilt-config.serializers:json5:${rootProject.quiltconfig_version}")) common(project(path: ":common", configuration: "namedElements")) { transitive false } shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive = false } diff --git a/forge/src/main/java/ho/artisan/azusaconfig/forge/AzusaConfigExpectPlatformImpl.java b/forge/src/main/java/ho/artisan/azusaconfig/forge/AzusaConfigExpectPlatformImpl.java index f72b799..7faf187 100644 --- a/forge/src/main/java/ho/artisan/azusaconfig/forge/AzusaConfigExpectPlatformImpl.java +++ b/forge/src/main/java/ho/artisan/azusaconfig/forge/AzusaConfigExpectPlatformImpl.java @@ -1,6 +1,6 @@ package ho.artisan.azusaconfig.forge; -import ho.artisan.azusaconfig.forge.impl.entrypoint.EntrypointStorage; +import ho.artisan.azusaconfig.forge.entrypoint.impl.EntrypointStorage; import net.minecraftforge.fml.loading.FMLPaths; diff --git a/forge/src/main/java/ho/artisan/azusaconfig/forge/AzusaConfigModForge.java b/forge/src/main/java/ho/artisan/azusaconfig/forge/AzusaConfigModForge.java index dc32b9d..2540afb 100644 --- a/forge/src/main/java/ho/artisan/azusaconfig/forge/AzusaConfigModForge.java +++ b/forge/src/main/java/ho/artisan/azusaconfig/forge/AzusaConfigModForge.java @@ -1,7 +1,8 @@ package ho.artisan.azusaconfig.forge; import ho.artisan.azusaconfig.AzusaConfigMod; -import ho.artisan.azusaconfig.forge.impl.entrypoint.EntrypointStorage; +import ho.artisan.azusaconfig.forge.entrypoint.impl.EntrypointStorage; +import ho.artisan.azusaconfig.impl.config.AzusaConfigImpl; import net.minecraftforge.fml.IExtensionPoint; import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.common.Mod; @@ -12,6 +13,6 @@ public class AzusaConfigModForge { public AzusaConfigModForge() { ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (a, b) -> true)); EntrypointStorage.loadAll(); - AzusaConfigMod.init(); + AzusaConfigImpl.init(); } } diff --git a/forge/src/main/java/ho/artisan/azusaconfig/forge/api/entrypoint/EntrypointContainer.java b/forge/src/main/java/ho/artisan/azusaconfig/forge/entrypoint/api/EntrypointContainer.java similarity index 96% rename from forge/src/main/java/ho/artisan/azusaconfig/forge/api/entrypoint/EntrypointContainer.java rename to forge/src/main/java/ho/artisan/azusaconfig/forge/entrypoint/api/EntrypointContainer.java index 06db4a2..ac1ad04 100644 --- a/forge/src/main/java/ho/artisan/azusaconfig/forge/api/entrypoint/EntrypointContainer.java +++ b/forge/src/main/java/ho/artisan/azusaconfig/forge/entrypoint/api/EntrypointContainer.java @@ -21,7 +21,7 @@ * OR OTHER DEALINGS IN THE SOFTWARE. */ -package ho.artisan.azusaconfig.forge.api.entrypoint; +package ho.artisan.azusaconfig.forge.entrypoint.api; import net.minecraftforge.forgespi.locating.IModFile; diff --git a/forge/src/main/java/ho/artisan/azusaconfig/forge/api/entrypoint/EntrypointLoadingException.java b/forge/src/main/java/ho/artisan/azusaconfig/forge/entrypoint/api/EntrypointLoadingException.java similarity index 96% rename from forge/src/main/java/ho/artisan/azusaconfig/forge/api/entrypoint/EntrypointLoadingException.java rename to forge/src/main/java/ho/artisan/azusaconfig/forge/entrypoint/api/EntrypointLoadingException.java index 5c6f8ee..41070cc 100644 --- a/forge/src/main/java/ho/artisan/azusaconfig/forge/api/entrypoint/EntrypointLoadingException.java +++ b/forge/src/main/java/ho/artisan/azusaconfig/forge/entrypoint/api/EntrypointLoadingException.java @@ -21,7 +21,7 @@ * OR OTHER DEALINGS IN THE SOFTWARE. */ -package ho.artisan.azusaconfig.forge.api.entrypoint; +package ho.artisan.azusaconfig.forge.entrypoint.api; public class EntrypointLoadingException extends RuntimeException { public EntrypointLoadingException() { diff --git a/forge/src/main/java/ho/artisan/azusaconfig/forge/impl/entrypoint/EntrypointStorage.java b/forge/src/main/java/ho/artisan/azusaconfig/forge/entrypoint/impl/EntrypointStorage.java similarity index 95% rename from forge/src/main/java/ho/artisan/azusaconfig/forge/impl/entrypoint/EntrypointStorage.java rename to forge/src/main/java/ho/artisan/azusaconfig/forge/entrypoint/impl/EntrypointStorage.java index e2ec8e7..b24828b 100644 --- a/forge/src/main/java/ho/artisan/azusaconfig/forge/impl/entrypoint/EntrypointStorage.java +++ b/forge/src/main/java/ho/artisan/azusaconfig/forge/entrypoint/impl/EntrypointStorage.java @@ -21,10 +21,10 @@ * OR OTHER DEALINGS IN THE SOFTWARE. */ -package ho.artisan.azusaconfig.forge.impl.entrypoint; +package ho.artisan.azusaconfig.forge.entrypoint.impl; -import ho.artisan.azusaconfig.forge.api.entrypoint.EntrypointContainer; -import ho.artisan.azusaconfig.forge.api.entrypoint.EntrypointLoadingException; +import ho.artisan.azusaconfig.forge.entrypoint.api.EntrypointContainer; +import ho.artisan.azusaconfig.forge.entrypoint.api.EntrypointLoadingException; import net.minecraftforge.fml.ModList; import net.minecraftforge.forgespi.language.IConfigurable; diff --git a/gradle.properties b/gradle.properties index af3f9f9..6fddb2a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,11 +10,10 @@ maven_group=ho.artisan.azusaconfig fabric_loader_version=0.15.2 -forge_version=1.20.1-47.2.20 +forge_version=1.20.1-47.2.32 curseforge_id=970148 modrinth_id=12LahGY4 -quiltconfig_version=1.2.0 +quiltconfig_version=1.3.1 quiltparsers_version=0.2.0 -nightconfig_version=3.6.6 diff --git a/settings.gradle b/settings.gradle index daa2ae3..c4875ff 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,7 +2,6 @@ pluginManagement { repositories { maven { url "https://maven.fabricmc.net/" } maven { url "https://maven.architectury.dev/" } - maven { url "https://maven.neoforged.net/releases/" } maven { url "https://maven.minecraftforge.net/" } maven { url "https://maven.firstdark.dev/releases" } gradlePluginPortal()