diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f72df95a7..15de90249 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/java/org/quiltmc/loader/api/config/v2/QuiltConfig.java b/src/main/java/org/quiltmc/loader/api/config/v2/QuiltConfig.java index a1d37373e..9839f0918 100644 --- a/src/main/java/org/quiltmc/loader/api/config/v2/QuiltConfig.java +++ b/src/main/java/org/quiltmc/loader/api/config/v2/QuiltConfig.java @@ -1,7 +1,26 @@ +/* + * Copyright 2023 QuiltMC + * + * 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 org.quiltmc.loader.api.config.v2; import org.quiltmc.config.api.Config; import org.quiltmc.config.api.ReflectiveConfig; +import org.quiltmc.config.api.annotations.ConfigFieldAnnotationProcessor; +import org.quiltmc.config.api.values.ValueList; +import org.quiltmc.config.api.values.ValueMap; import org.quiltmc.config.impl.ConfigImpl; import org.quiltmc.config.implementor_api.ConfigFactory; import org.quiltmc.loader.impl.config.QuiltConfigImpl; @@ -36,23 +55,8 @@ public static Config create(String family, String id, Config.Creator... creators } /** - * Creates and registers a config with fields derived from the fields of the passed class - * - *

The passed class should have the following characteristics: - *

- * - *

Certain annotations can also be used on fields of this class to attach metadata to them. The {@link org.quiltmc.config.api.annotations.Comment} - * annotation is one such annotation that is provided by default, but additional {@link ConfigFieldAnnotationProcessor}s - * can be registered with {@link ConfigFieldAnnotationProcessor#register(Class, ConfigFieldAnnotationProcessor)}. - * + * Creates and registers a config with a class that contains its WrappedValues as fields. + * * @param family the mod owning the resulting config file * @param id the config's id * @param path additional path elements to include as part of this configs file, e.g. @@ -61,29 +65,14 @@ public static Config create(String family, String id, Config.Creator... creators * @param before a {@link Config.Creator} that can be used to configure the resulting config further * @param configCreatorClass a class as described above * @param after a {@link Config.Creator} that can be used to configure the resulting config further - * @return a {@link WrappedConfig } + * @return a {@link ReflectiveConfig } */ public static C create(String family, String id, Path path, Config.Creator before, Class configCreatorClass, Config.Creator after) { return ConfigFactory.create(QuiltConfigImpl.getConfigEnvironment(), family, id, path, before, configCreatorClass, after); } /** - * Creates and registers a config with fields derived from the fields of the passed class - * - *

The passed class should have the following characteristics: - *

- * - *

Certain annotations can also be used on fields of this class to attach metadata to them. The {@link org.quiltmc.config.api.annotations.Comment} - * annotation is one such annotation that is provided by default, but additional {@link ConfigFieldAnnotationProcessor}s - * can be registered with {@link ConfigFieldAnnotationProcessor#register(Class, ConfigFieldAnnotationProcessor)}. + * Creates and registers a config with a class that contains its WrappedValues as fields. * * @param family the mod owning the resulting config file * @param id the config's id @@ -92,29 +81,14 @@ public static C create(String family, String id, Pa * if the path is "client/gui", the config file might be ".minecraft/config/example_mod/client/gui/id.toml" * @param before a {@link Config.Creator} that can be used to configure the resulting config further * @param configCreatorClass a class as described above - * @return a {@link WrappedConfig } + * @return a {@link ReflectiveConfig } */ public static C create(String family, String id, Path path, Config.Creator before, Class configCreatorClass) { return create(family, id, path, before, configCreatorClass, builder -> {}); } /** - * Creates and registers a config with fields derived from the fields of the passed class - * - *

The passed class should have the following characteristics: - *

- * - *

Certain annotations can also be used on fields of this class to attach metadata to them. The {@link org.quiltmc.config.api.annotations.Comment} - * annotation is one such annotation that is provided by default, but additional {@link ConfigFieldAnnotationProcessor}s - * can be registered with {@link ConfigFieldAnnotationProcessor#register(Class, ConfigFieldAnnotationProcessor)}. + * Creates and registers a config with a class that contains its WrappedValues as fields. * * @param family the mod owning the resulting config file * @param id the configs id @@ -123,29 +97,14 @@ public static C create(String family, String id, Pa * if the path is "client/gui", the config file might be ".minecraft/config/example_mod/client/gui/id.toml" * @param configCreatorClass a class as described above * @param after a {@link Config.Creator} that can be used to configure the resulting config further - * @return a {@link WrappedConfig } + * @return a {@link ReflectiveConfig } */ public static C create(String family, String id, Path path, Class configCreatorClass, Config.Creator after) { return create(family, id, path, builder -> {}, configCreatorClass, after); } /** - * Creates and registers a config with fields derived from the fields of the passed class - * - *

The passed class should have the following characteristics: - *

- * - *

Certain annotations can also be used on fields of this class to attach metadata to them. The {@link org.quiltmc.config.api.annotations.Comment} - * annotation is one such annotation that is provided by default, but additional {@link ConfigFieldAnnotationProcessor}s - * can be registered with {@link ConfigFieldAnnotationProcessor#register(Class, ConfigFieldAnnotationProcessor)}. + * Creates and registers a config with a class that contains its WrappedValues as fields. * * @param family the mod owning the resulting config file * @param id the config's id @@ -153,110 +112,59 @@ public static C create(String family, String id, Pa * if the path is empty, the config file might be ".minecraft/config/example_mod/id.toml" * if the path is "client/gui", the config file might be ".minecraft/config/example_mod/client/gui/id.toml" * @param configCreatorClass a class as described above - * @return a {@link WrappedConfig } + * @return a {@link ReflectiveConfig } */ public static C create(String family, String id, Path path, Class configCreatorClass) { return create(family, id, path, builder -> {}, configCreatorClass, builder -> {}); } /** - * Creates and registers a config with fields derived from the fields of the passed class - * - *

The passed class should have the following characteristics: - *

- * - *

Certain annotations can also be used on fields of this class to attach metadata to them. The {@link org.quiltmc.config.api.annotations.Comment} - * annotation is one such annotation that is provided by default, but additional {@link ConfigFieldAnnotationProcessor}s - * can be registered with {@link ConfigFieldAnnotationProcessor#register(Class, ConfigFieldAnnotationProcessor)}. + * Creates and registers a config with a class that contains its WrappedValues as fields. * * @param family the mod owning the resulting config file * @param id the config's id * @param before a {@link Config.Creator} that can be used to configure the resulting config further * @param configCreatorClass a class as described above * @param after a {@link Config.Creator} that can be used to configure the resulting config further - * @return a {@link WrappedConfig } + * @return a {@link ReflectiveConfig } */ public static C create(String family, String id, Config.Creator before, Class configCreatorClass, Config.Creator after) { return create(family, id, Paths.get(""), before, configCreatorClass, after); } /** - * Creates and registers a config with fields derived from the fields of the passed class - * - *

The passed class should have the following characteristics: - *

- * - *

Certain annotations can also be used on fields of this class to attach metadata to them. The {@link org.quiltmc.config.api.annotations.Comment} - * annotation is one such annotation that is provided by default, but additional {@link ConfigFieldAnnotationProcessor}s - * can be registered with {@link ConfigFieldAnnotationProcessor#register(Class, ConfigFieldAnnotationProcessor)}. + * Creates and registers a config with a class that contains its WrappedValues as fields. * * @param family the mod owning the resulting config file * @param id the config's id * @param before a {@link Config.Creator} that can be used to configure the resulting config further * @param configCreatorClass a class as described above - * @return a {@link WrappedConfig } + * @return a {@link ReflectiveConfig } */ public static C create(String family, String id, Config.Creator before, Class configCreatorClass) { return create(family, id, Paths.get(""), before, configCreatorClass, builder -> {}); } /** - * Creates and registers a config with fields derived from the fields of the passed class - * - *

The passed class should have the following characteristics: - *

- * - *

Certain annotations can also be used on fields of this class to attach metadata to them. The {@link org.quiltmc.config.api.annotations.Comment} - * annotation is one such annotation that is provided by default, but additional {@link ConfigFieldAnnotationProcessor}s - * can be registered with {@link ConfigFieldAnnotationProcessor#register(Class, ConfigFieldAnnotationProcessor)}. + * Creates and registers a config with a class that contains its WrappedValues as fields. * * @param family the mod owning the resulting config file * @param id the config's id * @param configCreatorClass a class as described above * @param after a {@link Config.Creator} that can be used to configure the resulting config further - * @return a {@link WrappedConfig } + * @return a {@link ReflectiveConfig } */ public static C create(String family, String id, Class configCreatorClass, Config.Creator after) { return create(family, id, Paths.get(""), builder -> {}, configCreatorClass, after); } /** - * Creates and registers a config with fields derived from the fields of the passed class - * - *

The passed class should have the following characteristics: - *

- * + * Creates and registers a config with a class that contains its WrappedValues as fields. + * * @param family the mod owning the resulting config file * @param id the config's id * @param configCreatorClass a class as described above - * @return a {@link WrappedConfig } + * @return a {@link ReflectiveConfig } */ public static C create(String family, String id, Class configCreatorClass) { return create(family, id, Paths.get(""), builder -> {}, configCreatorClass, builder -> {});