Open ByThePowerOfScience opened 5 months ago
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.
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.
I'm assuming that, within Vanilla contexts, this piece of code would never fire is getRevengeTarget
is null.
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.
Divine-Journey-2/Divine-Journey-2#1134