From 31396cdd7380275d36fb15edcdcf7a7c464dc5d2 Mon Sep 17 00:00:00 2001 From: Axionize <154778082+Axionize@users.noreply.github.com> Date: Sun, 22 Dec 2024 21:34:33 -0500 Subject: [PATCH] Fix NPE that can occur in HitboxEntities check --- .../ac/grim/grimac/utils/data/ReachInterpolationData.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/main/java/ac/grim/grimac/utils/data/ReachInterpolationData.java b/src/main/java/ac/grim/grimac/utils/data/ReachInterpolationData.java index 30b4d01f3f..387612f391 100644 --- a/src/main/java/ac/grim/grimac/utils/data/ReachInterpolationData.java +++ b/src/main/java/ac/grim/grimac/utils/data/ReachInterpolationData.java @@ -104,7 +104,7 @@ public static CollisionBox getOverlapHitbox(CollisionBox b1, CollisionBox b2) { // Check if there's actual overlap along each axis if (overlapMinX > overlapMaxX || overlapMinY > overlapMaxY || overlapMinZ > overlapMaxZ) { - return null; // No overlap, return null or an appropriate "empty" box representation + return NoCollisionBox.INSTANCE; // No overlap, return null or an appropriate "empty" box representation } // Return the overlapping hitbox @@ -172,12 +172,6 @@ public CollisionBox getOverlapLocationCombined() { startingLocation.maxX + (step * stepMaxX), startingLocation.maxY + (step * stepMaxY), startingLocation.maxZ + (step * stepMaxZ))); - - if (overlapLocation == null) { - // No overlap found, you might want to handle this case specifically - // For example, return null or a default box - return NoCollisionBox.INSTANCE; - } } return overlapLocation;