* This class manages the dragon's variant system, its data synchronization, and integrates with the GeckoLib
* animation system.
@@ -34,9 +38,9 @@
* Key Methods:
*
*
{@link #defineSynchedData()} - Defines the synchronized data for the dragon entity, including its variant.
- *
{@link #addAdditionalSaveData(CompoundTag)} - Adds custom data to the entity's NBT for saving.
- *
{@link #readAdditionalSaveData(CompoundTag)} - Reads custom data from the entity's NBT for loading.
- *
{@link #finalizeSpawn(ServerLevelAccessor, DifficultyInstance, MobSpawnType, SpawnGroupData, CompoundTag)} - Finalizes the spawning process and sets up parameters.
+ *
{@link #addAdditionalSaveData(CompoundNBT)} - Adds custom data to the entity's NBT for saving.
+ *
{@link #readAdditionalSaveData(CompoundNBT)} - Reads custom data from the entity's NBT for loading.
+ *
{@link #finalizeSpawn(IServerWorld, DifficultyInstance, SpawnReason, ILivingEntityData, CompoundNBT)} - Finalizes the spawning process and sets up parameters.
*
{@link #setVariantName(String)} - Sets the variant name of the dragon.
*
{@link #getVariantName()} - Retrieves the current variant name of the dragon.
*
@@ -46,7 +50,7 @@
* @Co-author Dan
* @since 1.0.0
*/
-public class DragonEntity extends TamableAnimal implements IVariantEntity, GeoEntity {
+public class DragonEntity extends TameableEntity implements IVariantEntity, IAnimatable {
/**
* Entity data accessor for the variant of the dragon.
*
@@ -55,7 +59,7 @@ public class DragonEntity extends TamableAnimal implements IVariantEntity, GeoEn
* @Co-author MeAlam, Dan
* @since 1.0.0
*/
- public static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(DragonEntity.class, EntityDataSerializers.STRING);
+ public static final DataParameter VARIANT = EntityDataManager.defineId(DragonEntity.class, DataSerializers.STRING);
/**
* The name of the entity.
@@ -68,20 +72,20 @@ public class DragonEntity extends TamableAnimal implements IVariantEntity, GeoEn
* Constructs a new {@link DragonEntity} instance with the specified entity type and level.
*
* @param pEntityType {@link EntityType} - The type of the entity.
- * @param pLevel {@link Level} - The level in which the entity is created.
+ * @param pLevel {@link World} - The level in which the entity is created.
*
* @since 1.0.0
* @author MeAlam
* @Co-author Dan
*/
- public DragonEntity(EntityType extends TamableAnimal> pEntityType, Level pLevel) {
+ public DragonEntity(EntityType extends TameableEntity> pEntityType, World pLevel) {
super(pEntityType, pLevel);
}
/**
* Defines the synchronized data for this dragon entity, including the variant.
*
- * This method initializes the {@link EntityDataAccessor} to handle the variant data.
+ * This method initializes the {@link DataParameter} to handle the variant data.
*
*
* @since 1.0.0
@@ -100,14 +104,14 @@ protected void defineSynchedData() {
* This method stores the variant name in the NBT data so it can be restored when loading the entity.
*
*
- * @param pCompound {@link CompoundTag} - The NBT tag to which data should be added.
+ * @param pCompound {@link CompoundNBT} - The NBT tag to which data should be added.
*
* @since 1.0.0
* @author MeAlam
* @Co-author Dan
*/
@Override
- public void addAdditionalSaveData(@NotNull CompoundTag pCompound) {
+ public void addAdditionalSaveData(CompoundNBT pCompound) {
super.addAdditionalSaveData(pCompound);
pCompound.putString("Variant", getVariantName());
}
@@ -118,14 +122,14 @@ public void addAdditionalSaveData(@NotNull CompoundTag pCompound) {
* This method retrieves the variant name from the NBT data and sets it for the entity.
*
*
- * @param pCompound {@link CompoundTag} - The NBT tag from which data should be read.
+ * @param pCompound {@link CompoundNBT} - The NBT tag from which data should be read.
*
* @since 1.0.0
* @author MeAlam
* @Co-author Dan
*/
@Override
- public void readAdditionalSaveData(@NotNull CompoundTag pCompound) {
+ public void readAdditionalSaveData(CompoundNBT pCompound) {
super.readAdditionalSaveData(pCompound);
this.setVariantName(pCompound.getString("Variant"));
}
@@ -136,19 +140,19 @@ public void readAdditionalSaveData(@NotNull CompoundTag pCompound) {
* This method sets up the variant for the entity and connects parameters if needed.
*
*
- * @param pLevel {@link ServerLevelAccessor} - The level in which the entity is spawned.
+ * @param pLevel {@link IServerWorld} - The level in which the entity is spawned.
* @param pDifficulty {@link DifficultyInstance} - The difficulty instance for spawning.
- * @param pReason {@link MobSpawnType} - The reason for spawning the entity.
- * @param pSpawnData {@link SpawnGroupData} - Data related to the spawn.
- * @param pDataTag {@link CompoundTag} - Additional data for spawning.
- * @return {@link SpawnGroupData} - Updated spawn data.
+ * @param pReason {@link SpawnReason} - The reason for spawning the entity.
+ * @param pSpawnData {@link ILivingEntityData} - Data related to the spawn.
+ * @param pDataTag {@link CompoundNBT} - Additional data for spawning.
+ * @return {@link ILivingEntityData} - Updated spawn data.
*
* @since 1.0.0
* @author MeAlam
* @Co-author Dan
*/
@Override
- public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor pLevel, @NotNull DifficultyInstance pDifficulty, @NotNull MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
+ public ILivingEntityData finalizeSpawn(IServerWorld pLevel, DifficultyInstance pDifficulty, SpawnReason pReason, @Nullable ILivingEntityData pSpawnData, @Nullable CompoundNBT pDataTag) {
if (getVariantName() == null || getVariantName().isEmpty()) {
this.setVariantName(getRandomVariant(getEntityVariants(entityName), "normal"));
ParameterUtils.ParameterBuilder.forVariant(entityName,this.getVariantName())
@@ -191,30 +195,27 @@ public String getVariantName() {
* All Code below this Fragment is not Library Related!!!
*/
- private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
+ public AnimationFactory factory = GeckoLibUtil.createFactory(this);
- public static AttributeSupplier.Builder createAttributes() {
- return Mob.createMobAttributes()
- .add(Attributes.MOVEMENT_SPEED, 0.3)
- .add(Attributes.MAX_HEALTH, 10)
- .add(Attributes.ARMOR, 0)
- .add(Attributes.ATTACK_DAMAGE, 3)
- .add(Attributes.FOLLOW_RANGE, 16)
- .add(Attributes.FLYING_SPEED, 0.3);
+ public static AttributeModifierMap.MutableAttribute createAttributes() {
+ return TameableEntity.createMobAttributes()
+ .add(Attributes.MAX_HEALTH, 10.0D)
+ .add(Attributes.MOVEMENT_SPEED, 0.3D)
+ .add(Attributes.FLYING_SPEED, 0.3D)
+ .add(Attributes.FOLLOW_RANGE, 16.0D);
}
+ @Nullable
@Override
- public void registerControllers(AnimatableManager.ControllerRegistrar pControllerRegistrar) {
+ public AgeableEntity getBreedOffspring(ServerWorld serverWorld, AgeableEntity ageableEntity) {
+ return null;
}
@Override
- public AnimatableInstanceCache getAnimatableInstanceCache() {
- return cache;
- }
+ public void registerControllers(AnimationData data) {}
- @Nullable
@Override
- public AgeableMob getBreedOffspring(@NotNull ServerLevel pLevel, @NotNull AgeableMob pOtherParent) {
- return null;
+ public AnimationFactory getFactory() {
+ return factory;
}
}
diff --git a/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonModel.java b/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonModel.java
index 67091901..2bfba12f 100644
--- a/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonModel.java
+++ b/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonModel.java
@@ -2,28 +2,28 @@
package software.bluelib.example.entity.dragon;
-import net.minecraft.resources.ResourceLocation;
-import software.bernie.geckolib.model.GeoModel;
+import net.minecraft.util.ResourceLocation;
+import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bluelib.BlueLib;
-public class DragonModel extends GeoModel {
+public class DragonModel extends AnimatedGeoModel {
// Get the Model Location
@Override
- public ResourceLocation getModelResource(DragonEntity pObject) {
+ public ResourceLocation getModelLocation(DragonEntity pObject) {
return new ResourceLocation(BlueLib.MODID, "geo/dragon.geo.json");
}
// Get the Texture Location
@Override
- public ResourceLocation getTextureResource(DragonEntity pObject) {
+ public ResourceLocation getTextureLocation(DragonEntity pObject) {
return pObject.getTextureLocation(BlueLib.MODID, "textures/entity/" + pObject.entityName + "/" + pObject.getVariantName() + ".png");
}
// Get the Animation Location
@Override
- public ResourceLocation getAnimationResource(DragonEntity pAnimatable) {
+ public ResourceLocation getAnimationFileLocation(DragonEntity pAnimatable) {
return new ResourceLocation(BlueLib.MODID, "animations/dragon.animation.json");
}
}
diff --git a/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonRender.java b/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonRender.java
index c770ac48..05be2d19 100644
--- a/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonRender.java
+++ b/Forge/src/main/java/software/bluelib/example/entity/dragon/DragonRender.java
@@ -2,13 +2,13 @@
package software.bluelib.example.entity.dragon;
-import net.minecraft.client.renderer.entity.EntityRendererProvider;
-import software.bernie.geckolib.renderer.GeoEntityRenderer;
+import net.minecraft.client.renderer.entity.EntityRendererManager;
+import software.bernie.geckolib3.renderers.geo.GeoEntityRenderer;
public class DragonRender extends GeoEntityRenderer {
// Render the entity
- public DragonRender(EntityRendererProvider.Context pRenderManager) {
+ public DragonRender(EntityRendererManager pRenderManager) {
super(pRenderManager, new DragonModel());
}
}
diff --git a/Forge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java b/Forge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java
index fcb85a52..cbdc9d07 100644
--- a/Forge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java
+++ b/Forge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java
@@ -2,29 +2,33 @@
package software.bluelib.example.entity.rex;
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.network.syncher.EntityDataAccessor;
-import net.minecraft.network.syncher.EntityDataSerializers;
-import net.minecraft.network.syncher.SynchedEntityData;
-import net.minecraft.server.level.ServerLevel;
+import net.minecraft.entity.AgeableEntity;
+import net.minecraft.entity.EntityType;
+import net.minecraft.entity.ILivingEntityData;
+import net.minecraft.entity.SpawnReason;
+import net.minecraft.entity.ai.attributes.AttributeModifierMap;
+import net.minecraft.entity.ai.attributes.Attributes;
+import net.minecraft.entity.passive.TameableEntity;
+import net.minecraft.nbt.CompoundNBT;
+import net.minecraft.network.datasync.DataParameter;
+import net.minecraft.network.datasync.DataSerializers;
+import net.minecraft.network.datasync.EntityDataManager;
import net.minecraft.world.DifficultyInstance;
-import net.minecraft.world.entity.*;
-import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
-import net.minecraft.world.entity.ai.attributes.Attributes;
-import net.minecraft.world.level.Level;
-import net.minecraft.world.level.ServerLevelAccessor;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import software.bernie.geckolib.animatable.GeoEntity;
-import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
-import software.bernie.geckolib.core.animation.AnimatableManager;
-import software.bernie.geckolib.util.GeckoLibUtil;
+import net.minecraft.world.IServerWorld;
+import net.minecraft.world.World;
+import net.minecraft.world.server.ServerWorld;
+import software.bernie.geckolib3.core.IAnimatable;
+import software.bernie.geckolib3.core.manager.AnimationData;
+import software.bernie.geckolib3.core.manager.AnimationFactory;
+import software.bernie.geckolib3.util.GeckoLibUtil;
import software.bluelib.interfaces.variant.IVariantEntity;
import software.bluelib.utils.ParameterUtils;
+import javax.annotation.Nullable;
+
/**
- * A {@code RexEntity} class representing a Rex entity in the game, which extends {@link TamableAnimal}
- * and implements {@link IVariantEntity} and {@link GeoEntity}.
+ * A {@code RexEntity} class representing a Rex entity in the game, which extends {@link TameableEntity}
+ * and implements {@link IVariantEntity} and {@link IAnimatable}.
*
* This class manages the rex's variant system, its data synchronization, and integrates with the GeckoLib
* animation system.
@@ -34,9 +38,9 @@
* Key Methods:
*
*
{@link #defineSynchedData()} - Defines the synchronized data for the rex entity, including its variant.
- *
{@link #addAdditionalSaveData(CompoundTag)} - Adds custom data to the entity's NBT for saving.
- *
{@link #readAdditionalSaveData(CompoundTag)} - Reads custom data from the entity's NBT for loading.
- *
{@link #finalizeSpawn(ServerLevelAccessor, DifficultyInstance, MobSpawnType, SpawnGroupData, CompoundTag)} - Finalizes the spawning process and sets up parameters.
+ *
{@link #addAdditionalSaveData(CompoundNBT)} - Adds custom data to the entity's NBT for saving.
+ *
{@link #readAdditionalSaveData(CompoundNBT)} - Reads custom data from the entity's NBT for loading.
+ *
{@link #finalizeSpawn(IServerWorld, DifficultyInstance, SpawnReason, ILivingEntityData, CompoundNBT)} - Finalizes the spawning process and sets up parameters.
*
{@link #setVariantName(String)} - Sets the variant name of the rex.
*
{@link #getVariantName()} - Retrieves the current variant name of the rex.
*
@@ -46,7 +50,7 @@
* @Co-author Dan
* @since 1.0.0
*/
-public class RexEntity extends TamableAnimal implements IVariantEntity, GeoEntity {
+public class RexEntity extends TameableEntity implements IVariantEntity, IAnimatable {
/**
* Entity data accessor for the variant of the rex.
*
@@ -55,7 +59,7 @@ public class RexEntity extends TamableAnimal implements IVariantEntity, GeoEntit
* @Co-author MeAlam, Dan
* @since 1.0.0
*/
- public static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(RexEntity.class, EntityDataSerializers.STRING);
+ public static final DataParameter VARIANT = EntityDataManager.defineId(RexEntity.class, DataSerializers.STRING);
/**
* The name of the entity.
@@ -68,20 +72,20 @@ public class RexEntity extends TamableAnimal implements IVariantEntity, GeoEntit
* Constructs a new {@link RexEntity} instance with the specified entity type and level.
*
* @param pEntityType {@link EntityType} - The type of the entity.
- * @param pLevel {@link Level} - The level in which the entity is created.
+ * @param pLevel {@link World} - The level in which the entity is created.
*
* @since 1.0.0
* @author MeAlam
* @Co-author Dan
*/
- public RexEntity(EntityType extends TamableAnimal> pEntityType, Level pLevel) {
+ public RexEntity(EntityType extends TameableEntity> pEntityType, World pLevel) {
super(pEntityType, pLevel);
}
/**
* Defines the synchronized data for this rex entity, including the variant.
*
- * This method initializes the {@link EntityDataAccessor} to handle the variant data.
+ * This method initializes the {@link DataParameter} to handle the variant data.
*
*
* @since 1.0.0
@@ -100,14 +104,14 @@ protected void defineSynchedData() {
* This method stores the variant name in the NBT data so it can be restored when loading the entity.
*
*
- * @param pCompound {@link CompoundTag} - The NBT tag to which data should be added.
+ * @param pCompound {@link CompoundNBT} - The NBT tag to which data should be added.
*
* @since 1.0.0
* @author MeAlam
* @Co-author Dan
*/
@Override
- public void addAdditionalSaveData(@NotNull CompoundTag pCompound) {
+ public void addAdditionalSaveData(CompoundNBT pCompound) {
super.addAdditionalSaveData(pCompound);
pCompound.putString("Variant", getVariantName());
}
@@ -118,14 +122,14 @@ public void addAdditionalSaveData(@NotNull CompoundTag pCompound) {
* This method retrieves the variant name from the NBT data and sets it for the entity.
*
*
- * @param pCompound {@link CompoundTag} - The NBT tag from which data should be read.
+ * @param pCompound {@link CompoundNBT} - The NBT tag from which data should be read.
*
* @since 1.0.0
* @author MeAlam
* @Co-author Dan
*/
@Override
- public void readAdditionalSaveData(@NotNull CompoundTag pCompound) {
+ public void readAdditionalSaveData(CompoundNBT pCompound) {
super.readAdditionalSaveData(pCompound);
this.setVariantName(pCompound.getString("Variant"));
}
@@ -136,19 +140,19 @@ public void readAdditionalSaveData(@NotNull CompoundTag pCompound) {
* This method sets up the variant for the entity and connects parameters if needed.
*
*
- * @param pLevel {@link ServerLevelAccessor} - The level in which the entity is spawned.
+ * @param pLevel {@link IServerWorld} - The level in which the entity is spawned.
* @param pDifficulty {@link DifficultyInstance} - The difficulty instance for spawning.
- * @param pReason {@link MobSpawnType} - The reason for spawning the entity.
- * @param pSpawnData {@link SpawnGroupData} - Data related to the spawn.
- * @param pDataTag {@link CompoundTag} - Additional data for spawning.
- * @return {@link SpawnGroupData} - Updated spawn data.
+ * @param pReason {@link SpawnReason} - The reason for spawning the entity.
+ * @param pSpawnData {@link ILivingEntityData} - Data related to the spawn.
+ * @param pDataTag {@link CompoundNBT} - Additional data for spawning.
+ * @return {@link ILivingEntityData} - Updated spawn data.
*
* @since 1.0.0
* @author MeAlam
* @Co-author Dan
*/
@Override
- public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor pLevel, @NotNull DifficultyInstance pDifficulty, @NotNull MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
+ public ILivingEntityData finalizeSpawn(IServerWorld pLevel, DifficultyInstance pDifficulty, SpawnReason pReason, @Nullable ILivingEntityData pSpawnData, @Nullable CompoundNBT pDataTag) {
if (getVariantName() == null || getVariantName().isEmpty()) {
this.setVariantName(getRandomVariant(getEntityVariants(entityName), "normal"));
ParameterUtils.ParameterBuilder.forVariant(entityName,this.getVariantName())
@@ -191,10 +195,10 @@ public String getVariantName() {
* All Code below this Fragment is not Library Related!!!
*/
- private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
+ public AnimationFactory factory = GeckoLibUtil.createFactory(this);
- public static AttributeSupplier.Builder createAttributes() {
- return Mob.createMobAttributes()
+ public static AttributeModifierMap.MutableAttribute createAttributes() {
+ return TameableEntity.createMobAttributes()
.add(Attributes.MOVEMENT_SPEED, 0.3)
.add(Attributes.MAX_HEALTH, 10)
.add(Attributes.ARMOR, 0)
@@ -204,17 +208,16 @@ public static AttributeSupplier.Builder createAttributes() {
}
@Override
- public void registerControllers(AnimatableManager.ControllerRegistrar pControllerRegistrar) {
- }
+ public void registerControllers(AnimationData data) {}
@Override
- public AnimatableInstanceCache getAnimatableInstanceCache() {
- return cache;
+ public AnimationFactory getFactory() {
+ return factory;
}
@Nullable
@Override
- public AgeableMob getBreedOffspring(@NotNull ServerLevel pLevel, @NotNull AgeableMob pOtherParent) {
+ public AgeableEntity getBreedOffspring(ServerWorld serverWorld, AgeableEntity ageableEntity) {
return null;
}
}
diff --git a/Forge/src/main/java/software/bluelib/example/entity/rex/RexModel.java b/Forge/src/main/java/software/bluelib/example/entity/rex/RexModel.java
index 6084892c..c65b1e38 100644
--- a/Forge/src/main/java/software/bluelib/example/entity/rex/RexModel.java
+++ b/Forge/src/main/java/software/bluelib/example/entity/rex/RexModel.java
@@ -2,28 +2,28 @@
package software.bluelib.example.entity.rex;
-import net.minecraft.resources.ResourceLocation;
-import software.bernie.geckolib.model.GeoModel;
+import net.minecraft.util.ResourceLocation;
+import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bluelib.BlueLib;
-public class RexModel extends GeoModel {
+public class RexModel extends AnimatedGeoModel {
// Get the Model Location
@Override
- public ResourceLocation getModelResource(RexEntity pObject) {
+ public ResourceLocation getModelLocation(RexEntity pObject) {
return new ResourceLocation(BlueLib.MODID, "geo/rex.geo.json");
}
// Get the Texture Location
@Override
- public ResourceLocation getTextureResource(RexEntity pObject) {
+ public ResourceLocation getTextureLocation(RexEntity pObject) {
return pObject.getTextureLocation(BlueLib.MODID, "textures/entity/" + pObject.entityName + "/" + pObject.getVariantName() + ".png");
}
// Get the Animation Location
@Override
- public ResourceLocation getAnimationResource(RexEntity pAnimatable) {
+ public ResourceLocation getAnimationFileLocation(RexEntity pAnimatable) {
return new ResourceLocation(BlueLib.MODID, "animations/rex.animation.json");
}
}
diff --git a/Forge/src/main/java/software/bluelib/example/entity/rex/RexRender.java b/Forge/src/main/java/software/bluelib/example/entity/rex/RexRender.java
index 776c5920..8220b4cb 100644
--- a/Forge/src/main/java/software/bluelib/example/entity/rex/RexRender.java
+++ b/Forge/src/main/java/software/bluelib/example/entity/rex/RexRender.java
@@ -2,13 +2,12 @@
package software.bluelib.example.entity.rex;
-import net.minecraft.client.renderer.entity.EntityRendererProvider;
-import software.bernie.geckolib.renderer.GeoEntityRenderer;
+import net.minecraft.client.renderer.entity.EntityRendererManager;
+import software.bernie.geckolib3.renderers.geo.GeoEntityRenderer;
public class RexRender extends GeoEntityRenderer {
-
// Render the entity
- public RexRender(EntityRendererProvider.Context pRenderManager) {
+ public RexRender(EntityRendererManager pRenderManager) {
super(pRenderManager, new RexModel());
}
}
diff --git a/Forge/src/main/java/software/bluelib/example/event/ClientEvents.java b/Forge/src/main/java/software/bluelib/example/event/ClientEvents.java
index 187fc9ab..ac48aa2f 100644
--- a/Forge/src/main/java/software/bluelib/example/event/ClientEvents.java
+++ b/Forge/src/main/java/software/bluelib/example/event/ClientEvents.java
@@ -2,8 +2,8 @@
package software.bluelib.example.event;
-import net.minecraft.client.renderer.entity.EntityRenderers;
import net.minecraftforge.api.distmarker.Dist;
+import net.minecraftforge.fml.client.registry.RenderingRegistry;
import net.minecraftforge.fml.common.Mod;
import software.bluelib.BlueLib;
import software.bluelib.example.entity.dragon.DragonRender;
@@ -15,7 +15,7 @@ public class ClientEvents {
public static void registerRenderers() {
// Register the renderer for all the Entities
- EntityRenderers.register(ModEntities.DRAGON.get(), DragonRender::new);
- EntityRenderers.register(ModEntities.REX.get(), RexRender::new);
+ RenderingRegistry.registerEntityRenderingHandler(ModEntities.DRAGON.get(), DragonRender::new);
+ RenderingRegistry.registerEntityRenderingHandler(ModEntities.REX.get(), RexRender::new);
}
}
diff --git a/Forge/src/main/java/software/bluelib/example/event/ReloadHandler.java b/Forge/src/main/java/software/bluelib/example/event/ReloadHandler.java
index 24ed12b0..257878ce 100644
--- a/Forge/src/main/java/software/bluelib/example/event/ReloadHandler.java
+++ b/Forge/src/main/java/software/bluelib/example/event/ReloadHandler.java
@@ -4,9 +4,8 @@
import net.minecraft.server.MinecraftServer;
import net.minecraftforge.event.AddReloadListenerEvent;
-import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
-import net.minecraftforge.fml.common.Mod;
+import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import software.bluelib.BlueLib;
import software.bluelib.event.ReloadEventHandler;
@@ -26,7 +25,7 @@
*
* Key Methods:
*
- *
{@link #onServerStart(ServerStartingEvent)} - Handles server starting events to initialize entity variants.
+ *
{@link #onServerStart(FMLServerStartingEvent)} - Handles server starting events to initialize entity variants.
*
{@link #onReload(AddReloadListenerEvent)} - Handles reload events to refresh entity variants.
*
{@link #LoadEntityVariants(MinecraftServer)} - Loads entity variants from JSON files into the server.
*
@@ -53,14 +52,14 @@ public class ReloadHandler extends ReloadEventHandler {
* Handles the server starting event to initialize the {@link MinecraftServer} instance
* and load entity variants.
*
- * @param pEvent {@link ServerStartingEvent} - The event triggered when the server starts.
+ * @param pEvent {@link FMLServerStartingEvent} - The event triggered when the server starts.
*
* @since 1.0.0
* @author MeAlam
* @Co-author Dan
*/
@SubscribeEvent
- public static void onServerStart(ServerStartingEvent pEvent) {
+ public static void onServerStart(FMLServerStartingEvent pEvent) {
server = pEvent.getServer();
ReloadHandler.LoadEntityVariants(server);
}
diff --git a/Forge/src/main/java/software/bluelib/example/init/ModEntities.java b/Forge/src/main/java/software/bluelib/example/init/ModEntities.java
index 2825e2fe..8ee739dc 100644
--- a/Forge/src/main/java/software/bluelib/example/init/ModEntities.java
+++ b/Forge/src/main/java/software/bluelib/example/init/ModEntities.java
@@ -2,41 +2,35 @@
package software.bluelib.example.init;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.world.entity.EntityType;
-import net.minecraft.world.entity.MobCategory;
+import net.minecraft.entity.EntityClassification;
+import net.minecraft.entity.EntityType;
+import net.minecraft.util.ResourceLocation;
import net.minecraftforge.eventbus.api.IEventBus;
+import net.minecraftforge.fml.RegistryObject;
+import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
-import net.minecraftforge.registries.RegistryObject;
import software.bluelib.BlueLib;
import software.bluelib.example.entity.dragon.DragonEntity;
import software.bluelib.example.entity.rex.RexEntity;
+@Mod.EventBusSubscriber(modid = BlueLib.MODID, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ModEntities {
public static final DeferredRegister> REGISTER =
- DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, BlueLib.MODID);
+ DeferredRegister.create(ForgeRegistries.ENTITIES, BlueLib.MODID);
// List of Entities
public static final RegistryObject> DRAGON =
- REGISTER.register("example_one", () -> EntityType.Builder.of(DragonEntity::new, MobCategory.AMBIENT)
- .setShouldReceiveVelocityUpdates(true)
- .setTrackingRange(64)
- .setUpdateInterval(3)
- .fireImmune()
+ REGISTER.register("dragon", () -> EntityType.Builder.of(DragonEntity::new, EntityClassification.CREATURE)
.sized(0.6f, 1.8f)
.build(new ResourceLocation(BlueLib.MODID, "dragon").toString()));
public static final RegistryObject> REX =
- REGISTER.register("example_two", () -> EntityType.Builder.of(RexEntity::new, MobCategory.AMBIENT)
- .setShouldReceiveVelocityUpdates(true)
- .setTrackingRange(64)
- .setUpdateInterval(3)
- .fireImmune()
+ REGISTER.register("rex", () -> EntityType.Builder.of(RexEntity::new, EntityClassification.CREATURE)
.sized(0.6f, 1.8f)
.build(new ResourceLocation(BlueLib.MODID, "rex").toString()));
public static void register(IEventBus eventBus) {
REGISTER.register(eventBus);
}
-}
+}
\ No newline at end of file
diff --git a/Forge/src/main/java/software/bluelib/interfaces/variant/IVariantEntity.java b/Forge/src/main/java/software/bluelib/interfaces/variant/IVariantEntity.java
index 5273ec4e..e62ae544 100644
--- a/Forge/src/main/java/software/bluelib/interfaces/variant/IVariantEntity.java
+++ b/Forge/src/main/java/software/bluelib/interfaces/variant/IVariantEntity.java
@@ -4,6 +4,8 @@
import software.bluelib.interfaces.variant.base.IVariantEntityBase;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Random;
@@ -47,7 +49,7 @@ public interface IVariantEntity extends IVariantEntityBase {
* @since 1.0.0
*/
default String getRandomVariant(List pVariantNamesList, String pDefaultVariant) {
- List spawnableVariants = List.copyOf(pVariantNamesList);
+ List spawnableVariants = Collections.unmodifiableList(new ArrayList<>(pVariantNamesList));
if (!spawnableVariants.isEmpty()) {
return spawnableVariants.get(random.nextInt(spawnableVariants.size()));
}
diff --git a/Forge/src/main/java/software/bluelib/interfaces/variant/base/IVariantEntityBase.java b/Forge/src/main/java/software/bluelib/interfaces/variant/base/IVariantEntityBase.java
index 3b905d28..b3b31e69 100644
--- a/Forge/src/main/java/software/bluelib/interfaces/variant/base/IVariantEntityBase.java
+++ b/Forge/src/main/java/software/bluelib/interfaces/variant/base/IVariantEntityBase.java
@@ -2,7 +2,7 @@
package software.bluelib.interfaces.variant.base;
-import net.minecraft.resources.ResourceLocation;
+import net.minecraft.util.ResourceLocation;
import software.bluelib.entity.variant.VariantLoader;
import software.bluelib.entity.variant.VariantParameter;
diff --git a/Forge/src/main/java/software/bluelib/json/JSONLoader.java b/Forge/src/main/java/software/bluelib/json/JSONLoader.java
index f046903c..41dbfee7 100644
--- a/Forge/src/main/java/software/bluelib/json/JSONLoader.java
+++ b/Forge/src/main/java/software/bluelib/json/JSONLoader.java
@@ -4,16 +4,17 @@
import com.google.gson.Gson;
import com.google.gson.JsonObject;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.server.packs.resources.Resource;
-import net.minecraft.server.packs.resources.ResourceManager;
+import com.google.gson.JsonSyntaxException;
+import net.minecraft.resources.IResource;
+import net.minecraft.resources.IResourceManager;
+import net.minecraft.util.ResourceLocation;
import software.bluelib.exception.CouldNotLoadJSON;
+import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
-import java.util.Optional;
/**
* The {@code JSONLoader} class is responsible for loading and parsing JSON data from
@@ -22,7 +23,7 @@
*
* Key methods:
*
- *
{@link #loadJson(ResourceLocation, ResourceManager)} - Loads a JSON resource.
+ *
{@link #loadJson(ResourceLocation, IResourceManager)} - Loads a JSON resource.
*
* @author MeAlam
* @Co-author Dan
@@ -42,28 +43,30 @@ public class JSONLoader {
* in a Minecraft mod environment.
*
- * This class serves as the entry point for the {@link BlueLib} mod, handling initialization by registering event handlers
- * and setting up necessary configurations. For more details, refer to the BlueLib Wiki.
- *
- *
- *
- * Key Methods:
- *
- *
{@link #BlueLib(IEventBus)} - Constructs the {@link BlueLib} instance and registers the mod event bus.
- *
{@link #onLoadComplete(FMLLoadCompleteEvent)} - Handles the event when the mod loading is complete and prints a thank-you message if in developer mode.
- *
{@link #isDeveloperMode()} - Determines if the mod is running in developer mode.
- *
- *
- *
- * @see BlueLib Wiki
- * @author MeAlam, Dan
- * @Co-author All Contributors of BlueLib!
- * @since 1.0.0
- */
-@Mod(BlueLib.MODID)
-public class BlueLib {
-
- /**
- * A {@link ScheduledExecutorService} used for scheduling tasks, such as printing messages after a delay.
- *
- * This is initialized with a single-threaded pool to handle delayed tasks in a separate thread.
- *
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
-
- /**
- * The Mod ID for {@link BlueLib}. This serves as a unique identifier for the mod.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- public static final String MODID = "bluelib";
-
- // public static final Logger LOGGER = LogUtils.getLogger();
-
- /**
- * Constructs a new {@link BlueLib} instance and registers the mod event bus.
- *
- * @param pModEventBus {@link IEventBus} - The event bus to which the mod will register its event handlers.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public BlueLib(IEventBus pModEventBus) {
- pModEventBus.register(this);
- if (isDeveloperMode()) {
- ModEntities.REGISTRY.register(pModEventBus);
-
- pModEventBus.addListener(ClientEvents::registerAttributes);
- pModEventBus.addListener(ClientEvents::registerRenderers);
- }
- }
-
- /**
- * Handles the {@link FMLLoadCompleteEvent}, which is triggered when the mod loading process is complete.
- *
- * If the mod is running in developer mode, it schedules a task to print a thank-you message to the console after a short delay.
- *
- *
- * @param pEvent {@link FMLLoadCompleteEvent} - The event triggered upon the completion of the mod loading process.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- @SubscribeEvent
- public void onLoadComplete(FMLLoadCompleteEvent pEvent) {
- if (isDeveloperMode()) {
- scheduler.schedule(() -> {
- System.out.println("""
-
- **************************************************
- * *
- * Thank you for using BlueLib! *
- * We appreciate your support. *
- * *
- **************************************************
- """);
- scheduler.shutdown();
- }, 3, TimeUnit.SECONDS);
- }
- }
-
- /**
- * Checks if the mod is running in developer mode.
- *
- * Developer mode is determined by checking if the mod is not running in a production environment.
- *
- *
- * @return {@code true} if the mod is running in developer mode, {@code false} otherwise.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- static boolean isDeveloperMode() {
- return !FMLEnvironment.production;
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/entity/variant/VariantLoader.java b/NeoForge/src/main/java/software/bluelib/entity/variant/VariantLoader.java
deleted file mode 100644
index 3dc0034b..00000000
--- a/NeoForge/src/main/java/software/bluelib/entity/variant/VariantLoader.java
+++ /dev/null
@@ -1,169 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.entity.variant;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.server.MinecraftServer;
-import net.minecraft.server.packs.resources.ResourceManager;
-import software.bluelib.interfaces.variant.base.IVariantEntityBase;
-import software.bluelib.json.JSONLoader;
-import software.bluelib.json.JSONMerger;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * A {@link VariantLoader} class that loads and manages {@link VariantParameter} for entities by merging JSON data from multiple sources.
- *
- * Key Methods:
- *
- *
{@link #loadVariants(ResourceLocation, ResourceLocation, MinecraftServer, String)} - Loads and merges variant data from both the main mod and the latest datapack.
- *
{@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 {
-
- /**
- * A {@link Map} to store loaded {@link VariantParameter} for each entity type.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private static final Map> entityVariantsMap = new HashMap<>();
-
- /**
- * A {@link JSONLoader} instance to load JSON data.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private static final JSONLoader jsonLoader = new JSONLoader();
-
- /**
- * A {@link JSONMerger} instance to merge JSON data.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private static final JSONMerger jsonMerger = new JSONMerger();
-
- /**
- * A {@code void} method that loads and merges variant data from both the Main Mod and the Latest Datapack.
- * Parses the merged data into {@link VariantParameter}.
- *
- * @param pJSONLocationMod {@link ResourceLocation} - The {@link ResourceLocation} of the Mod's JSON data.
- * @param pJSONLocationData {@link ResourceLocation} - The {@link ResourceLocation} of the Latest DataPack's JSON data.
- * @param pServer {@link MinecraftServer} - The {@link MinecraftServer} instance.
- * @param pEntityName {@link String} - The name of the entity whose variants should be cleared before loading new ones.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public static void loadVariants(ResourceLocation pJSONLocationMod, ResourceLocation pJSONLocationData, MinecraftServer pServer, String pEntityName) {
- clearVariantsForEntity(pEntityName);
- ResourceManager resourceManager = pServer.getResourceManager();
- JsonObject mergedJsonObject = new JsonObject();
-
- JsonObject modJson = jsonLoader.loadJson(pJSONLocationMod, resourceManager);
- JsonObject dataJson = jsonLoader.loadJson(pJSONLocationData, resourceManager);
-
- jsonMerger.mergeJsonObjects(mergedJsonObject, modJson);
- jsonMerger.mergeJsonObjects(mergedJsonObject, dataJson);
-
- parseVariants(mergedJsonObject);
- }
-
- /**
- * A {@code void} method that clears variants for a specific entity type from the map.
- *
- * @param pEntityName {@link String} - The name of the entity whose variants should be cleared.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- private static void clearVariantsForEntity(String pEntityName) {
- entityVariantsMap.remove(pEntityName);
- }
-
- /**
- * A {@code void} method that parses the merged JSON data and converts it into {@link VariantParameter} instances.
- *
- * @param pJsonObject {@link JsonObject} - The merged {@link JsonObject} containing variant data.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- private static void parseVariants(JsonObject pJsonObject) {
- for (Map.Entry entry : pJsonObject.entrySet()) {
- String entityName = entry.getKey();
- JsonArray textureArray = entry.getValue().getAsJsonArray();
-
- List variantList = entityVariantsMap.computeIfAbsent(entityName, k -> new ArrayList<>());
-
- for (JsonElement variant : textureArray) {
- VariantParameter newVariant = getEntityVariant(entityName, variant.getAsJsonObject());
-
- boolean variantExists = variantList.stream()
- .anyMatch(v -> v.equals(newVariant));
-
- if (!variantExists) {
- variantList.add(newVariant);
- }
- }
- }
- }
-
- /**
- * A {@link VariantParameter} method that creates a new {@link VariantParameter} instance from a JSON object.
- *
- * @param pJsonKey {@link String} - The key associated with this variant.
- * @param pJsonObject {@link JsonObject} - The {@link JsonObject} containing the variant data.
- * @return A {@link VariantParameter} instance.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- private static VariantParameter getEntityVariant(String pJsonKey, JsonObject pJsonObject) {
- return new VariantParameter(pJsonKey, pJsonObject);
- }
-
- /**
- * A {@link List} method that retrieves the {@link List} of loaded {@link VariantParameter}
- * for a specific entity.
- *
- * @param pEntityName {@link String} - The name of the entity to retrieve variants for.
- * @return A {@link List} of {@link VariantParameter} instances for the specified entity.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public static List getVariantsFromEntity(String pEntityName) {
- return entityVariantsMap.getOrDefault(pEntityName, new ArrayList<>());
- }
-
- /**
- * A {@link VariantParameter} method that retrieves a {@link VariantParameter} by its name for a specific entity.
- *
- * @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 The {@link VariantParameter} with the specified name, or {@code null} if not found.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public static VariantParameter getVariantByName(String pEntityName, String pVariantName) {
- List variants = getVariantsFromEntity(pEntityName);
- for (VariantParameter variant : variants) {
- if (variant.getVariantName().equals(pVariantName)) {
- return variant;
- }
- }
- return null;
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/entity/variant/VariantParameter.java b/NeoForge/src/main/java/software/bluelib/entity/variant/VariantParameter.java
deleted file mode 100644
index db3d3319..00000000
--- a/NeoForge/src/main/java/software/bluelib/entity/variant/VariantParameter.java
+++ /dev/null
@@ -1,131 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.entity.variant;
-
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-import software.bluelib.entity.variant.base.ParameterBase;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * A {@code VariantParameter} class that represents the parameters associated with a specific variant of an entity.
- *
- * This class extends {@link ParameterBase} to store and manage variant-specific parameters parsed from a JSON object.
- *
- * The class is designed to handle various JSON element types, including {@code JsonPrimitive}, {@code JsonArray}, and {@code JsonObject}.
- *
- * Key Methods:
- *
- *
{@link #getJsonKey()} - Retrieves the key of the JSON object that identifies this entity.
- *
{@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 {
-
- /**
- * A {@link String} that represents the key of the JSON object that identifies this entity.
- *
- * This key is used to map the entity to its corresponding parameters within a {@link JsonObject}.
- *
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private final String jsonKey;
-
- /**
- * Constructs a new {@code VariantParameter} instance by extracting parameters from a given JSON object.
- *
- * This constructor processes different types of {@link JsonElement} values:
- *
- *
{@code JsonPrimitive}: Stored directly as a string.
- *
{@code JsonArray}: Converts array elements into a single comma-separated string.
- *
{@code JsonObject}: Converts the nested JSON object to a string representation.
- *
{@code Other Types}: Stores "null" for unhandled JSON types.
- *
- *
- * @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 null.
- * @see ParameterBase
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public VariantParameter(String pJsonKey, JsonObject pJsonObject) {
- if (pJsonKey == null || pJsonObject == null) {
- throw new IllegalArgumentException("JSON key and object must not be null");
- }
- this.jsonKey = pJsonKey;
- Set> entryMap = pJsonObject.entrySet();
- for (Map.Entry entry : entryMap) {
- JsonElement element = entry.getValue();
- if (element.isJsonPrimitive()) {
- addParameter(entry.getKey(), element.getAsString());
- } else if (element.isJsonArray()) {
- StringBuilder arrayValues = new StringBuilder();
- element.getAsJsonArray().forEach(e -> arrayValues.append(e.getAsString()).append(","));
- if (!arrayValues.isEmpty()) {
- arrayValues.setLength(arrayValues.length() - 1);
- }
- addParameter(entry.getKey(), arrayValues.toString());
- } else if (element.isJsonObject()) {
- addParameter(entry.getKey(), element.toString());
- } else {
- addParameter(entry.getKey(), "null");
- }
- }
- }
-
- /**
- * A {@link String} method that returns the key of the {@link JsonObject} that identifies this entity.
- *
- * This key is typically 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 null.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public String getJsonKey() {
- if (this.jsonKey == null) {
- throw new IllegalStateException("JSON key should not be null");
- }
- return this.jsonKey;
- }
-
- /**
- * A {@link String} method that retrieves the name of the variant.
- *
- * 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() {
- return getParameter("variantName");
- }
-
- /**
- * A {@link String} method that retrieves the value of a specific parameter by its key.
- *
- * 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) {
- return (String) super.getParameter(pKey);
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/entity/variant/base/ParameterBase.java b/NeoForge/src/main/java/software/bluelib/entity/variant/base/ParameterBase.java
deleted file mode 100644
index 2f1af3a1..00000000
--- a/NeoForge/src/main/java/software/bluelib/entity/variant/base/ParameterBase.java
+++ /dev/null
@@ -1,179 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.entity.variant.base;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * An {@code Abstract base class} for managing a collection of parameters.
- *
- * Key Methods:
- *
- *
{@link #addParameter(String, Object)} - Adds a parameter to the collection.
- *
{@link #getParameter(String)} - Retrieves a parameter from the collection.
- *
{@link #removeParameter(String)} - Removes a parameter from the collection.
- *
{@link #getAllParameters()} - Returns all parameters in the collection.
- *
{@link #containsParameter(String)} - Checks if a parameter exists by its key.
- *
{@link #isEmpty()} - Checks if the collection of parameters is empty.
- *
{@link #clearParameters()} - Clears all parameters from the collection.
- *
{@link #getParameterCount()} - Returns the number of parameters in the collection.
- *
{@link #getParameterKeys()} - Returns a set of all parameter keys.
- *
{@link #getParameterValues()} - Returns a collection of all parameter values.
- *
{@link #updateParameter(String, Object)} - Updates the value of an existing parameter.
- *
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
-public abstract class ParameterBase {
-
- /**
- * A {@link Map} to store parameters as key-value pairs.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private final Map parameters = new HashMap<>();
-
- /**
- * A {@code void} method to add a parameter to the collection.
- *
- * @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) {
- parameters.put(pKey, pValue);
- }
-
- /**
- * An {@link Object} method to retrieve a parameter from the collection by its key.
- *
- * @param pKey {@link String} - The key of the parameter to retrieve.
- * @return 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) {
- return parameters.get(pKey);
- }
-
- /**
- * A {@code Void} that removes a parameter from the collection by its key.
- *
- * @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) {
- parameters.remove(pKey);
- }
-
- /**
- * A {@link Map
- * @see VariantLoader
- * @see MinecraftServer
- * @see ResourceLocation
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
-public class ReloadEventHandler {
-
- /**
- * A {@code void} method that registers entity variants from specified locations.
- *
- * This method attempts to load variants from both mod and datapack locations, providing status information
- * and handling any exceptions that occur during the loading process.
- *
- *
- * Parameters:
- *
- *
{@code pServer} - The server instance of the current world.
- *
{@code pEntityName} - The entity name to load.
- *
{@code pModID} - The mod ID used to locate the entity variant resources. (Use your Mod's ID)
- *
{@code pModPathLocation} - The path location within the mod where variants are stored.
- *
{@code pDataPathLocation} - The path location within the resource pack where variants are stored.
- *
- *
- *
- * Exception Handling:
- *
- *
{@code JsonParseException} - Thrown when there is an error parsing the JSON files.
- *
{@code RuntimeException} - Thrown for unexpected errors during the registration process.
- *
- *
- * @param pServer {@link MinecraftServer} - The server instance of the current world.
- * @param pEntityName {@link String} - The entity name to load.
- * @param pModID {@link String} - The mod ID used to locate the entity variant resources. (Use your Mod's ID)
- * @param pModPathLocation {@link String} - The path location within the mod where variants are stored.
- * @param pDataPathLocation {@link String} - The path location within the datapack where variants are stored.
- * @throws JsonParseException if there is an error parsing the JSON files.
- * @throws RuntimeException if an unexpected error occurs during the registration process.
- * @see MinecraftServer
- * @see ResourceLocation
- * @see VariantLoader
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- protected static void registerEntityVariants(MinecraftServer pServer, String pEntityName, String pModID, String pModPathLocation, String pDataPathLocation) {
- ResourceLocation modLocation = new ResourceLocation(pModID, pModPathLocation);
- ResourceLocation dataLocation = new ResourceLocation(pModID, pDataPathLocation);
- try {
- VariantLoader.loadVariants(modLocation, dataLocation, pServer, pEntityName);
- } catch (JsonParseException pException) {
- throw new RuntimeException("Failed to parse JSON(s) while registering entity variants for " + pEntityName + " from Mod with ModID: " + pModID, pException);
- } catch (Exception pException) {
- throw new RuntimeException("Unexpected error occurred while registering entity variants for " + pEntityName + " from Mod with ModID: " + pModID, pException);
- }
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/example/entity/dragon/DragonEntity.java b/NeoForge/src/main/java/software/bluelib/example/entity/dragon/DragonEntity.java
deleted file mode 100644
index 00e15560..00000000
--- a/NeoForge/src/main/java/software/bluelib/example/entity/dragon/DragonEntity.java
+++ /dev/null
@@ -1,220 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.example.entity.dragon;
-
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.network.syncher.EntityDataAccessor;
-import net.minecraft.network.syncher.EntityDataSerializers;
-import net.minecraft.network.syncher.SynchedEntityData;
-import net.minecraft.server.level.ServerLevel;
-import net.minecraft.world.DifficultyInstance;
-import net.minecraft.world.entity.*;
-import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
-import net.minecraft.world.entity.ai.attributes.Attributes;
-import net.minecraft.world.level.Level;
-import net.minecraft.world.level.ServerLevelAccessor;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import software.bernie.geckolib.animatable.GeoEntity;
-import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
-import software.bernie.geckolib.core.animation.AnimatableManager;
-import software.bernie.geckolib.util.GeckoLibUtil;
-import software.bluelib.interfaces.variant.IVariantEntity;
-import software.bluelib.utils.ParameterUtils;
-
-/**
- * A {@code DragonEntity} class representing a dragon entity in the game, which extends {@link TamableAnimal}
- * and implements {@link IVariantEntity} and {@link GeoEntity}.
- *
- * This class manages the dragon's variant system, its data synchronization, and integrates with the GeckoLib
- * animation system.
- *
- *
- *
- * Key Methods:
- *
- *
{@link #defineSynchedData()} - Defines the synchronized data for the dragon entity, including its variant.
- *
{@link #addAdditionalSaveData(CompoundTag)} - Adds custom data to the entity's NBT for saving.
- *
{@link #readAdditionalSaveData(CompoundTag)} - Reads custom data from the entity's NBT for loading.
- *
{@link #finalizeSpawn(ServerLevelAccessor, DifficultyInstance, MobSpawnType, SpawnGroupData, CompoundTag)} - Finalizes the spawning process and sets up parameters.
- *
{@link #setVariantName(String)} - Sets the variant name of the dragon.
- *
{@link #getVariantName()} - Retrieves the current variant name of the dragon.
- *
- *
- *
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
-public class DragonEntity extends TamableAnimal implements IVariantEntity, GeoEntity {
- /**
- * Entity data accessor for the variant of the dragon.
- *
- * This is used to store and retrieve the variant data for synchronization between server and client.
- *
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- public static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(DragonEntity.class, EntityDataSerializers.STRING);
-
- /**
- * The name of the entity.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- protected final String entityName = "dragon";
-
- /**
- * Constructs a new {@link DragonEntity} instance with the specified entity type and level.
- *
- * @param pEntityType {@link EntityType} - The type of the entity.
- * @param pLevel {@link Level} - The level in which the entity is created.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- public DragonEntity(EntityType extends TamableAnimal> pEntityType, Level pLevel) {
- super(pEntityType, pLevel);
- }
-
- /**
- * Defines the synchronized data for this dragon entity, including the variant.
- *
- * This method initializes the {@link EntityDataAccessor} to handle the variant data.
- *
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @Override
- protected void defineSynchedData() {
- super.defineSynchedData();
- this.entityData.define(VARIANT, "normal");
- }
-
- /**
- * Adds custom data to the entity's NBT tag for saving.
- *
- * This method stores the variant name in the NBT data so it can be restored when loading the entity.
- *
- *
- * @param pCompound {@link CompoundTag} - The NBT tag to which data should be added.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @Override
- public void addAdditionalSaveData(@NotNull CompoundTag pCompound) {
- super.addAdditionalSaveData(pCompound);
- pCompound.putString("Variant", getVariantName());
- }
-
- /**
- * Reads custom data from the entity's NBT tag for loading.
- *
- * This method retrieves the variant name from the NBT data and sets it for the entity.
- *
- *
- * @param pCompound {@link CompoundTag} - The NBT tag from which data should be read.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @Override
- public void readAdditionalSaveData(@NotNull CompoundTag pCompound) {
- super.readAdditionalSaveData(pCompound);
- this.setVariantName(pCompound.getString("Variant"));
- }
-
- /**
- * Finalizes the spawning of the dragon entity.
- *
- * This method sets up the variant for the entity and connects parameters if needed.
- *
- *
- * @param pLevel {@link ServerLevelAccessor} - The level in which the entity is spawned.
- * @param pDifficulty {@link DifficultyInstance} - The difficulty instance for spawning.
- * @param pReason {@link MobSpawnType} - The reason for spawning the entity.
- * @param pSpawnData {@link SpawnGroupData} - Data related to the spawn.
- * @param pDataTag {@link CompoundTag} - Additional data for spawning.
- * @return {@link SpawnGroupData} - Updated spawn data.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @Override
- public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor pLevel, @NotNull DifficultyInstance pDifficulty, @NotNull MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
- if (getVariantName() == null || getVariantName().isEmpty()) {
- this.setVariantName(getRandomVariant(getEntityVariants(entityName), "normal"));
- ParameterUtils.ParameterBuilder.forVariant(entityName,this.getVariantName())
- .withParameter("customParameter")
- .withParameter("int")
- .withParameter("bool")
- .withParameter("array")
- .connect();
- }
- return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
- }
-
- /**
- * Sets the variant name for the dragon entity.
- *
- * @param pName {@link String} - The name of the variant to set.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- public void setVariantName(String pName) {
- this.entityData.set(VARIANT, pName);
- }
-
- /**
- * Retrieves the current variant name of the dragon entity.
- *
- * @return {@link String} - The current variant name.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- public String getVariantName() {
- return this.entityData.get(VARIANT);
- }
-
- /**
- * All Code below this Fragment is not Library Related!!!
- */
-
- private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
-
- public static AttributeSupplier.Builder createAttributes() {
- return Mob.createMobAttributes()
- .add(Attributes.MOVEMENT_SPEED, 0.3)
- .add(Attributes.MAX_HEALTH, 10)
- .add(Attributes.ARMOR, 0)
- .add(Attributes.ATTACK_DAMAGE, 3)
- .add(Attributes.FOLLOW_RANGE, 16)
- .add(Attributes.FLYING_SPEED, 0.3);
- }
-
- @Override
- public void registerControllers(AnimatableManager.ControllerRegistrar pControllerRegistrar) {
- }
-
- @Override
- public AnimatableInstanceCache getAnimatableInstanceCache() {
- return cache;
- }
-
- @Nullable
- @Override
- public AgeableMob getBreedOffspring(@NotNull ServerLevel pLevel, @NotNull AgeableMob pOtherParent) {
- return null;
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/example/entity/dragon/DragonModel.java b/NeoForge/src/main/java/software/bluelib/example/entity/dragon/DragonModel.java
deleted file mode 100644
index 67091901..00000000
--- a/NeoForge/src/main/java/software/bluelib/example/entity/dragon/DragonModel.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.example.entity.dragon;
-
-import net.minecraft.resources.ResourceLocation;
-import software.bernie.geckolib.model.GeoModel;
-import software.bluelib.BlueLib;
-
-public class DragonModel extends GeoModel {
-
-
- // Get the Model Location
- @Override
- public ResourceLocation getModelResource(DragonEntity pObject) {
- return new ResourceLocation(BlueLib.MODID, "geo/dragon.geo.json");
- }
-
- // Get the Texture Location
- @Override
- public ResourceLocation getTextureResource(DragonEntity pObject) {
- return pObject.getTextureLocation(BlueLib.MODID, "textures/entity/" + pObject.entityName + "/" + pObject.getVariantName() + ".png");
- }
-
- // Get the Animation Location
- @Override
- public ResourceLocation getAnimationResource(DragonEntity pAnimatable) {
- return new ResourceLocation(BlueLib.MODID, "animations/dragon.animation.json");
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/example/entity/dragon/DragonRender.java b/NeoForge/src/main/java/software/bluelib/example/entity/dragon/DragonRender.java
deleted file mode 100644
index c770ac48..00000000
--- a/NeoForge/src/main/java/software/bluelib/example/entity/dragon/DragonRender.java
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.example.entity.dragon;
-
-import net.minecraft.client.renderer.entity.EntityRendererProvider;
-import software.bernie.geckolib.renderer.GeoEntityRenderer;
-
-public class DragonRender extends GeoEntityRenderer {
-
- // Render the entity
- public DragonRender(EntityRendererProvider.Context pRenderManager) {
- super(pRenderManager, new DragonModel());
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java b/NeoForge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java
deleted file mode 100644
index fcb85a52..00000000
--- a/NeoForge/src/main/java/software/bluelib/example/entity/rex/RexEntity.java
+++ /dev/null
@@ -1,220 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.example.entity.rex;
-
-import net.minecraft.nbt.CompoundTag;
-import net.minecraft.network.syncher.EntityDataAccessor;
-import net.minecraft.network.syncher.EntityDataSerializers;
-import net.minecraft.network.syncher.SynchedEntityData;
-import net.minecraft.server.level.ServerLevel;
-import net.minecraft.world.DifficultyInstance;
-import net.minecraft.world.entity.*;
-import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
-import net.minecraft.world.entity.ai.attributes.Attributes;
-import net.minecraft.world.level.Level;
-import net.minecraft.world.level.ServerLevelAccessor;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import software.bernie.geckolib.animatable.GeoEntity;
-import software.bernie.geckolib.core.animatable.instance.AnimatableInstanceCache;
-import software.bernie.geckolib.core.animation.AnimatableManager;
-import software.bernie.geckolib.util.GeckoLibUtil;
-import software.bluelib.interfaces.variant.IVariantEntity;
-import software.bluelib.utils.ParameterUtils;
-
-/**
- * A {@code RexEntity} class representing a Rex entity in the game, which extends {@link TamableAnimal}
- * and implements {@link IVariantEntity} and {@link GeoEntity}.
- *
- * This class manages the rex's variant system, its data synchronization, and integrates with the GeckoLib
- * animation system.
- *
- *
- *
- * Key Methods:
- *
- *
{@link #defineSynchedData()} - Defines the synchronized data for the rex entity, including its variant.
- *
{@link #addAdditionalSaveData(CompoundTag)} - Adds custom data to the entity's NBT for saving.
- *
{@link #readAdditionalSaveData(CompoundTag)} - Reads custom data from the entity's NBT for loading.
- *
{@link #finalizeSpawn(ServerLevelAccessor, DifficultyInstance, MobSpawnType, SpawnGroupData, CompoundTag)} - Finalizes the spawning process and sets up parameters.
- *
{@link #setVariantName(String)} - Sets the variant name of the rex.
- *
{@link #getVariantName()} - Retrieves the current variant name of the rex.
- *
- *
- *
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
-public class RexEntity extends TamableAnimal implements IVariantEntity, GeoEntity {
- /**
- * Entity data accessor for the variant of the rex.
- *
- * This is used to store and retrieve the variant data for synchronization between server and client.
- *
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- public static final EntityDataAccessor VARIANT = SynchedEntityData.defineId(RexEntity.class, EntityDataSerializers.STRING);
-
- /**
- * The name of the entity.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- protected final String entityName = "rex";
-
- /**
- * Constructs a new {@link RexEntity} instance with the specified entity type and level.
- *
- * @param pEntityType {@link EntityType} - The type of the entity.
- * @param pLevel {@link Level} - The level in which the entity is created.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- public RexEntity(EntityType extends TamableAnimal> pEntityType, Level pLevel) {
- super(pEntityType, pLevel);
- }
-
- /**
- * Defines the synchronized data for this rex entity, including the variant.
- *
- * This method initializes the {@link EntityDataAccessor} to handle the variant data.
- *
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @Override
- protected void defineSynchedData() {
- super.defineSynchedData();
- this.entityData.define(VARIANT, "normal");
- }
-
- /**
- * Adds custom data to the entity's NBT tag for saving.
- *
- * This method stores the variant name in the NBT data so it can be restored when loading the entity.
- *
- *
- * @param pCompound {@link CompoundTag} - The NBT tag to which data should be added.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @Override
- public void addAdditionalSaveData(@NotNull CompoundTag pCompound) {
- super.addAdditionalSaveData(pCompound);
- pCompound.putString("Variant", getVariantName());
- }
-
- /**
- * Reads custom data from the entity's NBT tag for loading.
- *
- * This method retrieves the variant name from the NBT data and sets it for the entity.
- *
- *
- * @param pCompound {@link CompoundTag} - The NBT tag from which data should be read.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @Override
- public void readAdditionalSaveData(@NotNull CompoundTag pCompound) {
- super.readAdditionalSaveData(pCompound);
- this.setVariantName(pCompound.getString("Variant"));
- }
-
- /**
- * Finalizes the spawning of the rex entity.
- *
- * This method sets up the variant for the entity and connects parameters if needed.
- *
- *
- * @param pLevel {@link ServerLevelAccessor} - The level in which the entity is spawned.
- * @param pDifficulty {@link DifficultyInstance} - The difficulty instance for spawning.
- * @param pReason {@link MobSpawnType} - The reason for spawning the entity.
- * @param pSpawnData {@link SpawnGroupData} - Data related to the spawn.
- * @param pDataTag {@link CompoundTag} - Additional data for spawning.
- * @return {@link SpawnGroupData} - Updated spawn data.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @Override
- public SpawnGroupData finalizeSpawn(@NotNull ServerLevelAccessor pLevel, @NotNull DifficultyInstance pDifficulty, @NotNull MobSpawnType pReason, @Nullable SpawnGroupData pSpawnData, @Nullable CompoundTag pDataTag) {
- if (getVariantName() == null || getVariantName().isEmpty()) {
- this.setVariantName(getRandomVariant(getEntityVariants(entityName), "normal"));
- ParameterUtils.ParameterBuilder.forVariant(entityName,this.getVariantName())
- .withParameter("customParameter")
- .withParameter("int")
- .withParameter("bool")
- .withParameter("array")
- .connect();
- }
- return super.finalizeSpawn(pLevel, pDifficulty, pReason, pSpawnData, pDataTag);
- }
-
- /**
- * Sets the variant name for the rex entity.
- *
- * @param pName {@link String} - The name of the variant to set.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- public void setVariantName(String pName) {
- this.entityData.set(VARIANT, pName);
- }
-
- /**
- * Retrieves the current variant name of the rex entity.
- *
- * @return {@link String} - The current variant name.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- public String getVariantName() {
- return this.entityData.get(VARIANT);
- }
-
- /**
- * All Code below this Fragment is not Library Related!!!
- */
-
- private final AnimatableInstanceCache cache = GeckoLibUtil.createInstanceCache(this);
-
- public static AttributeSupplier.Builder createAttributes() {
- return Mob.createMobAttributes()
- .add(Attributes.MOVEMENT_SPEED, 0.3)
- .add(Attributes.MAX_HEALTH, 10)
- .add(Attributes.ARMOR, 0)
- .add(Attributes.ATTACK_DAMAGE, 3)
- .add(Attributes.FOLLOW_RANGE, 16)
- .add(Attributes.FLYING_SPEED, 0.3);
- }
-
- @Override
- public void registerControllers(AnimatableManager.ControllerRegistrar pControllerRegistrar) {
- }
-
- @Override
- public AnimatableInstanceCache getAnimatableInstanceCache() {
- return cache;
- }
-
- @Nullable
- @Override
- public AgeableMob getBreedOffspring(@NotNull ServerLevel pLevel, @NotNull AgeableMob pOtherParent) {
- return null;
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/example/entity/rex/RexModel.java b/NeoForge/src/main/java/software/bluelib/example/entity/rex/RexModel.java
deleted file mode 100644
index 6084892c..00000000
--- a/NeoForge/src/main/java/software/bluelib/example/entity/rex/RexModel.java
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.example.entity.rex;
-
-import net.minecraft.resources.ResourceLocation;
-import software.bernie.geckolib.model.GeoModel;
-import software.bluelib.BlueLib;
-
-public class RexModel extends GeoModel {
-
-
- // Get the Model Location
- @Override
- public ResourceLocation getModelResource(RexEntity pObject) {
- return new ResourceLocation(BlueLib.MODID, "geo/rex.geo.json");
- }
-
- // Get the Texture Location
- @Override
- public ResourceLocation getTextureResource(RexEntity pObject) {
- return pObject.getTextureLocation(BlueLib.MODID, "textures/entity/" + pObject.entityName + "/" + pObject.getVariantName() + ".png");
- }
-
- // Get the Animation Location
- @Override
- public ResourceLocation getAnimationResource(RexEntity pAnimatable) {
- return new ResourceLocation(BlueLib.MODID, "animations/rex.animation.json");
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/example/entity/rex/RexRender.java b/NeoForge/src/main/java/software/bluelib/example/entity/rex/RexRender.java
deleted file mode 100644
index 776c5920..00000000
--- a/NeoForge/src/main/java/software/bluelib/example/entity/rex/RexRender.java
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.example.entity.rex;
-
-import net.minecraft.client.renderer.entity.EntityRendererProvider;
-import software.bernie.geckolib.renderer.GeoEntityRenderer;
-
-public class RexRender extends GeoEntityRenderer {
-
- // Render the entity
- public RexRender(EntityRendererProvider.Context pRenderManager) {
- super(pRenderManager, new RexModel());
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/example/event/ClientEvents.java b/NeoForge/src/main/java/software/bluelib/example/event/ClientEvents.java
deleted file mode 100644
index 8d3a63de..00000000
--- a/NeoForge/src/main/java/software/bluelib/example/event/ClientEvents.java
+++ /dev/null
@@ -1,28 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.example.event;
-
-import net.neoforged.bus.api.SubscribeEvent;
-import net.neoforged.neoforge.client.event.EntityRenderersEvent;
-import net.neoforged.neoforge.event.entity.EntityAttributeCreationEvent;
-import software.bluelib.example.entity.dragon.DragonEntity;
-import software.bluelib.example.entity.dragon.DragonRender;
-import software.bluelib.example.entity.rex.RexEntity;
-import software.bluelib.example.entity.rex.RexRender;
-import software.bluelib.example.init.ModEntities;
-
-public class ClientEvents {
- @SubscribeEvent
- public static void registerRenderers(final EntityRenderersEvent.RegisterRenderers pEvent) {
- // Register the renderer for all the Entities
- pEvent.registerEntityRenderer(ModEntities.DRAGON.get(), DragonRender::new);
- pEvent.registerEntityRenderer(ModEntities.REX.get(), RexRender::new);
- }
-
- // Register the Attributes
- @SubscribeEvent
- public static void registerAttributes(EntityAttributeCreationEvent pEvent) {
- pEvent.put(ModEntities.DRAGON.get(), DragonEntity.createAttributes().build());
- pEvent.put(ModEntities.REX.get(), RexEntity.createAttributes().build());
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/example/event/ReloadHandler.java b/NeoForge/src/main/java/software/bluelib/example/event/ReloadHandler.java
deleted file mode 100644
index 5c6bacca..00000000
--- a/NeoForge/src/main/java/software/bluelib/example/event/ReloadHandler.java
+++ /dev/null
@@ -1,142 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.example.event;
-
-import net.minecraft.server.MinecraftServer;
-import net.neoforged.bus.api.SubscribeEvent;
-import net.neoforged.fml.common.Mod;
-import net.neoforged.neoforge.event.AddReloadListenerEvent;
-import net.neoforged.neoforge.event.server.ServerStartingEvent;
-import software.bluelib.BlueLib;
-import software.bluelib.event.ReloadEventHandler;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-/**
- * A {@code ReloadHandler} class that handles server start and reload events related to entity variants.
- *
- * This class extends {@link ReloadEventHandler} and implements event handling for server starting and reloading,
- * ensuring that entity variant data is properly loaded and refreshed.
- *
- *
- *
- * Key Methods:
- *
- *
{@link #onServerStart(ServerStartingEvent)} - Handles server starting events to initialize entity variants.
- *
{@link #onReload(AddReloadListenerEvent)} - Handles reload events to refresh entity variants.
- *
{@link #LoadEntityVariants(MinecraftServer)} - Loads entity variants from JSON files into the server.
- *
- *
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
-@Mod.EventBusSubscriber
-public class ReloadHandler extends ReloadEventHandler {
-
- /**
- * The {@link MinecraftServer} instance for the server handling the events.
- *
- * This is initialized when the server starts and used to load entity variants.
- *
- *
- * @since 1.0.0
- * @Co-author MeAlam, Dan
- */
- private static MinecraftServer server;
-
- /**
- * Handles the server starting event to initialize the {@link MinecraftServer} instance
- * and load entity variants.
- *
- * @param pEvent {@link ServerStartingEvent} - The event triggered when the server starts.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @SubscribeEvent
- public static void onServerStart(ServerStartingEvent pEvent) {
- server = pEvent.getServer();
- ReloadHandler.LoadEntityVariants(server);
- }
-
- /**
- * The {@link ScheduledExecutorService} used to schedule tasks for reloading entity variants.
- *
- * @since 1.0.0
- * @Co-author MeAlam, Dan
- */
- private static final ScheduledExecutorService scheduler = Executors.newScheduledThreadPool(1);
-
- /**
- * Handles the reload event by scheduling a task to reload entity variants.
- *
- * This method schedules the {@code LoadEntityVariants} method to run after a short delay.
- *
- *
- * @param pEvent {@link AddReloadListenerEvent} - The event triggered when a reload occurs.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- @SubscribeEvent
- public static void onReload(AddReloadListenerEvent pEvent) {
- if (server != null) {
- scheduler.schedule(() -> {
- server.execute(() -> {
- ReloadHandler.LoadEntityVariants(server);
- });
- }, 1, TimeUnit.SECONDS);
- }
- }
-
- /**
- * The base path for entity variant JSON files.
- *
- * This path is used to locate the files that contain variant data for entities.
- *
- *
- * @since 1.0.0
- * @Co-author MeAlam, Dan
- */
- private static final String basePath = "variant/entity/";
-
- /**
- * A {@link List} of entity names for which variants will be loaded.
- *
- * This list defines which entities will have their variants loaded from JSON files.
- *
- *
- * @since 1.0.0
- * @Co-author MeAlam, Dan
- */
- private static final List entityNames = Arrays.asList("dragon", "rex");
-
- /**
- * Loads entity variants from JSON files into the {@link MinecraftServer}.
- *
- * This method iterates through the list of entity names, constructs file paths, and registers
- * entity variants using the {@link ReloadEventHandler}.
- *
- *
- * @param pServer {@link MinecraftServer} - The server on which the entity variants will be loaded.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- public static void LoadEntityVariants(MinecraftServer pServer) {
- for (String entityName : entityNames) {
- String modPath = basePath + entityName + ".json";
- String dataPath = basePath + entityName + "data.json";
- ReloadEventHandler.registerEntityVariants(pServer, entityName, BlueLib.MODID, modPath, dataPath);
- }
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/example/init/ModEntities.java b/NeoForge/src/main/java/software/bluelib/example/init/ModEntities.java
deleted file mode 100644
index a1e80d1d..00000000
--- a/NeoForge/src/main/java/software/bluelib/example/init/ModEntities.java
+++ /dev/null
@@ -1,40 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.example.init;
-
-import net.minecraft.core.registries.Registries;
-import net.minecraft.world.entity.Entity;
-import net.minecraft.world.entity.EntityType;
-import net.minecraft.world.entity.MobCategory;
-import net.neoforged.neoforge.registries.DeferredHolder;
-import net.neoforged.neoforge.registries.DeferredRegister;
-import software.bluelib.BlueLib;
-import software.bluelib.example.entity.dragon.DragonEntity;
-import software.bluelib.example.entity.rex.RexEntity;
-
-public class ModEntities {
- public static final DeferredRegister> REGISTRY = DeferredRegister.create(Registries.ENTITY_TYPE, BlueLib.MODID);
-
- // List of Entities
- public static final DeferredHolder, EntityType> DRAGON = register(
- "example_one",
- EntityType.Builder.of(DragonEntity::new, MobCategory.AMBIENT)
- .setShouldReceiveVelocityUpdates(true)
- .setTrackingRange(64)
- .setUpdateInterval(3)
- .fireImmune()
- .sized(0.6f, 1.8f));
-
- public static final DeferredHolder, EntityType> REX = register(
- "example_two",
- EntityType.Builder.of(RexEntity::new, MobCategory.AMBIENT)
- .setShouldReceiveVelocityUpdates(true)
- .setTrackingRange(64)
- .setUpdateInterval(3)
- .fireImmune()
- .sized(0.6f, 1.8f));
-
- private static DeferredHolder, EntityType> register(String pRegistryName, EntityType.Builder pEntityTypeBuilder) {
- return REGISTRY.register(pRegistryName, () -> pEntityTypeBuilder.build(pRegistryName));
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/exception/CouldNotLoadJSON.java b/NeoForge/src/main/java/software/bluelib/exception/CouldNotLoadJSON.java
deleted file mode 100644
index c93d1015..00000000
--- a/NeoForge/src/main/java/software/bluelib/exception/CouldNotLoadJSON.java
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.exception;
-
-/**
- * A {@code RuntimeException} that represents an error when a JSON file could not be loaded.
- *
- * This exception provides additional context by including the {@link #getResourceId()} of the JSON file that failed to load.
- *
- *
- * Key Features:
- *
- *
{@link #getResourceId()} - Retrieves the ID of the resource that could not be loaded.
- *
- *
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
-public class CouldNotLoadJSON extends RuntimeException {
-
- /**
- * A {@link String} that represents the ID of the resource that could not be loaded.
- *
- * This ID is used to provide additional context for the error.
- *
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private final String resourceId;
-
- /**
- * Constructs a new {@code CouldNotLoadJSON} exception with the specified detail message and resource ID.
- *
- * The detail message provides information about the nature of the error, while the resource ID indicates
- * which specific resource could not be loaded.
- *
- *
- * @param pMessage {@link String} - The detail message explaining the reason for the exception.
- * @param pResourceId {@link String} - The ID of the resource that could not be loaded.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public CouldNotLoadJSON(String pMessage, String pResourceId) {
- super(pMessage);
- this.resourceId = pResourceId;
- }
-
- /**
- * A {@link String} that retrieves the resource ID of the JSON file that could not be loaded.
- *
- * This method provides access to the ID of the resource that caused the exception.
- *
- *
- * @return The resource ID as a {@link String}.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public String getResourceId() {
- return resourceId;
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/interfaces/variant/IVariantEntity.java b/NeoForge/src/main/java/software/bluelib/interfaces/variant/IVariantEntity.java
deleted file mode 100644
index a9bf1919..00000000
--- a/NeoForge/src/main/java/software/bluelib/interfaces/variant/IVariantEntity.java
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.interfaces.variant;
-
-import net.minecraft.util.RandomSource;
-import software.bluelib.interfaces.variant.base.IVariantEntityBase;
-
-import java.util.List;
-
-/**
- * An {@code Interface} representing an entity that supports multiple variants.
- *
- * This interface extends {@link IVariantEntityBase} to include methods specific to handling entity variants, including
- * random selection of variants.
- *
- *
- * Key Methods:
- *
- *
{@link #getRandomVariant(List, String)} - Retrieves a random variant name from a provided list or defaults if the list is empty.
- *
- *
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
-public interface IVariantEntity extends IVariantEntityBase {
-
- /**
- * A {@link RandomSource} instance used for generating random variants.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- RandomSource random = RandomSource.create();
-
- /**
- * A {@link String} that selects a random variant name from the provided list of variant names.
- *
- * This method uses the {@link RandomSource} to pick a random variant from the list. If the list is empty, the default
- * variant name is returned.
- *
- *
- * @param pVariantNamesList {@link List} - A {@link List} of variant names available for the entity.
- * @param pDefaultVariant {@link String} - The default variant name to return if {@code pVariantNamesList} is empty.
- * @return A random variant name from the list, or the default variant if the list is empty.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- default String getRandomVariant(List pVariantNamesList, String pDefaultVariant) {
- List spawnableVariants = pVariantNamesList.stream().toList();
- if (!spawnableVariants.isEmpty()) {
- return spawnableVariants.get(this.random.nextInt(spawnableVariants.size()));
- }
- return pDefaultVariant;
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/interfaces/variant/base/IVariantEntityBase.java b/NeoForge/src/main/java/software/bluelib/interfaces/variant/base/IVariantEntityBase.java
deleted file mode 100644
index 3b905d28..00000000
--- a/NeoForge/src/main/java/software/bluelib/interfaces/variant/base/IVariantEntityBase.java
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.interfaces.variant.base;
-
-import net.minecraft.resources.ResourceLocation;
-import software.bluelib.entity.variant.VariantLoader;
-import software.bluelib.entity.variant.VariantParameter;
-
-import java.util.List;
-import java.util.stream.Collectors;
-
-/**
- * A {@code base Interface} providing fundamental methods for handling entity variants.
- *
- * This interface defines methods for retrieving texture locations and variant names associated with entities.
- *
- *
- * Key Methods:
- *
- *
{@link #getTextureLocation(String, String)} - Retrieves the {@link ResourceLocation} for the entity texture.
- *
{@link #getEntityVariants(String)} - Retrieves a {@link List} of variant names for a specified entity.
- *
- *
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
-public interface IVariantEntityBase {
-
- /**
- * A {@link ResourceLocation} that points to the texture of an entity.
- *
- * This method constructs a {@link ResourceLocation} using the provided mod ID and texture path.
- *
- *
- * @param pModId {@link String} - The mod ID used to locate the texture.
- * @param pPath {@link String} - The path to the texture within the mod.
- * @return A {@link ResourceLocation} pointing to the specified texture.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- default ResourceLocation getTextureLocation(String pModId, String pPath) {
- return new ResourceLocation(pModId, pPath);
- }
-
- /**
- * A {@link List} of variant names associated with the specified entity.
- *
- * This method retrieves the names of all variants for a given entity by querying the {@link VariantLoader}.
- *
- *
- * @param pEntityName {@link String} - The name of the entity whose variant names are to be retrieved.
- * @return A {@link List} containing the names of variants associated with the specified entity.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- default List getEntityVariants(String pEntityName) {
- List variants = VariantLoader.getVariantsFromEntity(pEntityName);
- return variants.stream()
- .map(VariantParameter::getVariantName)
- .collect(Collectors.toList());
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/json/JSONLoader.java b/NeoForge/src/main/java/software/bluelib/json/JSONLoader.java
deleted file mode 100644
index f046903c..00000000
--- a/NeoForge/src/main/java/software/bluelib/json/JSONLoader.java
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.json;
-
-import com.google.gson.Gson;
-import com.google.gson.JsonObject;
-import net.minecraft.resources.ResourceLocation;
-import net.minecraft.server.packs.resources.Resource;
-import net.minecraft.server.packs.resources.ResourceManager;
-import software.bluelib.exception.CouldNotLoadJSON;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.nio.charset.StandardCharsets;
-import java.util.Optional;
-
-/**
- * The {@code JSONLoader} class is responsible for loading and parsing JSON data from
- * resources defined by {@link ResourceLocation} within a Minecraft mod environment.
- * It uses the {@link Gson} library to convert JSON strings into {@link JsonObject} instances.
- *
- * Key methods:
- *
- *
{@link #loadJson(ResourceLocation, ResourceManager)} - Loads a JSON resource.
- *
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
-public class JSONLoader {
-
- /**
- * A {@link Gson} instance for parsing JSON data.
- * @Co-author MeAlam, Dan
- */
- private static final Gson gson = new Gson();
-
- /**
- * A {@link JsonObject} that loads JSON data from a {@link ResourceLocation}.
- * This method is typically used to load configuration files or other JSON-based resources
- * in a Minecraft mod environment.
- *
- * @param pResourceLocation {@link ResourceLocation} - The {@link ResourceLocation} of the JSON resource.
- * @param pResourceManager {@link ResourceManager} - The {@link ResourceManager} to load the resource.
- * @return The loaded {@link JsonObject}.
- * @throws CouldNotLoadJSON If the JSON could not be loaded.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public JsonObject loadJson(ResourceLocation pResourceLocation, ResourceManager pResourceManager) throws CouldNotLoadJSON {
- try {
- Optional resource = pResourceManager.getResource(pResourceLocation);
-
- if (resource.isEmpty()) {
- return new JsonObject();
- }
-
- try (InputStream inputStream = resource.get().open();
- InputStreamReader reader = new InputStreamReader(inputStream, StandardCharsets.UTF_8)) {
-
- return gson.fromJson(reader, JsonObject.class);
- }
- } catch (IOException pException) {
- throw new CouldNotLoadJSON("Failed to load JSON from resource: " + pResourceLocation + ". Error: " + pException.getMessage(), pResourceLocation.toString());
- }
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/json/JSONMerger.java b/NeoForge/src/main/java/software/bluelib/json/JSONMerger.java
deleted file mode 100644
index 918ed2cf..00000000
--- a/NeoForge/src/main/java/software/bluelib/json/JSONMerger.java
+++ /dev/null
@@ -1,64 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.json;
-
-import com.google.gson.JsonArray;
-import com.google.gson.JsonElement;
-import com.google.gson.JsonObject;
-
-import java.util.Map;
-
-/**
- * A {@code Class} responsible for merging JSON data from a source {@link JsonObject} into a target {@link JsonObject}.
- *
- * This class provides functionality to combine JSON data where overlapping keys result in merging arrays,
- * and non-overlapping keys are simply added to the target.
- *
- *
- *
- * Key Methods:
- *
- *
{@link #mergeJsonObjects(JsonObject, JsonObject)} - Merges the data from the source JSON object into the target JSON object.
- *
- *
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
-public class JSONMerger {
-
- /**
- * Merges data from a source {@link JsonObject} into a target {@link JsonObject}.
- *
- * If the target JSON object already contains a key present in the source JSON object, the values are merged if they are arrays.
- * Otherwise, the source value is added to the target JSON object.
- *
- *
- * @param pTarget {@link JsonObject} - The target {@link JsonObject} to merge data into. This object will be modified by adding or updating its values.
- * @param pSource {@link JsonObject} - The source {@link JsonObject} to merge data from. This object is not modified by the operation.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public void mergeJsonObjects(JsonObject pTarget, JsonObject pSource) {
- for (Map.Entry entry : pSource.entrySet()) {
- if (pTarget.has(entry.getKey())) {
- JsonElement targetElement = pTarget.get(entry.getKey());
- JsonElement sourceElement = entry.getValue();
-
- if (targetElement.isJsonArray() && sourceElement.isJsonArray()) {
- JsonArray targetArray = targetElement.getAsJsonArray();
- JsonArray sourceArray = sourceElement.getAsJsonArray();
-
- for (JsonElement element : sourceArray) {
- targetArray.add(element);
- }
- } else {
- pTarget.add(entry.getKey(), sourceElement);
- }
- } else {
- pTarget.add(entry.getKey(), entry.getValue());
- }
- }
- }
-}
diff --git a/NeoForge/src/main/java/software/bluelib/utils/ParameterUtils.java b/NeoForge/src/main/java/software/bluelib/utils/ParameterUtils.java
deleted file mode 100644
index 3994cdf5..00000000
--- a/NeoForge/src/main/java/software/bluelib/utils/ParameterUtils.java
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright (c) BlueLib. Licensed under the MIT License.
-
-package software.bluelib.utils;
-
-import software.bluelib.entity.variant.VariantParameter;
-import software.bluelib.entity.variant.VariantLoader;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.NoSuchElementException;
-
-/**
- * A {@code Class} for managing custom parameters associated with entity variants.
- *
- * This class provides methods to retrieve custom parameters for variants and allows
- * for building and connecting parameters to specific variants using the {@link ParameterBuilder}.
- *
- *
- * Key Methods:
- *
- *
{@link #getParameter(String, String)} - Retrieves the value of a custom parameter for a specific variant.
- *
- *
- * Nested Classes:
- *
- *
{@link ParameterBuilder} - A builder class for creating and associating custom parameters with a specific variant.
- *
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
-public class ParameterUtils {
-
- /**
- * A {@link Map} holding custom parameters for each variant.
- *
- * The outer map's key is the variant's name, and the inner map contains key-value pairs
- * of custom parameters for that variant.
- *
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private static final Map> variantParametersMap = new HashMap<>();
-
- /**
- * Retrieves the value of a custom parameter for a specific variant.
- *
- * If the parameter is not found, "null" is returned.
- *
- *
- * @param pVariantName {@link String} - The name of the variant.
- * @param pParameterKey {@link String} - The key of the parameter to retrieve.
- * @return The value of the custom parameter for the specified variant.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public static String getParameter(String pVariantName, String pParameterKey) {
- return variantParametersMap.getOrDefault(pVariantName, new HashMap<>()).getOrDefault(pParameterKey, "null");
- }
-
- /**
- * A {@code Builder} class for creating and associating custom parameters with a specific variant.
- *
- * This class allows chaining methods to build and connect parameters to a variant.
- *
- *
- *
- * Key Methods:
- *
- *
{@link #forVariant(String, String)} - Creates a new instance of {@link ParameterBuilder} for the specified entity and variant.
- *
{@link #withParameter(String)} - Adds a parameter to the parameters map with a default value of "null".
- *
{@link #connect()} - Adds parameters to the variant and updates the static {@link VariantParameter} with these parameters.
- *
- *
- *
- * **Note:** The "null" value is used only if the parameter is not specified in the JSON files.
- *
- * @since 1.0.0
- * @author MeAlam
- * @Co-author Dan
- */
- public static class ParameterBuilder {
- /**
- * The name of the variant for which parameters are being built.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private final String variantName;
-
- /**
- * The name of the entity for which parameters are being built.
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private final String entityName;
-
- /**
- * A {@link Map} to store parameters for the variant.
- *
- * Each key-value pair represents a parameter name and its default value.
- *
- * @Co-author MeAlam, Dan
- * @since 1.0.0
- */
- private final Map parameters = new HashMap<>();
-
- /**
- * Constructor to initialize the builder with a specific entity name and variant name.
- *
- * @param pEntityName {@link String} - The name of the entity.
- * @param pVariantName {@link String} - The name of the variant.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- private ParameterBuilder(String pEntityName, String pVariantName) {
- this.variantName = pVariantName;
- this.entityName = pEntityName;
- }
-
- /**
- * Creates a new instance of {@link ParameterBuilder} for the specified entity and variant.
- *
- * @param pEntityName {@link String} - The name of the entity.
- * @param pVariantName {@link String} - The name of the variant.
- * @return A new instance of {@link ParameterBuilder}.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public static ParameterBuilder forVariant(String pEntityName, String pVariantName) {
- return new ParameterBuilder(pEntityName, pVariantName);
- }
-
- /**
- * Adds a parameter to the parameters map with a default value of "null".
- *
- * **Note:** The "null" value is used only if the parameter is not specified in the JSON files.
- *
- *
- * @param pParameter {@link String} - The key of the parameter to add.
- * @return The current instance of {@link ParameterBuilder} for method chaining.
- * @author MeAlam
- * @Co-author Dan
- * @since 1.0.0
- */
- public ParameterBuilder withParameter(String pParameter) {
- parameters.put(pParameter, "null");
- return this;
- }
-
- /**
- * Adds a parameter to the parameters map with a specified default value.
- *
- * Connects the parameters built with this builder to the specified variant.
- * Updates the static {@link VariantParameter} with the parameters for the specified variant.
- *