Lortseam 4 rokov pred
rodič
commit
5500221e04

+ 10 - 7
src/main/java/me/lortseam/completeconfig/api/ConfigEntry.java

@@ -44,18 +44,18 @@ public @interface ConfigEntry {
     String translationKey() default "";
 
     /**
-     * Specifies one or more custom translation keys for this entry's tooltip. If empty, the default single-line or
-     * multi-line keys will be used, depending on which are declared in the language file(s).
+     * Specifies one or more custom translation keys for this entry's tooltip, declared line by line. If empty, the
+     * default single-line or multi-line keys will be used, depending on which are defined in the language file(s).
      *
      * @return an array of custom tooltip translation keys
      */
     String[] tooltipTranslationKeys() default {};
 
     /**
-     * Specifies if the entry's field should get updated while at least one listener exists in the entry's class.
+     * Specifies if the entry's field should get updated while at least one listener exists in the field's class.
      *
-     * <p>By default the entry's field will not get modified when the config is saved, but all listeners will be called
-     * with the updated value. Set this to true to always update the field when saving.
+     * <p>In that case, by default, the entry's field will not get modified when the config is saved, but all listeners
+     * will be called. Set this to true to always update the field when saving.
      *
      * @return true if the field should always get updated, else false
      */
@@ -191,7 +191,7 @@ public @interface ConfigEntry {
         /**
          * Specifies how the entry should be rendered.
          *
-         * @return the desired {@link EnumEntry.DisplayType}
+         * @return the desired {@link me.lortseam.completeconfig.data.EnumEntry.DisplayType}
          */
         EnumEntry.DisplayType displayType() default EnumEntry.DisplayType.BUTTON;
 
@@ -199,6 +199,9 @@ public @interface ConfigEntry {
 
     /**
      * Specifies that the annotated field is a color entry.
+     *
+     * <p>This annotation is optional for known color types, such as {@link net.minecraft.text.TextColor}, but is
+     * required for unknown types.
      */
     @Target(ElementType.FIELD)
     @Retention(RetentionPolicy.RUNTIME)
@@ -217,7 +220,7 @@ public @interface ConfigEntry {
 
     /**
      * Can be applied to a field inside a POJO {@link ConfigEntryContainer} class to declare that that field should not
-     * be considered to be config entry.
+     * be considered to be a config entry.
      */
     @Target(ElementType.FIELD)
     @Retention(RetentionPolicy.RUNTIME)

+ 4 - 1
src/main/java/me/lortseam/completeconfig/api/ConfigEntryContainer.java

@@ -38,7 +38,7 @@ public interface ConfigEntryContainer {
     }
 
     /**
-     * Used to register other containers. They will then be located at the same level as this container.
+     * Used to register other containers. They will then be registered at the same level as this container.
      *
      * @return an array of other containers
      * @see Transitive
@@ -51,6 +51,9 @@ public interface ConfigEntryContainer {
      * Applied to declare that a field of type {@link ConfigEntryContainer} is transitive. The container will then be
      * registered at the same level as this container.
      *
+     * <p>This annotation is only required inside non-POJO classes. POJO classes will always register every field of
+     * type {@link ConfigEntryContainer}.
+     *
      * @see #getTransitiveContainers()
      */
     @Target(ElementType.FIELD)

+ 4 - 4
src/main/java/me/lortseam/completeconfig/api/ConfigEntryListener.java

@@ -6,10 +6,10 @@ import java.lang.annotation.RetentionPolicy;
 import java.lang.annotation.Target;
 
 /**
- * Applied to declare that a method is a listener for a config entry.
+ * Applied to declare that a method listens to a config entry's value updates.
  *
- * <p>A listener method gets called every time the config is saved. It requires a parameter of the same type as the
- * entry's field. This parameter contains the updated value which then can be used to modify the field itself.
+ * <p>The annotated method requires a parameter of the same type as the entry's field. This parameter contains the
+ * updated value which then can be used to modify the field itself.
  */
 @Target(ElementType.METHOD)
 @Retention(RetentionPolicy.RUNTIME)
@@ -26,7 +26,7 @@ public @interface ConfigEntryListener {
      * Specifies the class in which the entry's field is declared in. Only required if the listener is not declared
      * in the same class.
      *
-     * @return the entry's class
+     * @return the entry's parent class
      */
     Class<? extends ConfigEntryContainer> container() default ConfigEntryContainer.class;
 

+ 1 - 3
src/main/java/me/lortseam/completeconfig/api/ConfigGroup.java

@@ -3,15 +3,13 @@ package me.lortseam.completeconfig.api;
 import com.google.common.base.CaseFormat;
 
 /**
- * A group of config entries. Every group has a unique identifier inside its parent node.
+ * A group of config entries. Inside its parent node, every group is uniquely defined by an identifier.
  */
 public interface ConfigGroup extends ConfigEntryContainer {
 
     /**
      * Used to identify this group. Defaults to the class name.
      *
-     * <p>Override this method to set a custom ID.
-     *
      * @return the ID of this group
      */
     default String getGroupID() {

+ 3 - 2
src/main/java/me/lortseam/completeconfig/data/Config.java

@@ -70,7 +70,8 @@ public class Config extends CollectionMap {
         }
 
         /**
-         * Sets the branch.
+         * Sets the branch. Every config of a mod needs a unique branch, therefore setting a branch is only required
+         * when using more than one config.
          *
          * <p>The branch determines the location of the config's save file.
          *
@@ -95,7 +96,7 @@ public class Config extends CollectionMap {
         }
 
         /**
-         * Sets a custom client GUI builder for the config.
+         * Sets a custom client GUI builder.
          *
          * @param guiBuilder a GUI builder
          * @return this builder