Skip to content

[1.21.10] fix nether pathfinder exception in palette scan#4933

Merged
leijurv merged 1 commit intocabaletta:1.21.10from
rfresh2:elytraPaletteScanFix-1.21.10
Dec 23, 2025
Merged

[1.21.10] fix nether pathfinder exception in palette scan#4933
leijurv merged 1 commit intocabaletta:1.21.10from
rfresh2:elytraPaletteScanFix-1.21.10

Conversation

@rfresh2
Copy link
Contributor

@rfresh2 rfresh2 commented Dec 19, 2025

if air is not in palette, prev code would throw an exception

[17:09:42] [pool-39-thread-1/INFO]: [STDERR]: java.lang.IllegalArgumentException: Unexpected palette resize, bits = 1, added value = Block{minecraft:air}
[17:09:42] [pool-39-thread-1/INFO]: [STDERR]: 	at knot//net.minecraft.class_2835.method_74154(class_2835.java:9)
[17:09:42] [pool-39-thread-1/INFO]: [STDERR]: 	at knot//net.minecraft.class_6564.method_12291(class_6564.java:33)
[17:09:42] [pool-39-thread-1/INFO]: [STDERR]: 	at knot//baritone.process.elytra.NetherPathfinderContext.writeChunkData(NetherPathfinderContext.java:199)
[17:09:42] [pool-39-thread-1/INFO]: [STDERR]: 	at knot//baritone.process.elytra.NetherPathfinderContext.lambda$queueForPacking$1(NetherPathfinderContext.java:85)
[17:09:42] [pool-39-thread-1/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
[17:09:42] [pool-39-thread-1/INFO]: [STDERR]: 	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
[17:09:42] [pool-39-thread-1/INFO]: [STDERR]: 	at java.base/java.lang.Thread.run(Thread.java:1583)
[17:09:42] [pool-39-thread-2/INFO]: [STDERR]: java.lang.IllegalArgumentException: Unexpected palette resize, bits = 1, added value = Block{minecraft:air}
[17:09:42] [pool-39-thread-2/INFO]: [STDERR]: 	at knot//net.minecraft.class_2835.method_74154(class_2835.java:9)
[17:09:42] [pool-39-thread-2/INFO]: [STDERR]: 	at knot//net.minecraft.class_6564.method_12291(class_6564.java:33)
[17:09:42] [pool-39-thread-2/INFO]: [STDERR]: 	at knot//baritone.process.elytra.NetherPathfinderContext.writeChunkData(NetherPathfinderContext.java:199)
[17:09:42] [pool-39-thread-2/INFO]: [STDERR]: 	at knot//

in pre 1.21.10 baritone the palette is actually resized and edited. which works, but imo its better not to edit the state.

@ZacSharp
Copy link
Collaborator

Looks good to me.

Kinda weird we have to do a linear scan with a predicate, but I just checked an older mc version (because I'm lazy) and at least there the scan isn't that terrible. The array palette has to scan anyway, the registry palette just returns true, the singleton palette doesn't have anything to scan, so the only case where this loses in efficiency at all is the hash map palette.

@leijurv leijurv merged commit 2d2c691 into cabaletta:1.21.10 Dec 23, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants