From 789d9146f7dabd7f7cae675308997ebbdba14c35 Mon Sep 17 00:00:00 2001 From: Pix3lPirat3 Date: Sun, 20 Sep 2026 03:30:40 -0700 Subject: [PATCH] Classify blocks by defaultState on Bedrock (runtime states) Movements builds its fence/carpet/emptyBlock sets from Block.fromStateId(block.minStateId). Bedrock uses runtime block-state palettes and has no static minStateId (it exposes defaultState), so on Bedrock fromStateId returned empty shapes and those sets were never populated (fences=0, carpets=0). Fall back to defaultState when minStateId is absent, restoring correct classification on Bedrock (fences=58, carpets=19) with no change on Java (minStateId always present). Verified live on BDS 1.26.45. --- lib/movements.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/movements.js b/lib/movements.js index 40412d6..cf5241d 100644 --- a/lib/movements.js +++ b/lib/movements.js @@ -80,7 +80,10 @@ class Movements { this.fences = new Set() this.carpets = new Set() this.openable = new Set() - registry.blocksArray.map(x => Block.fromStateId(x.minStateId, 0)).forEach(block => { + // Java blocks carry a static minStateId; Bedrock uses runtime block-state palettes and exposes defaultState instead + // (minStateId is undefined), so fall back to it - otherwise fromStateId yields empty shapes and fences/carpets/ + // emptyBlocks are never classified on Bedrock. + registry.blocksArray.map(x => Block.fromStateId(x.minStateId ?? x.defaultState, 0)).forEach(block => { if (block.shapes.length > 0) { // Fences or any block taller than 1, they will be considered as non-physical to avoid // trying to walk on them