Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kill Count Tracking and GUI Updates for TurretBase #9

Merged
merged 7 commits into from
Jan 18, 2025

Conversation

mak8427
Copy link

@mak8427 mak8427 commented Jan 18, 2025

This PR introduces several updates and new features to the OpenModularTurrets project, specifically focusing on tracking the kill count for turrets and displaying this information in the GUI. The following changes have been made:

  1. TurretBase.java:

    • Added a killCount field to track the number of kills made by the turret.
    • Implemented onKill method to increment the kill count when an entity is killed.
    • Added getter and setter methods for killCount.
    • Updated writeToNBT and readFromNBT methods to save and load the kill count.
  2. GUI Updates:

    • Added the kill count display to the GUI for all turret tiers (TurretBaseTierOneGui, TurretBaseTierTwoGui, TurretBaseTierThreeGui, TurretBaseTierFourGui, TurretBaseTierFiveGui). The kill count is now shown as part of the target information.
  3. Projectile Updates:

    • Updated various projectile classes (BlazingClayProjectile, BulletProjectile, DisposableTurretProjectile, FerroSlugProjectile, GrenadeProjectile, LaserProjectile, RocketProjectile) to ensure that kills are only counted once per entity, even if multiple projectiles hit the entity simultaneously.

Closes GTNewHorizons/GT-New-Horizons-Modpack#18740

mak8427 and others added 4 commits January 17, 2025 18:18
Added killcount
Add onKill function
-Added call OnKill for every projectile when Entity is killed
@mak8427
Copy link
Author

mak8427 commented Jan 18, 2025

I have created a pull request to address this issue: GTNewHorizons/GT-New-Horizons-Modpack#18740

@serenibyss
Copy link
Member

@mak8427 Thanks for addressing the reviews, this PR looks good now. Could you run gradlew spotlessApply to fix the failing test?

@thisHermit
Copy link

thisHermit commented Jan 18, 2025

It should hopefully work now. I helped mak find the issue

Copy link
Member

@serenibyss serenibyss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@serenibyss serenibyss merged commit 4a3dcbf into GTNewHorizons:master Jan 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kill Count on Open turrets
3 participants