[FORWARDED] Roots Non-Detection Effect Causes Crash
ByThePowerOfScience opened this issue ยท 4 comments
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.
I'm assuming that, within Vanilla contexts, this piece of code would never fire is getRevengeTarget
is null.
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.