Update 20250104 - Full Ballista Implementation #26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fully implemented the Ballista Turret along with some major changes to the base Turret entity class and minor updates to the Cannon Turret.
Some standardizations and abstractions are also done to allow the current turrets and future turrets to have shorter codes.
[CHANGELOG]
🟢 Added my PayPal to my FUNDING.yml file.
🟢 Added the Ballista Turret's model, renderer, and entity classes along with its geo model and animation files.
🟢 Created a base Renderer class for all turrets, allowing turret renderers to just extend to this class and override the defaults.
🟢 Added a new Map property for the Cannon Turret entity that will now be implemented against all future turret implementation. This property defines all the offset points the turret uses such as the Cannon Turret's fuse and barrel offsets.
🟢 Added a new property for the Turret Entity base class which stores the attack goal of a turret, allowing for the attack goal to be called and be used for other processes such as defining a point in its attack cooldown when to use particles and such.
🟢 Added a new property for Turret Entity base class that defines how many barrels and what barrel is to be used next when shooting a projectile.
🟢 Added an overload for "getRelativePos" method of Turret Entity to now support Vec3d parameter.
🟢 Added an overridable method; "getMinAttackRange" and "getMaxAttackRange" which returns a float value that represents the turret's attack range in meters (1 meter = 1 full block).
🟢 Added an abstract method which returns a list of barrels the turret have when called.
🟢 Added several new overridable methods as well that sets the projectile velocity, along with a dependent method "shoot" that shoots the set projectile for the turret. This allows the shooting to be streamlined and even allow the entity to shoot when there's no target entity.
🟢 Added a local class for Turret Entity base class, which defines a velocity calculation for projectiles. See its documentation for more information.
🟢 Added the Ballista Turret's item counterpart, along with its parts.
🟢 Added Ballista Turret's item tooltips.
🟢 Added a minimum range for Cannon Turrets; set at 3 blocks.
🟢 Added a natural armor for the Cannon Turret; set at 3 armor points and 2 armor toughness.
🟢 Added a new method called "isWithinRange" which determines whether the provided entity or XYZ coordinates is within the minimum and maximum range of the turret.
🟢 Added a new block that is tied to the Ballista Turret's crafting recipe: Arrowhead, a block that inflicts damage when stepped on.
🟢 Added a new registry method for items so that blocks can be registered as items.
🟢 Added a DamageType registrey key fetcher in the Registry Utility class.
🟢 Moved the standard attributes to the Turret Entity base class for reusability. Check its javadocs for more information.
🟢 Moved the standard goals to the Turret Entity base class for reusability. Goals can still be overridden by calling "super.initGoals" method before adding the override goals. The attack goal can now be left null for the base class to set it. See its javadocs for more information.
🟢 Added several new text entries in the English lang file.
🟢 Added the Arrowhead to the "traps" block tag.
🟢 Added the Arrowhead to the list of damage types that could bypass armors.
🟢 Added both the cannonball and ballista arrow to the projectiles tag list.
🟢 Added ballista to the turret tag list.
🟡 Updated the Cannon Turret renderer class to extend the newly created base Turret Renderer class.
🟡 Updated the forgotten commented out code for Cannon Base item's fuel registry.
🟡 Refactored the custom Projectile Attack goal class to now support minimum range. Some variable names are also changed to easily understand what they do.
🟡 Overriden the "getPierceLevel" method of Ballista Arrow's superclass, allowing the projectile to now pierce entities once more. It now also accounts for armor protection.
🟡 Refactored Ballista Arrow entity's entity hit velocity calculations
🟡 Changed the order of declared parameters for Cannonball's entity constructor from "(World, LivingEntity)" to "(LivingEntity, World)".
🟡 Moved all standard goals from the subclass of Turret Entity base class to TurretEntity class itself.
🟡 Moved the Itemable interface from the "entity.turrets" package to its newly created "interfaces" subpackge.
🟡 Changed the Turret Entity base class into an abstract class.
🟡 Overriden the "setTarget" method under the base Turret Entity class, allowing the turret to not account for its minimum range and maximum range when setting a target.
🟡 Updated the projectile property of Turret Entity base class to "EntityType" instead of "Class" to accommodate the mapping change.
🟡 Updated Cannon Turret's item tooltip for range to match its updated range.
🟡 Updated a potential future bug where when a turret dies, their rotation get carries over to other instances of turrets.
🟡 Updated all Turret Item subclasses to now fetch their respective turret instance's max health and health.
🟡 Updated the Turret Item base class to now show the retrieved turret's current health over max health. This is reset to max health when the item is renamed however.
🔴 Reduced the redundant implementation of Cannon Turret entity class's interface.