Skip to content

Commit

Permalink
Fixed check surroundings
Browse files Browse the repository at this point in the history
  • Loading branch information
1foxy2 committed Nov 12, 2024
1 parent 3c5be89 commit 03f57d2
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ public static boolean areLeavesOpaque() {
public static Optional<Boolean> shouldDrawFaceCheck(BlockGetter view, BlockState sideState,
BlockPos thisPos, BlockPos sidePos, Direction side) {
if (sideState.getBlock() instanceof LeavesBlock ||
(sideState.canOcclude() && sideState.isFaceSturdy(view, sidePos, side))) {
(sideState.canOcclude() && sideState.isFaceSturdy(view, sidePos, side.getOpposite()))) {
boolean isSurrounded = true;
for (Direction dir : DirectionUtils.DIRECTIONS) {
if (dir != side) {
BlockPos pos = thisPos.relative(dir);
BlockState state = view.getBlockState(pos);
isSurrounded &= state.getBlock() instanceof LeavesBlock ||
(sideState.canOcclude() && state.isFaceSturdy(view, pos, dir));
(state.canOcclude() && state.isFaceSturdy(view, pos, dir.getOpposite()));
}
}
return isSurrounded ? Optional.of(false) : Optional.empty();
Expand Down

0 comments on commit 03f57d2

Please sign in to comment.