Commit graph

31 commits

Author SHA1 Message Date
bcec704d27
main: add height-based color modification
Modify terrain color depending on the height to give a sense of
elevation.
2023-03-04 21:45:59 +01:00
116e7e5fb6
world/layer: collect block light data with top layer 2023-03-04 20:36:05 +01:00
4fd316f3fc
world/layer: return None from top_layer() for empty chunks
Allow ignoring these chunks for the light map as well.
2023-03-04 20:33:10 +01:00
51602d5fc1 world/chunk: add block light to section iterator items 2023-03-04 17:38:56 +01:00
482471492c world/chunk: store BlockLight data in section map 2023-03-04 17:38:56 +01:00
b4eb0d39f9 world/section: add BlockLight type 2023-03-04 17:38:56 +01:00
66f8d155f5
world/section: reorder type definitions 2023-03-04 16:58:52 +01:00
47dc3795a3
world: introduce SectionIterItem struct 2023-03-04 16:57:59 +01:00
56573640fd
world/section: prefer slice references to Vec and fastnbt types
Makes the code a bit nicer and saves repeated deref calls into fastnbt.
2023-03-04 00:36:58 +01:00
26555f1745
src/world/layer: make BlockInfo fields public
There were left private by accident.
2023-03-03 20:36:09 +01:00
1d4c7a86ff
world/layer: replace iproduct!() with nested loops
iproduct!() is slow for more than 2 parameters.
2023-03-02 01:00:55 +01:00
04bc3e5d53
world/section: perform palette lookups early
Look up block types for all palette entries once during section
construction, rather than on block_at(), reducing the number of HashMap
lookups by ~1000.
2023-03-02 00:37:25 +01:00
5c82b80924
world/section: replace block_id_at() method with block_at()
Directly return a BlockType, preparing for early lookup of palettes.
2023-03-02 00:31:34 +01:00
f2ab424590
world: store BlockTypes in section types
Prepare for sections returning BlockType data directly instead of block IDs.
2023-03-02 00:24:59 +01:00
4c2fd6c1a9
resource: rename BlockTypeMap to BlockTypes
The block_types() function it turned into a Default implementation.
2023-03-01 23:59:27 +01:00
cbbc6d8f35
resource: make BlockTypeMap return BlockType without reference 2023-03-01 21:58:29 +01:00
f47b38b2ca
world/layer: return boxed BlockInfoArray from top_layer()
Avoid copying around large structures, and allow creating
arrays of BlockInfoArrays without overflowing the stack.
2023-02-27 19:17:17 +01:00
551056803d
Add Serialize/Deserialize impls to various types
We want to be able to store this data to disk temporarily.
2023-02-26 00:46:50 +01:00
f48aa877d2
world: implement top_layer function
Implement one of the core functions of MinedMap: finding the topmost
visible block at each coordinate.
2023-02-18 11:51:24 +01:00
decb5c67a6
world/section: to not use u128 type
Getting the block index for unaligned blocks can be done just fine with
only u64.
2023-02-18 10:57:11 +01:00
921a218d56
types: split BlockCoords into SectionBlockCoords and LayerBlockCoords 2023-02-15 00:35:18 +01:00
9f8446885e
treewide: remove get_ prefix from function names
Follow the conventions of the std library.
2023-02-12 23:36:58 +01:00
96736bd7ed
Replace DivRem trait with num-integer crate 2023-02-12 23:08:53 +01:00
9146c06bec
treewide: rename "old" data structures to "v0"
"v0" doesn't refer to a specific version of Minecraft; it is just the
oldest data format supported by MinedMap.
2023-02-12 23:03:58 +01:00
493608ebc8
treewide: add more documentation 2023-02-12 23:03:58 +01:00
c34f531546
world/section: temporarily rename PaletteSectionBiomes fields
These fields are unused for now. Add an underscore to supress linter
warnings.
2023-02-12 23:03:58 +01:00
65c39ea153
types: make CHUNKS_PER_REGION and BLOCKS_PER_CHUNK usize
Having these as usize is more convenient.
2023-02-12 23:03:58 +01:00
b918ff6106
world/section: add method to get block ID at coordinate 2023-02-12 23:03:58 +01:00
c130f3cdae
world: add section iterator
An (empty for now) trait is introduced to abstract over the two section
types.
2023-02-12 23:03:57 +01:00
2d782f25b1
world: add types to wrap common parts of section data 2023-02-12 23:03:57 +01:00
6379472282
world/de: new module for deserialization data structures
The new structures contain only the fields that MinedMap needs.
2023-02-07 18:32:01 +01:00