Move up and fix access modifiers

This commit is contained in:
ZacSharp 2024-02-21 23:13:46 +01:00
parent 24c23e28ec
commit 28ba97c3de
No known key found for this signature in database
GPG Key ID: 9453647B005083A3
1 changed files with 12 additions and 12 deletions

View File

@ -85,6 +85,14 @@ import static baritone.api.pathing.movement.ActionCosts.COST_INF;
public final class BuilderProcess extends BaritoneProcessHelper implements IBuilderProcess { public final class BuilderProcess extends BaritoneProcessHelper implements IBuilderProcess {
private static final Set<Property<?>> ORIENTATION_PROPS =
ImmutableSet.of(
RotatedPillarBlock.AXIS, HorizontalDirectionalBlock.FACING,
StairBlock.FACING, StairBlock.HALF, StairBlock.SHAPE,
PipeBlock.NORTH, PipeBlock.EAST, PipeBlock.SOUTH, PipeBlock.WEST, PipeBlock.UP,
TrapDoorBlock.OPEN, TrapDoorBlock.HALF
);
private HashSet<BetterBlockPos> incorrectPositions; private HashSet<BetterBlockPos> incorrectPositions;
private LongOpenHashSet observedCompleted; // positions that are completed even if they're out of render distance and we can't make sure right now private LongOpenHashSet observedCompleted; // positions that are completed even if they're out of render distance and we can't make sure right now
private String name; private String name;
@ -1010,15 +1018,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
return result; return result;
} }
public static final Set<Property<?>> orientationProps = private static boolean sameBlockstate(BlockState first, BlockState second) {
ImmutableSet.of(
RotatedPillarBlock.AXIS, HorizontalDirectionalBlock.FACING,
StairBlock.FACING, StairBlock.HALF, StairBlock.SHAPE,
PipeBlock.NORTH, PipeBlock.EAST, PipeBlock.SOUTH, PipeBlock.WEST, PipeBlock.UP,
TrapDoorBlock.OPEN, TrapDoorBlock.HALF
);
private boolean sameBlockstate(BlockState first, BlockState second) {
if (first.getBlock() != second.getBlock()) { if (first.getBlock() != second.getBlock()) {
return false; return false;
} }
@ -1031,7 +1031,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
ImmutableMap<Property<?>, Comparable<?>> map2 = second.getValues(); ImmutableMap<Property<?>, Comparable<?>> map2 = second.getValues();
for (Property<?> prop : map1.keySet()) { for (Property<?> prop : map1.keySet()) {
if (map1.get(prop) != map2.get(prop) if (map1.get(prop) != map2.get(prop)
&& !(ignoreDirection && orientationProps.contains(prop)) && !(ignoreDirection && ORIENTATION_PROPS.contains(prop))
&& !ignoredProps.contains(prop.getName())) { && !ignoredProps.contains(prop.getName())) {
return false; return false;
} }
@ -1039,7 +1039,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
return true; return true;
} }
private boolean containsBlockState(Collection<BlockState> states, BlockState state) { private static boolean containsBlockState(Collection<BlockState> states, BlockState state) {
for (BlockState testee : states) { for (BlockState testee : states) {
if (sameBlockstate(testee, state)) { if (sameBlockstate(testee, state)) {
return true; return true;
@ -1048,7 +1048,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil
return false; return false;
} }
private boolean valid(BlockState current, BlockState desired, boolean itemVerify) { private static boolean valid(BlockState current, BlockState desired, boolean itemVerify) {
if (desired == null) { if (desired == null) {
return true; return true;
} }