Skip to content

Commit

Permalink
Fix collision check positions
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexProgrammerDE committed Dec 2, 2024
1 parent f738e8c commit d611977
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public class CollisionCalculator {
var bodyPartArray = new boolean[BodyPart.VALUES.length];
for (var bodyPart : BodyPart.VALUES) {
bodyPartArray[bodyPart.ordinal()] = blockState.collidesWith(
bodyPart.offset(SFVec3i.from(0, 1, 0)).toVector3i(),
Player.STANDING_DIMENSIONS.makeBoundingBox(diagonal.offsetSide(SFVec3i.ZERO).toVector3d())
bodyPart.offset(diagonal.offset(SFVec3i.ZERO)).toVector3i(),
Player.STANDING_DIMENSIONS.makeBoundingBox(diagonal.edgeOffset(SFVec3i.ZERO).toVector3d())
);
}
diagonalsArray[diagonal.diagonalArrayIndex()] = bodyPartArray;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public SFVec3i offset(SFVec3i vector) {
};
}

public SFVec3i offsetSide(SFVec3i vector) {
public SFVec3i edgeOffset(SFVec3i vector) {
return switch (this) {
case NORTH_EAST -> vector.add(1, 0, 0);
case NORTH_WEST -> vector.add(0, 0, 0);
Expand Down

0 comments on commit d611977

Please sign in to comment.