Ver código fonte

Added some javadoc

Lortseam 4 anos atrás
pai
commit
edbce7c557

+ 10 - 0
src/main/java/me/lortseam/completeconfig/CompleteConfig.java

@@ -11,6 +11,11 @@ public final class CompleteConfig {
 
     private static final HashMap<String, ConfigManager> MANAGERS = new HashMap<>();
 
+    /**
+     * Registers a mod
+     * @param modID The ID of the mod
+     * @return The {@link ConfigManager} for the registered mod
+     */
     public static ConfigManager register(String modID) {
         if (MANAGERS.containsKey(modID)) {
             throw new IllegalArgumentException("A manager with this mod ID is already registered");
@@ -20,6 +25,11 @@ public final class CompleteConfig {
         return manager;
     }
 
+    /**
+     * Gets the {@link ConfigManager} for the specified mod if that mod was registered before
+     * @param modID The ID of the mod
+     * @return The {@link ConfigManager} if one was found or else an empty result
+     */
     public static Optional<ConfigManager> getManager(String modID) {
         return Optional.ofNullable(MANAGERS.get(modID));
     }

+ 9 - 0
src/main/java/me/lortseam/completeconfig/ConfigManager.java

@@ -52,6 +52,10 @@ public final class ConfigManager {
         return JsonNull.INSTANCE;
     }
 
+    /**
+     * Registers one or more top level categories.
+     * @param categories The categories to register
+     */
     public void register(ConfigCategory... categories) {
         for (ConfigCategory category : categories) {
             config.registerTopLevelCategory(category);
@@ -74,6 +78,11 @@ public final class ConfigManager {
         setCustomGuiSupplier(guiBuilder);
     }
 
+    /**
+     * Generates the configuration GUI.
+     * @param parentScreen The parent screen
+     * @return The generated configuration screen
+     */
     public Screen buildScreen(Screen parentScreen) {
         return guiBuilder.buildScreen(parentScreen, this::save);
     }