$ show Querz/mcaselector
MCA Selector is a desktop application for editing Minecraft Java Edition world saves at the chunk and region level. It provides a graphical interface (JavaFX) and a command-line interface for operations such as selecting, exporting, deleting, importing, and modifying chunks and regions. The application reads and writes Minecraft Anvil (MCA) region files, including POI and entity data, and supports a wide range of Minecraft versions from 1.9 to the latest snapshots through version-specific mapping files and strategy pattern implementations (ChunkFilter, ChunkRenderer, ColorMapping). Architecturally, the application is a monolith with a clear separation of concerns: a UI layer (JavaFX dialogs, TileMap, custom components), a job system (JobHandler with priority queues and thread pools), a data layer (MCA file I/O, NBT parsing, caching via LevelDB), and a version abstraction layer. Key entry points include the Main class (launches GUI or CLI), the Window class (JavaFX stage), and the ParamExecutor (CLI dispatcher). External dependencies include a custom NBT library, Gson, fastutil, Log4j, Apache Commons CLI, Groovy scripting, LevelDB, LZ4, and RichTextFX. Data flows involve loading region files from disk, parsing chunk data (blocks, biomes, heightmaps, entities), applying user-defined filters and changes (including Groovy scripts), and saving modified chunks back to MCA files. The application also generates rendered tile images for the map view, with caching at multiple levels (memory, disk PNG, LevelDB). Overlays provide visual analysis of chunk properties (e.g., inhabited time, entity count) using hue-based coloring. While primarily an application, the repository includes a significant data component: version-specific block color mappings, heightmap definitions, and registry files (blocks, biomes, entities, structures) that are used for rendering and filtering. These mappings are generated by a separate tool within the repository that downloads Minecraft server jars and extracts data. This hybrid nature means the repo serves both as a tool and as a curated dataset for Minecraft world analysis.
The LLM identified 5 files worth highlighting for reuse:
An efficient 1024-bit set implementation for representing chunk selections within a region. It supports serialization to/from strings, set operations (union, intersection, difference, complement), iteration over set bits, and bulk operations. The implementation uses two long arrays for compact storage and provides methods for merging, subtracting, and inverting selections. This is a self-contained, reusable component that could be extracted for any application requiring a fixed-size bit set with serialization.
A custom implementation of a blocking queue that supports dynamic priority ordering and element removal. Unlike standard priority queues, this queue allows elements to be dequeued in priority order while also supporting O(n) removal of arbitrary elements. It uses a linked list with a lock and condition for blocking operations. This is a non-trivial concurrent data structure that could be reused in any multi-threaded system requiring priority-based task scheduling with cancellation.
A composable filter implementation that combines multiple filters using AND, OR, and NOT logic. It supports nested grouping and provides a region-level prefiltering mechanism (RegionMatcher) to quickly skip entire regions that cannot contain matching chunks. The filter tree is serializable to/from a string representation for persistence. This pattern is reusable for any system requiring complex boolean filtering of hierarchical data, such as log analysis or data querying.
An abstract base class for overlays that provides a framework for defining custom data visualizations on the map. It includes cloneable behavior, min/max value tracking, multi-value support, hue range configuration, and custom JSON serialization via Gson adapters. Subclasses implement specific overlay types (e.g., entity count, inhabited time). The class handles value normalization, color mapping, and overlay-specific validation. This pattern is reusable for any application requiring pluggable data overlays with consistent serialization and UI integration.
A utility for parsing Y-level ranges from string representations (e.g., '0-255', '-64..320', '50'). It supports inclusive/exclusive bounds, single values, and multiple ranges separated by commas. The parser handles negative numbers and validates range consistency. This is a self-contained, reusable component that could be extracted for any application requiring range parsing, such as data filtering or coordinate selection.