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

Bugfix: prevent an owner from attacking their pet while riding/being ridden #179

Merged
merged 4 commits into from
Aug 22, 2024

Conversation

demonlexe
Copy link
Collaborator

@demonlexe demonlexe commented Aug 22, 2024

DONE:

  • Test with flying pet, like Manticore
  • Test with ground pet, like Panther
  • Test with pet on head, like Bunny / Rat

BEFORE & AFTER:
https://www.loom.com/share/6eb4394473174f9e8809f66a9ea540e3?sid=b02ab1c1-9597-43c2-88dd-c9bb05234723

…their own mount/mounted pet:

/**
     * Called when the entity is attacked.
     */
    public boolean attackEntityFrom(DamageSource source, float amount)
    {
        Entity entity = source.getTrueSource();
        return this.isBeingRidden() && entity != null && this.isRidingOrBeingRiddenBy(entity) ? false : super.attackEntityFrom(source, amount);
    }
@demonlexe demonlexe marked this pull request as ready for review August 22, 2024 21:12
@demonlexe demonlexe self-assigned this Aug 22, 2024
@demonlexe demonlexe merged commit e3457f6 into 1.12.2 Aug 22, 2024
2 checks 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.

Verify that Tinker's Shuriken Doesn't Dmg Riding Pet
1 participant