Commit graph

63 commits

Author SHA1 Message Date
a1dd77c8fd
world/sign: implement Display for SignText 2024-01-10 22:56:30 +01:00
fb361145eb
world: add sign position and material information to block entities 2024-01-10 22:56:29 +01:00
8814dcff89
resource: split BlockType in Copy and !Copy parts
Preparation for actually adding !Copy fields to BlockType.

Only the Copy parts are added to the processed data, avoiding .clone()
for the most part.
2024-01-10 22:56:29 +01:00
e36ae4601d
world: add Eq + Ord to all block entity types 2024-01-10 22:56:27 +01:00
f0e0db63d3
world: process sign data, prepare for serialization 2024-01-10 22:56:26 +01:00
638d5046c9
world/chunk: change Chunk into a struct
The version-specific part is extracted as an enum ChunkInner.
2024-01-10 22:56:26 +01:00
61d456846a
world: implement decoding raw JSON text into a linear list of formatted strings 2024-01-10 22:56:26 +01:00
f78dd795ca
world/de: add deserialization of sign block entities 2024-01-10 22:56:26 +01:00
e8165aa47d
world: hide unknown block/biome type warnings by default
While using MinedMap with modded Minecraft version is not officially
supported, it should still work reasonably well if you're okay with
custom block types being invisible and custom biomes using default
grass/color/foliage colors.

Avoid spamming the log with messages for each section in this case
without --verbose, and instead just print a single warning at the end of
processing.
2024-01-10 13:02:29 +01:00
1e41e1bc6a
world/chunk: move SectionIter structs to impl 2024-01-10 13:02:29 +01:00
74a4fc93d0
world/de: rename Variants enums to Variant 2023-11-25 19:01:36 +01:00
a8eb2da95d
Use tracing for configurable logging 2023-09-19 23:29:05 +02:00
003b48951b
world: fix deserialize of unpopulated 1.18+ sections 2023-08-20 19:11:12 +02:00
05a8056cbf
Add documentation comments for all items 2023-08-20 11:21:29 +02:00
7d231b92ea
Format let-else blocks
Use nightly rustfmt to format let-else.
2023-08-05 10:46:47 +02:00
fb712cd2f5
Store per-region biome list in IndexSet
Index into the biome list instead of duplicating the biome data for each
coordinate. This reduces the size of the processed data and speeds up
encoding/decoding.
2023-08-03 23:07:16 +02:00
429b7888f6
world/de: add level.dat data structures
We only need the spawn point from level.dat.
2023-07-02 23:08:43 +02:00
42cb342749
world/layer: avoid iproduct-based iterator in inner loop
iproduct iterators are fairly slow. As the iterator implementation is
now unused, it is removed as well.
2023-05-10 00:48:53 +02:00
31eb92864c
Split up BlockInfo type
By storing block types and depth values separately, the processed world
data can be compressed better, decreasing data size by ~10%.
2023-05-06 00:52:40 +02:00
0b392d7a3a
world/layer: move more top_layer() logic into LayerEntry::fill() 2023-05-06 00:33:34 +02:00
0437ec70b6
world/layer: introduce LayerEntry struct 2023-05-06 00:33:13 +02:00
2d5eec13c2
world/layer: move Option into BlockInfo struct
Preparation for top_layer() cleanup.
2023-05-05 23:29:57 +02:00
263fc6d6ce
world/layer: remove unused y coordinate from BlockInfo 2023-05-05 23:15:34 +02:00
924ee01f91
world/layer: introduce LayerData struct to fix clippy type complexity warning 2023-05-05 23:08:39 +02:00
e912f60ba3
world/layer: add biome data to returned layer 2023-04-09 22:56:02 +02:00
0d2c99dacf
world/chunk: include biomes in section iterator item 2023-04-08 21:20:00 +02:00
ddc515a9d7
world/section: implement biome_at() 2023-04-08 21:20:00 +02:00
aa2edc3d13
world/section: move biome_types field out of BiomesV0 enum 2023-04-08 21:20:00 +02:00
c6843cfb9c
world: resolve biome palette entries for v1.18 biome data 2023-04-07 09:38:31 +02:00
b8b0e0627f
world: correctly name BiomesV1_18 2023-04-07 09:37:02 +02:00
e117c76937 world: pass biome data into chunk/section structures 2023-04-07 09:34:56 +02:00
f2b7808e84
world: distinguish pre-v1.18 biome data structures 2023-04-02 18:17:13 +02:00
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