{@link #loadJson(ResourceLocation, ResourceManager)} - Loads a JSON resource.
*
* @author MeAlam
- * @co-author Dan
+
* @since 1.0.0
*/
public class JSONLoader {
@@ -48,7 +48,7 @@
* @return The value of the custom parameter identified by {@code pParameterKey}
* for the variant specified by {@code pVariantName}.
* @author MeAlam
- * @co-author Dan
+
* @since 1.0.0
*/
public String getCustomParameter(String pVariantName, String pParameterKey) {
@@ -67,7 +67,7 @@
* @return The value of the custom parameter identified by {@code pParameterKey}
* for the variant specified by {@code pVariantName}.
* @author MeAlam
- * @co-author Dan
+
* @since 1.0.0
*/
public String getCustomParameter(String pVariantName, String pParameterKey) {
@@ -101,7 +101,7 @@
* TODO: Testing with Multiple Entities and Datapacks required before Deletion/Refactoring.
* @return A map containing the parameters added to this builder.
* @author MeAlam
- * @co-author Dan
+
* @since 1.0.0
* @see #newMethod()
*/
diff --git a/Forge/src/main/java/software/bluelib/BlueLib.java b/Forge/src/main/java/software/bluelib/BlueLib.java
index 87d8aef9..c58de55b 100644
--- a/Forge/src/main/java/software/bluelib/BlueLib.java
+++ b/Forge/src/main/java/software/bluelib/BlueLib.java
@@ -7,13 +7,6 @@
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLLoadCompleteEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
-import net.minecraftforge.fml.loading.FMLEnvironment;
-import software.bluelib.utils.logging.BaseLogLevel;
-import software.bluelib.utils.logging.BaseLogger;
-
-import java.util.concurrent.TimeUnit;
-
-import static software.bluelib.BlueLibConstants.SCHEDULER;
/**
* The main class of the {@link BlueLib} mod.
@@ -30,9 +23,8 @@
*
*
*
+ * @author MeAlam, Dan and All Contributors of BlueLib!
* @see BlueLib Wiki
- * @author MeAlam, Dan
- * @co-author All Contributors of BlueLib!
* @since 1.0.0
*/
@Mod(BlueLibConstants.MOD_ID)
@@ -42,7 +34,6 @@ public class BlueLib {
* Constructs a new {@link BlueLib} instance and registers the mod event bus.
*
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
public BlueLib() {
@@ -55,7 +46,6 @@ public BlueLib() {
*
* @param pEvent {@link FMLLoadCompleteEvent} - The event fired after the mod loading process completes.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
@SubscribeEvent
diff --git a/NeoForge/src/main/java/software/bluelib/BlueLib.java b/NeoForge/src/main/java/software/bluelib/BlueLib.java
index 03f8ba47..ad53369f 100644
--- a/NeoForge/src/main/java/software/bluelib/BlueLib.java
+++ b/NeoForge/src/main/java/software/bluelib/BlueLib.java
@@ -7,14 +7,7 @@
import net.neoforged.fml.ModContainer;
import net.neoforged.fml.common.Mod;
import net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent;
-import net.neoforged.fml.loading.FMLEnvironment;
import org.spongepowered.asm.launch.MixinBootstrap;
-import software.bluelib.utils.logging.BaseLogLevel;
-import software.bluelib.utils.logging.BaseLogger;
-
-import java.util.concurrent.TimeUnit;
-
-import static software.bluelib.BlueLibConstants.SCHEDULER;
/**
* The main class of the {@code BlueLib} mod.
@@ -30,9 +23,8 @@
*
*
*
+ * @author MeAlam, Dan and All Contributors of BlueLib!
* @see BlueLib Wiki
- * @author MeAlam, Dan
- * @co-author All Contributors of BlueLib!
* @since 1.0.0
*/
@Mod(BlueLibConstants.MOD_ID)
@@ -44,10 +36,9 @@ public class BlueLib {
* Registers necessary mod event listeners, and if in developer mode, additional client-side listeners for rendering and attributes.
*
*
- * @param pModEventBus {@link IEventBus} - The event bus where the mod registers its handlers.
+ * @param pModEventBus {@link IEventBus} - The event bus where the mod registers its handlers.
* @param pModContainer {@link ModContainer} - The mod container that holds the instance of the mod.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
public BlueLib(IEventBus pModEventBus, ModContainer pModContainer) {
@@ -60,7 +51,6 @@ public BlueLib(IEventBus pModEventBus, ModContainer pModContainer) {
*
* @param pEvent {@link FMLLoadCompleteEvent} - The event fired after the mod loading process completes.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
@SubscribeEvent
diff --git a/common/src/main/java/software/bluelib/BlueLibCommon.java b/common/src/main/java/software/bluelib/BlueLibCommon.java
index e8921b59..fdc1d205 100644
--- a/common/src/main/java/software/bluelib/BlueLibCommon.java
+++ b/common/src/main/java/software/bluelib/BlueLibCommon.java
@@ -43,15 +43,14 @@ public static void init() {
*
* @return {@code true} if running in developer mode, {@code false} otherwise.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
static boolean isDeveloperMode() {
boolean isDevMode = PLATFORM.isDevelopmentEnvironment();
if (isDevMode) {
- BaseLogger.log(BaseLogLevel.INFO ,"Running in Developer mode.", true);
+ BaseLogger.log(BaseLogLevel.INFO, "Running in Developer mode.", true);
} else {
- BaseLogger.log(BaseLogLevel.INFO ,"Running in Production mode.", true);
+ BaseLogger.log(BaseLogLevel.INFO, "Running in Production mode.", true);
}
return isDevMode;
}
diff --git a/common/src/main/java/software/bluelib/BlueLibConstants.java b/common/src/main/java/software/bluelib/BlueLibConstants.java
index 85821c46..c5934a6b 100644
--- a/common/src/main/java/software/bluelib/BlueLibConstants.java
+++ b/common/src/main/java/software/bluelib/BlueLibConstants.java
@@ -5,23 +5,31 @@
public class BlueLibConstants {
- /**
- * A {@code public static final} {@link ScheduledExecutorService} used to schedule tasks, such as printing messages after a delay.
- *
- * This executor runs tasks on a single thread to ensure delayed tasks run in a separate thread from the main thread.
- *
- * @co-author MeAlam, Dan
- * @since 1.0.0
- */
- public static final ScheduledExecutorService SCHEDULER = Executors.newScheduledThreadPool(1);
+ /**
+ * A {@code public static final} {@link ScheduledExecutorService} used to schedule tasks, such as printing messages after a delay.
+ *
+ * This executor runs tasks on a single thread to ensure delayed tasks run in a separate thread from the main thread.
+ *
+ *
+ * @co-author MeAlam, Dan
+ * @since 1.0.0
+ */
+ public static final ScheduledExecutorService SCHEDULER = Executors.newScheduledThreadPool(1);
- /**
- * A {@code public static final} {@link String} representing the Mod ID for the {@code BlueLib} mod.
- *
This serves as a unique identifier for the mod.
- * @co-author MeAlam, Dan
- * @since 1.0.0
- */
- public static final String MOD_ID = "bluelib";
+ /**
+ * A {@code public static final} {@link String} representing the Mod ID for the {@code BlueLib} mod.
+ *
This serves as a unique identifier for the mod.
+ *
+ * @co-author MeAlam, Dan
+ * @since 1.0.0
+ */
+ public static final String MOD_ID = "bluelib";
- public static final String MOD_NAME = "BlueLib";
+ /**
+ * A {@code public static final} {@link String} representing the Mod Name for the {@code BlueLib} mod.
+ *
+ * @co-author MeAlam, Dan
+ * @since 1.0.0
+ */
+ public static final String MOD_NAME = "BlueLib";
}
\ No newline at end of file
diff --git a/common/src/main/java/software/bluelib/entity/variant/VariantLoader.java b/common/src/main/java/software/bluelib/entity/variant/VariantLoader.java
index ac421efd..af8e039e 100644
--- a/common/src/main/java/software/bluelib/entity/variant/VariantLoader.java
+++ b/common/src/main/java/software/bluelib/entity/variant/VariantLoader.java
@@ -29,8 +29,8 @@
*
{@link #getVariantsFromEntity(String)} - Retrieves the list of loaded {@link VariantParameter} for a specific entity.
*
{@link #getVariantByName(String, String)} - Retrieves a specific {@link VariantParameter} by its name for a given entity.
*
+ *
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
public class VariantLoader implements IVariantEntityBase {
@@ -40,6 +40,7 @@ public class VariantLoader implements IVariantEntityBase {
*
* This {@link Map} holds entity names and their corresponding list of {@link VariantParameter} instances.
*
+ *
* @co-author MeAlam, Dan
* @since 1.0.0
*/
@@ -47,6 +48,7 @@ public class VariantLoader implements IVariantEntityBase {
/**
* A {@code private static final} {@link JSONLoader} to load JSON data from resources.
+ *
* @co-author MeAlam, Dan
* @since 1.0.0
*/
@@ -57,6 +59,7 @@ public class VariantLoader implements IVariantEntityBase {
*
* This {@link JSONMerger} instance is used to merge JSON data into a single {@link JsonObject}.
*
+ *
* @co-author MeAlam, Dan
* @since 1.0.0
*/
@@ -68,12 +71,13 @@ public class VariantLoader implements IVariantEntityBase {
* The method loops through all resources in the folder and merges them into a single {@link JsonObject}.
* The merged JSON data is then parsed into {@link VariantParameter} instances and stored in {@link #entityVariantsMap}.
*
- * @param folderPath {@link String} - The path to the folder containing JSON resources.
- * @param pServer {@link MinecraftServer} - The {@link MinecraftServer} instance used to access resources.
+ *
+ * @param folderPath {@link String} - The path to the folder containing JSON resources.
+ * @param pServer {@link MinecraftServer} - The {@link MinecraftServer} instance used to access resources.
* @param pEntityName {@link String} - The name of the entity whose variants should be cleared before loading new ones.
*/
public static void loadVariants(String folderPath, MinecraftServer pServer, String pEntityName) {
- BaseLogger.log(BaseLogLevel.INFO,"Starting to load variants for entity: " + pEntityName);
+ BaseLogger.log(BaseLogLevel.INFO, "Starting to load variants for entity: " + pEntityName);
clearVariantsForEntity(pEntityName);
@@ -82,19 +86,19 @@ public static void loadVariants(String folderPath, MinecraftServer pServer, Stri
Collection collection = resourceManager.listResources(folderPath, pFiles -> pFiles.getPath().endsWith(".json")).keySet();
- BaseLogger.log(BaseLogLevel.INFO,"Found resources: " + collection);
+ BaseLogger.log(BaseLogLevel.INFO, "Found resources: " + collection);
for (ResourceLocation resourceLocation : collection) {
try {
- BaseLogger.log(BaseLogLevel.INFO,"Loading JSON data from resource: " + resourceLocation.toString());
+ BaseLogger.log(BaseLogLevel.INFO, "Loading JSON data from resource: " + resourceLocation.toString());
JsonObject jsonObject = jsonLoader.loadJson(resourceLocation, resourceManager);
jsonMerger.mergeJsonObjects(mergedJsonObject, jsonObject);
} catch (Exception pException) {
- BaseLogger.log(BaseLogLevel.ERROR,"Failed to load JSON data from resource: " + resourceLocation.toString(), pException);
+ BaseLogger.log(BaseLogLevel.ERROR, "Failed to load JSON data from resource: " + resourceLocation.toString(), pException);
}
}
- BaseLogger.log(BaseLogLevel.INFO,"Successfully loaded and merged JSON data for entity: " + pEntityName);
+ BaseLogger.log(BaseLogLevel.INFO, "Successfully loaded and merged JSON data for entity: " + pEntityName);
parseVariants(mergedJsonObject);
}
@@ -103,10 +107,11 @@ public static void loadVariants(String folderPath, MinecraftServer pServer, Stri
*
* This method removes all variants associated with the given entity name.
*
+ *
* @param pEntityName {@link String} - The name of the entity whose variants should be cleared.
*/
private static void clearVariantsForEntity(String pEntityName) {
- BaseLogger.log(BaseLogLevel.INFO,"Clearing variants for entity: " + pEntityName);
+ BaseLogger.log(BaseLogLevel.INFO, "Clearing variants for entity: " + pEntityName);
entityVariantsMap.remove(pEntityName);
}
@@ -115,6 +120,7 @@ private static void clearVariantsForEntity(String pEntityName) {
*
* This method processes each entry in the JSON object and stores the created {@link VariantParameter} instances in {@link #entityVariantsMap}.
*
* This method wraps the creation of {@link VariantParameter} instances for easier management and potential modification.
*
- * @param pJsonKey {@link String} - The key associated with this variant.
+ *
+ * @param pJsonKey {@link String} - The key associated with this variant.
* @param pJsonObject {@link JsonObject} - The {@link JsonObject} containing the variant data.
* @return {@link VariantParameter} - A {@link VariantParameter} instance.
*/
@@ -156,11 +163,12 @@ private static VariantParameter getEntityVariant(String pJsonKey, JsonObject pJs
*
* This method returns a list of variants for the given entity name. If no variants are found, an empty list is returned.
*
+ *
* @param pEntityName {@link String} - The name of the entity to retrieve variants for.
* @return {@link List} - A {@link List} of {@link VariantParameter} instances for the specified entity.
*/
public static List getVariantsFromEntity(String pEntityName) {
- BaseLogger.log(BaseLogLevel.INFO,"Retrieving variants for entity: " + pEntityName);
+ BaseLogger.log(BaseLogLevel.INFO, "Retrieving variants for entity: " + pEntityName);
return entityVariantsMap.getOrDefault(pEntityName, new ArrayList<>());
}
@@ -169,19 +177,20 @@ public static List getVariantsFromEntity(String pEntityName) {
*
* This method searches for a variant with the specified name within the list of variants for the given entity.
*
- * @param pEntityName {@link String} - The name of the entity to retrieve variants for.
+ *
+ * @param pEntityName {@link String} - The name of the entity to retrieve variants for.
* @param pVariantName {@link String} - The name of the variant to retrieve.
* @return {@link VariantParameter} - The {@link VariantParameter} with the specified name, or {@code null} if not found.
*/
public static VariantParameter getVariantByName(String pEntityName, String pVariantName) {
- BaseLogger.log(BaseLogLevel.INFO,"Retrieving variant by name: " + pVariantName + " for entity: " + pEntityName);
+ BaseLogger.log(BaseLogLevel.INFO, "Retrieving variant by name: " + pVariantName + " for entity: " + pEntityName);
List variants = getVariantsFromEntity(pEntityName);
for (VariantParameter variant : variants) {
if (variant.getVariantName().equals(pVariantName)) {
return variant;
}
}
- BaseLogger.log(BaseLogLevel.INFO,"Variant with name: " + pVariantName + " not found for entity: " + pEntityName);
+ BaseLogger.log(BaseLogLevel.INFO, "Variant with name: " + pVariantName + " not found for entity: " + pEntityName);
return null;
}
}
diff --git a/common/src/main/java/software/bluelib/entity/variant/VariantParameter.java b/common/src/main/java/software/bluelib/entity/variant/VariantParameter.java
index 7069ef69..c5b4b01b 100644
--- a/common/src/main/java/software/bluelib/entity/variant/VariantParameter.java
+++ b/common/src/main/java/software/bluelib/entity/variant/VariantParameter.java
@@ -24,8 +24,8 @@
*
{@link #getVariantName()} - Retrieves the name of the variant.
*
{@link #getParameter(String)} - Retrieves the value of a specific parameter by its key.
*
+ *
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
public class VariantParameter extends ParameterBase {
@@ -35,6 +35,7 @@ public class VariantParameter extends ParameterBase {
*
* This key is used to map the entity to its corresponding parameters within a {@link JsonObject}.
*
+ *
* @co-author MeAlam, Dan
* @since 1.0.0
*/
@@ -51,29 +52,29 @@ public class VariantParameter extends ParameterBase {
*
{@code Other Types}: Stores "null" for unhandled JSON types.
*
*
- * @param pJsonKey {@link String} - The key that identifies this entity within the {@link JsonObject}.
+ *
+ * @param pJsonKey {@link String} - The key that identifies this entity within the {@link JsonObject}.
* @param pJsonObject {@link JsonObject} - The {@link JsonObject} containing the variant parameters.
* @throws IllegalArgumentException if {@code pJsonKey} or {@code pJsonObject} is {@code null}.
- * @see ParameterBase
* @author MeAlam
- * @co-author Dan
+ * @see ParameterBase
* @since 1.0.0
*/
public VariantParameter(String pJsonKey, JsonObject pJsonObject) {
if (pJsonKey == null || pJsonObject == null) {
Throwable throwable = new Throwable("JSON key or JSON object is null");
IllegalArgumentException exception = new IllegalArgumentException("JSON key and object must not be null");
- BaseLogger.log(BaseLogLevel.ERROR,exception.toString(), throwable);
+ BaseLogger.log(BaseLogLevel.ERROR, exception.toString(), throwable);
throw exception;
}
this.jsonKey = pJsonKey;
- BaseLogger.log(BaseLogLevel.INFO,"Creating VariantParameter with JSON key: " + pJsonKey);
+ BaseLogger.log(BaseLogLevel.INFO, "Creating VariantParameter with JSON key: " + pJsonKey);
Set> entryMap = pJsonObject.entrySet();
for (Map.Entry entry : entryMap) {
JsonElement element = entry.getValue();
if (element.isJsonPrimitive()) {
addParameter(entry.getKey(), element.getAsString());
- BaseLogger.log(BaseLogLevel.SUCCESS,"Added primitive parameter: " + entry.getKey() + " = " + element.getAsString());
+ BaseLogger.log(BaseLogLevel.SUCCESS, "Added primitive parameter: " + entry.getKey() + " = " + element.getAsString());
} else if (element.isJsonArray()) {
StringBuilder arrayValues = new StringBuilder();
element.getAsJsonArray().forEach(e -> arrayValues.append(e.getAsString()).append(","));
@@ -81,13 +82,13 @@ public VariantParameter(String pJsonKey, JsonObject pJsonObject) {
arrayValues.setLength(arrayValues.length() - 1);
}
addParameter(entry.getKey(), arrayValues.toString());
- BaseLogger.log(BaseLogLevel.SUCCESS,"Added array parameter: " + entry.getKey() + " = " + arrayValues.toString());
+ BaseLogger.log(BaseLogLevel.SUCCESS, "Added array parameter: " + entry.getKey() + " = " + arrayValues.toString());
} else if (element.isJsonObject()) {
addParameter(entry.getKey(), element.toString());
- BaseLogger.log(BaseLogLevel.SUCCESS,"Added object parameter: " + entry.getKey() + " = " + element.toString());
+ BaseLogger.log(BaseLogLevel.SUCCESS, "Added object parameter: " + entry.getKey() + " = " + element.toString());
} else {
addParameter(entry.getKey(), "null");
- BaseLogger.log(BaseLogLevel.SUCCESS,"Added null parameter for key: " + entry.getKey());
+ BaseLogger.log(BaseLogLevel.SUCCESS, "Added null parameter for key: " + entry.getKey());
}
}
}
@@ -97,10 +98,10 @@ public VariantParameter(String pJsonKey, JsonObject pJsonObject) {
*
* This key is used to retrieve or map the entity within a broader data structure.
*
+ *
* @return The key of the JSON object representing this entity.
* @throws IllegalStateException if the key is unexpectedly {@code null}.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
public String getJsonKey() {
@@ -110,7 +111,7 @@ public String getJsonKey() {
BaseLogger.log(BaseLogLevel.ERROR, "JSON key is unexpectedly null when retrieving from VariantParameter.", throwable);
throw exception;
}
- BaseLogger.log(BaseLogLevel.INFO,"Retrieved JSON key: " + this.jsonKey);
+ BaseLogger.log(BaseLogLevel.INFO, "Retrieved JSON key: " + this.jsonKey);
return this.jsonKey;
}
@@ -119,14 +120,14 @@ public String getJsonKey() {
*
* The variant name is expected to be stored under the key {@code "variantName"} in the parameters/JSON files.
*
+ *
* @return The name of the variant, or {@code null} if the variant name is not found.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
public String getVariantName() {
String variantName = getParameter("variantName");
- BaseLogger.log(BaseLogLevel.INFO,"Retrieved variant name: " + variantName);
+ BaseLogger.log(BaseLogLevel.INFO, "Retrieved variant name: " + variantName);
return variantName;
}
@@ -135,15 +136,15 @@ public String getVariantName() {
*
* This method looks up the parameter's value within the internal data structure.
*
+ *
* @param pKey {@link String} - The key of the parameter to retrieve.
* @return The value of the parameter, or {@code null} if the key does not exist.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
public String getParameter(String pKey) {
String value = (String) super.getParameter(pKey);
- BaseLogger.log(BaseLogLevel.INFO,"Retrieved parameter for key " + pKey + ": " + value);
+ BaseLogger.log(BaseLogLevel.INFO, "Retrieved parameter for key " + pKey + ": " + value);
return value;
}
}
diff --git a/common/src/main/java/software/bluelib/entity/variant/base/ParameterBase.java b/common/src/main/java/software/bluelib/entity/variant/base/ParameterBase.java
index 767fd17b..9769ac9f 100644
--- a/common/src/main/java/software/bluelib/entity/variant/base/ParameterBase.java
+++ b/common/src/main/java/software/bluelib/entity/variant/base/ParameterBase.java
@@ -29,8 +29,8 @@
*
{@link #getParameterValues()} - Returns a collection of all parameter values from {@link #parameters}.
*
{@link #updateParameter(String, Object)} - Updates the value of an existing parameter in {@link #parameters}.
*
+ *
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
public abstract class ParameterBase {
@@ -40,6 +40,7 @@ public abstract class ParameterBase {
*
* This {@link Map} holds parameter keys and their corresponding values.
*
+ *
* @co-author MeAlam, Dan
* @since 1.0.0
*/
@@ -50,10 +51,10 @@ public abstract class ParameterBase {
*
* This method stores a new parameter with the specified key and value in {@link #parameters}.
*
- * @param pKey {@link String} - The key under which the parameter is stored.
+ *
+ * @param pKey {@link String} - The key under which the parameter is stored.
* @param pValue {@link Object} - The value of the parameter.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
protected void addParameter(String pKey, Object pValue) {
@@ -66,10 +67,10 @@ protected void addParameter(String pKey, Object pValue) {
*
* This method returns the value associated with the specified key, or {@code null} if the key does not exist.
*
+ *
* @param pKey {@link String} - The key of the parameter to retrieve.
* @return {@link Object} - The value associated with the key, or {@code null} if the key does not exist.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
protected Object getParameter(String pKey) {
@@ -83,9 +84,9 @@ protected Object getParameter(String pKey) {
*
* This method deletes the parameter with the specified key from {@link #parameters}. If the key does not exist, no action is taken.
*
+ *
* @param pKey {@link String} - The key of the parameter to remove.
* @author MeAlam
- * @co-author Dan
* @since 1.0.0
*/
protected void removeParameter(String pKey) {
@@ -101,9 +102,9 @@ protected void removeParameter(String pKey) {
*
* This method returns a new {@link Map} containing all parameters stored in {@link #parameters}.
*