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

[FORWARDED] Roots Non-Detection Effect Causes Crash #816

Open
ByThePowerOfScience opened this issue Mar 19, 2024 · 4 comments
Open

[FORWARDED] Roots Non-Detection Effect Causes Crash #816

ByThePowerOfScience opened this issue Mar 19, 2024 · 4 comments
Assignees
Labels
1.12.2 1.12.2 bug Something isn't working

Comments

@ByThePowerOfScience
Copy link
Collaborator

Divine-Journey-2/Divine-Journey-2#1134

@ByThePowerOfScience ByThePowerOfScience added the bug Something isn't working label Mar 19, 2024
@ByThePowerOfScience ByThePowerOfScience self-assigned this Mar 19, 2024
@ByThePowerOfScience
Copy link
Collaborator Author

ByThePowerOfScience commented Mar 19, 2024

Issue is caused by this line:

if (this.taskOwner != entitycreature && entitycreature.getAttackTarget() == null
                && (
                        !(this.taskOwner instanceof EntityTameable)
                        || ((EntityTameable)this.taskOwner).getOwner() == ((EntityTameable)entitycreature).getOwner())
                && !entitycreature.isOnSameTeam(this.taskOwner.getRevengeTarget()))

where this.taskOwner.getRevengeTarget() is null. The method is marked as nullable, but the isOnSameTeam method doesn't account for that.
I can't see a way to resolve this short of patching the isOnSameTeam method via ASM.

@ByThePowerOfScience
Copy link
Collaborator Author

I tried doing an ASM-only implementation, but I forgot how much I hate coremods in 1.12. I'm adding Mixin as an optional dependency to patch this bug specifically.

@noobanidus
Copy link
Collaborator

I'm assuming that, within Vanilla contexts, this piece of code would never fire is getRevengeTarget is null.

@ByThePowerOfScience
Copy link
Collaborator Author

I'm assuming that, within Vanilla contexts, this piece of code would never fire is getRevengeTarget is null.

Likewise, though getRevengeTarget does change to returning null after a few seconds, so it's really just luck that they never encountered this NPE.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.12.2 1.12.2 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants