Skip to content

Commit

Permalink
fix: adjustments, fix certain upside-down blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
dordsor21 committed Oct 26, 2024
1 parent 26030b2 commit b3bfe79
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public abstract class PlacementStateProcessor extends AbstractDelegateExtent imp
private static BlockTypeMask DEFAULT_MASK = null;
private static BlockTypeMask IN_FIRST_PASS = null;
private static BlockTypeMask REQUIRES_SECOND_PASS = null;
private static BlockTypeMask IN_FIRST_PASS_WITHOUT_SECOND = null;
private static AdjacentAny2DMask ADJACENT_STAIR_MASK = null;

protected final Extent extent;
Expand Down Expand Up @@ -126,6 +127,9 @@ private static void setup() {
);
IN_FIRST_PASS.add(BlockCategories.STAIRS.getAll());

IN_FIRST_PASS_WITHOUT_SECOND = new BlockTypeMask(nullExtent);
IN_FIRST_PASS_WITHOUT_SECOND.add(BlockCategories.STAIRS.getAll());

REQUIRES_SECOND_PASS = new BlockTypeMask(nullExtent);
REQUIRES_SECOND_PASS.add(
BlockTypes.IRON_BARS,
Expand Down Expand Up @@ -242,7 +246,11 @@ private void checkAndPerformUpdate(
int blockX = processChunkX + x;
char ordinal = set[index];
BlockState state = BlockTypesCache.states[ordinal];
if (firstPass && !IN_FIRST_PASS.test(state)) {
if (firstPass) {
if (!IN_FIRST_PASS.test(state)) {
continue;
}
} else if (IN_FIRST_PASS_WITHOUT_SECOND.test(state)) {
continue;
}
if (!mask.test(state)) {
Expand Down Expand Up @@ -358,7 +366,7 @@ public BlockState getBlockStateAt(int x, int y, int z) {
}
}
}
return BlockTypesCache.states[ordinal];
return state;
}

public LinCompoundTag getTileAt(int x, int y, int z) {
Expand Down Expand Up @@ -425,7 +433,7 @@ private char getBlockOrdinal(int blockX, int blockY, int blockZ, BlockState stat
}
if (hadNesw) {
if (dirs.contains(Direction.UP)) {
clickPos.mutY(blockY + 0.5);
clickPos.mutY(blockY + 0.6);
}
} else if (dirs.contains(Direction.UP)) {
clickedFaceDirection = Direction.DOWN;
Expand Down

0 comments on commit b3bfe79

Please sign in to comment.