Grappling Hook Mod

Grappling Hook Mod

23M Downloads

NPE when getting RenderAABB of grapple arrow without shootingEntity

Meldexun opened this issue ยท 0 comments

commented

When a grapple arrow is loaded from NBT it has no owner and normally gets removed from the world when it is updated the next time. But other mods (in this case EntityCulling) might call Entity#getRenderBoundingBox which then will throw a NPE.

public AxisAlignedBB getRenderBoundingBox() {
AxisAlignedBB bb = this.segmenthandler.getBoundingBox(vec.positionvec(this), vec.positionvec(this.shootingEntity).add(new vec(0, this.shootingEntity.getEyeHeight(), 0)));

Checking if the shooterEntity is null and returning an "empty" bounding box (new AxisAlignedBB(0, 0, 0, 0, 0, 0)) should fix this issue.