Skip to content

Commit

Permalink
Update SupportUtils.java
Browse files Browse the repository at this point in the history
  • Loading branch information
TylerS1066 committed Sep 8, 2024
1 parent 6bbcf92 commit e099c8d
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ public class SupportUtils {
@Nullable
public static BlockFace getSupportFace(@NotNull BlockData data) {
return switch (data) {
case Hangable hangable -> hangable.isHanging() ? BlockFace.UP : BlockFace.DOWN;
case Directional directional -> directional.getFacing().getOppositeFace();
case Hangable hangable when hangable.isHanging() -> BlockFace.UP;
case Hangable hangable when !hangable.isHanging() -> BlockFace.DOWN;
case FaceAttachable faceAttachable -> switch (faceAttachable.getAttachedFace()) {
case FLOOR -> BlockFace.DOWN;
case WALL ->
faceAttachable instanceof Directional directional ? directional.getFacing().getOppositeFace() : null;
case CEILING -> BlockFace.UP;
case WALL -> null; // Wall attachable should be Directional
};
case Directional directional -> directional.getFacing().getOppositeFace();
default -> null;
};
}
Expand Down

0 comments on commit e099c8d

Please sign in to comment.