Skip to content

Commit

Permalink
Avoid allocating bb when collision shape has no collisions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Nov 29, 2024
1 parent e1d8878 commit 82613cc
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ public boolean collidesWithAtEdge(SFVec3i block, BlockState blockState, SFVec3i
return blockState.collisionShape().hasCollisions();
}

if (blockState.collisionShape().hasNoCollisions()) {
return false;
}

return blockState.collidesWith(block.toVector3i(), Player.STANDING_DIMENSIONS.makeBoundingBox(position.toVector3d()));
}

Expand Down

0 comments on commit 82613cc

Please sign in to comment.