feat: warn about unsupported blocks after chunk loading#1880
Open
mvanhorn wants to merge 2 commits intochunky-dev:masterfrom
Open
feat: warn about unsupported blocks after chunk loading#1880mvanhorn wants to merge 2 commits intochunky-dev:masterfrom
mvanhorn wants to merge 2 commits intochunky-dev:masterfrom
Conversation
Track block names that are not recognized by any BlockProvider in a concurrent set within BlockPalette. After chunk loading completes, log a warning listing the unsupported block names and suggesting the user update Chunky or check the minecraft label on GitHub. Fixes chunky-dev#1801
NotStirred
requested changes
Apr 9, 2026
Comment on lines
578
to
585
| if (palette != null) { | ||
| Set<String> unsupported = palette.getUnsupportedBlocks(); | ||
| if (!unsupported.isEmpty()) { | ||
| Log.warn("Unsupported blocks found: " + String.join(", ", unsupported) | ||
| + ". Consider updating Chunky or check https://github.com/chunky-dev/chunky/labels/minecraft for known issues."); | ||
| } | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
This is only hit when loading an existing scene that doesn't have an octree
Should probably do this inside loadChunks itself
|
|
||
| private final Map<BlockSpec, Integer> blockMap; | ||
| private List<Block> palette; | ||
| private final Set<String> unsupportedBlocks = ConcurrentHashMap.newKeySet(); |
Member
There was a problem hiding this comment.
put locks internally, and we're guaranteed that all puts have finished by the time chunkloading is finished (and getUnsupportedBlocks is called).
Can use HashMap to avoid extra work in chunk loading hot path (@leMaik is this worth the performance? In <=1.12 palette is around 50% of chunk loading, >1.12 it's about 5%)
Would probably need some comments explaining that exactly what's going on with the concurrent access (I'll do that after merge)
Address review feedback from @NotStirred: - Move unsupported blocks warning from Scene caller into loadChunks itself, since the check should run for all callers, not just the scene reload path - Change unsupportedBlocks from ConcurrentHashMap.newKeySet() to HashSet since put() locks internally and all puts complete before getUnsupportedBlocks Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
|
Addressed in cb75335:
|
NotStirred
approved these changes
Apr 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
After loading chunks, Chunky now logs a warning listing any block types that weren't recognized by any BlockProvider. The warning suggests updating Chunky or checking the minecraft label on GitHub.
Changes
BlockPalette.java: Added aConcurrentHashMap.KeySetView<String>to collect unknown block names duringput(). AddedgetUnsupportedBlocks()accessor.Scene.java: AfterloadChunks()returns, checks the palette for unsupported blocks and logs a warning if any are found.Testing
Fixes #1801
This contribution was developed with AI assistance (Claude Code).