From 4aa223d5f7632ac98e687e5c1c7dd9ccde913904 Mon Sep 17 00:00:00 2001 From: pirateben820 Date: Wed, 16 Sep 2026 05:02:45 -0700 Subject: [PATCH] Compare block state property values with equals, not reference identity sameBlockstate compares each property's value with !=. The values come out of BlockState.getValues() as boxed Comparable, so this is reference identity. It is correct for enum and Boolean properties, whose values are singletons, and for an IntegerProperty it happens to work today because every vanilla integer property stays inside the -128..127 range the JVM's Integer cache interns (the largest, age, tops out at 25). Nothing in the comparison guarantees that, and identity is not what is meant here; equality is. Objects.equals to match the three other comparisons in this file. Plain equals would also be correct: both states share one StateDefinition, so the lookups cannot return null. Co-Authored-By: Claude Fable 5.1 --- src/main/java/baritone/process/BuilderProcess.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/baritone/process/BuilderProcess.java b/src/main/java/baritone/process/BuilderProcess.java index 4c3182b529..b6e7d7cd7b 100644 --- a/src/main/java/baritone/process/BuilderProcess.java +++ b/src/main/java/baritone/process/BuilderProcess.java @@ -1052,7 +1052,7 @@ private static boolean sameBlockstate(BlockState first, BlockState second) { Map, Comparable> map1 = first.getValues(); Map, Comparable> map2 = second.getValues(); for (Property prop : map1.keySet()) { - if (map1.get(prop) != map2.get(prop) + if (!Objects.equals(map1.get(prop), map2.get(prop)) && !(ignoreDirection && ORIENTATION_PROPS.contains(prop)) && !ignoredProps.contains(prop.getName())) { return false;