diff --git a/src/api/java/baritone/api/Settings.java b/src/api/java/baritone/api/Settings.java index 89718289..267fe782 100644 --- a/src/api/java/baritone/api/Settings.java +++ b/src/api/java/baritone/api/Settings.java @@ -279,6 +279,12 @@ public final class Settings { */ public final Setting buildIgnoreDirection = new Setting<>(false); + /** + * A list of names of block properties the builder will ignore. + */ + public final Setting> buildIgnoreProperties = new Setting<>(new ArrayList<>(Arrays.asList( + ))); + /** * If this setting is true, Baritone will never break a block that is adjacent to an unsupported falling block. *

diff --git a/src/main/java/baritone/process/BuilderProcess.java b/src/main/java/baritone/process/BuilderProcess.java index c1c0cb1d..2d7714d9 100644 --- a/src/main/java/baritone/process/BuilderProcess.java +++ b/src/main/java/baritone/process/BuilderProcess.java @@ -874,14 +874,21 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil BlockTrapDoor.OPEN, BlockTrapDoor.HALF ); - private boolean sameWithoutOrientation(IBlockState first, IBlockState second) { + private boolean sameBlockstate(IBlockState first, IBlockState second) { if (first.getBlock() != second.getBlock()) { return false; } + boolean ignoreDirection = Baritone.settings().buildIgnoreDirection.value; + List ignoredProps = Baritone.settings().buildIgnoreProperties.value; + if (!ignoreDirection && ignoredProps.isEmpty()) { + return first.equals(second); // early return if no properties are being ignored + } ImmutableMap, Comparable> map1 = first.getProperties(); ImmutableMap, Comparable> map2 = second.getProperties(); for (IProperty prop : map1.keySet()) { - if (map1.get(prop) != map2.get(prop) && !orientationProps.contains(prop)) { + if (map1.get(prop) != map2.get(prop) + && !(ignoreDirection && orientationProps.contains(prop)) + && !ignoredProps.contains(prop.getName())) { return false; } } @@ -913,7 +920,7 @@ public final class BuilderProcess extends BaritoneProcessHelper implements IBuil if (current.equals(desired)) { return true; } - return Baritone.settings().buildIgnoreDirection.value && sameWithoutOrientation(current, desired); + return sameBlockstate(current, desired); } public class BuilderCalculationContext extends CalculationContext {