- Replace getBlockLayers() with getBlockLayer() and getLiquidLayer()
- Ensures all block layers are validated when setting chunks
- Completes the migration away from the deprecated method
- Remove unnecessary null checks for blockLayer and liquidLayer (they are now non-nullable)
- Deduplicate code by scanning both layers in a single loop
- Simplify logic flow by checking palettes first before scanning blocks
- Use the same pattern as ChunkSerializer by building an array of non-empty layers
- Cleaner and more maintainable code with fewer changes from original
- Remove inline comment for cleaner appearance
- Remove deprecated getBlockLayers() method that was replaced by getBlockLayer() and getLiquidLayer()
- Remove setBlockLayer() and setLiquidLayer() setter methods as layers are now managed internally
- Simplifies the API and prevents external mutation of internal layer state
- Add isBlockLayerEmpty() and isLiquidLayerEmpty() methods to SubChunk to avoid code duplication
- Update ChunkSerializer to use emptiness checks instead of null checks for layers
- Update LevelDB to use the new helper methods for cleaner code
- Ensures consistent emptiness checking logic across all serializers
- Check if layers are empty (bitsPerBlock == 0 and value == emptyBlockId) instead of null when saving subchunks
- This aligns with the refactored SubChunk class that now uses non-nullable blockLayer and liquidLayer fields
- Changed SubChunk constructor to accept null for layers and initialize empty PalettedBlockArray internally
- Updated all SubChunk getters to return non-nullable PalettedBlockArray
- Modified serialization/deserialization logic to check for layer emptiness instead of null
- Updated all SubChunk constructor calls across codebase to pass null for empty layers
- Simplified code by removing unnecessary null checks throughout the codebase
- Updated tests to match new SubChunk API
Replace blockLayers array with individual blockLayer and liquidLayer fields.
Update constructor and all usages throughout the codebase.
Deprecate getBlockLayers() method for backward compatibility.
this has bothered me for ages since it sorts into some absurd order by default due to the name starting with the day of the week.
this way it'll ensure that the files are always alphanumerically ordered, which means the most recent crashdump should always be
at the bottom.