Commit graph

40 commits

Author SHA1 Message Date
fac2e4c8da
World: Chunk: add support for unordered sections
MC1.18 doesn't always store sections sorted by their Y value, possibly
related to "optimize world".
2021-12-12 12:18:18 +01:00
baa20494bf
World: Section: implement new section-based biome data format 2021-12-11 22:50:24 +01:00
aacea26716
World: add support for negative Y coordinates and MC 1.18 chunks
MC 1.18 biomes are not handled yet.
2021-12-11 22:50:23 +01:00
9ee1007ade
World: Chunk: use enum to store biome data format 2021-12-11 22:50:23 +01:00
21966252ea
World: ChunkData: make getRoot() return shared pointer reference 2021-12-11 22:50:23 +01:00
16a1258f08
World: Chunk: remove unnecessary level class member 2021-12-11 22:50:23 +01:00
0f6c467566
World: Chunk: replace division/modulo with shift/mask for height values
Preparation for negative y coordinates.
2021-12-11 22:50:23 +01:00
457e993c92
Introduce separate types for block/section/chunk indices
Newtypes are cumbersome in C++, so this is mostly documentation for now.

Also replace lots of questionable uses of size_t with int or types with
explicit width and add a few comments for constants.
2021-12-11 22:50:23 +01:00
fd4773c8ca
treewide: replace license headers with SPDX-License-Identifier 2021-11-17 12:07:56 +01:00
38d8bd0738
Chunk: replace withDepth argument with extensible flags field 2021-08-24 21:03:18 +02:00
03ae9cf302
Exclude unpopulated chunks from biome averaging
Avoids weirdly colored stripes at the edges of the map.
2020-06-20 12:17:24 +02:00
50f798f89e
Do not store biome in block structure
Use biome data from biome map.
2020-06-20 11:40:29 +02:00
072d664199
Separate top layer search from block data retrieval 2020-06-20 11:40:29 +02:00
f539d668eb
Collect biome data
We store the biome data as grayscale images, as biome indices are
represented as bytes and we get PNG compression for free.
2020-06-20 00:58:08 +02:00
ef4b6eac02
BlockType: replace list of booleans with flags bitfield 2020-06-18 23:38:21 +02:00
1f10707733
Chunk: add support for Minecraft 1.15 biome map 2019-12-11 21:37:00 +01:00
ae68c3bab4
Add quirk for stone_slab rename
The old stone_slab block from pre-1.14 has been renamed to
smooth_stone_slab, and the name stone_slab was reused for a new block.
Resolve the palette entry depending on the chunk's dataVersion.
2019-05-25 19:51:28 +02:00
fb097cbb79
Chunk: allow Chunks with empty Sections tag 2019-05-25 18:55:29 +02:00
210f651807
World: factor out Section handling to a generic interface 2018-07-24 20:06:54 +02:00
dd432af298
Resolve pre-1.13 block types by mapping them to 1.13 types 2018-07-24 19:26:40 +02:00
f1f783877f
NBT: rework type system 2018-07-21 18:11:59 +02:00
c082c8800c
Separate splitting of regions into chunks and actual parsing of chunk structure 2018-07-20 23:49:51 +02:00
b04e1cb056
BlockType: allow specifying visible and green value per damage value 2017-08-19 13:01:01 +02:00
c80f54cba7 Chunk: allow generating unlighted maps for chunks without light data 2015-09-19 23:01:41 +09:00
d677440f6d Chunk: fix check for chunks with missing light data 2015-09-19 21:44:51 +09:00
22bc6db52a Chunk: zero data buffers to avoid using unitialized data 2015-02-02 17:13:51 +01:00
1e5e315816 Chunk: refactor getTopLayer() 2015-02-02 00:46:39 +01:00
22b9cfcb8b Move ressource files to a separate directory 2015-02-02 00:31:52 +01:00
9b1d92387d Use biome data 2015-02-01 15:19:18 +01:00
e880f8997f Performance improvements 2015-02-01 14:35:31 +01:00
8b09f6f4ec Handle lighting and depth 2015-02-01 14:02:04 +01:00
d26fe3d9f8 Write PNG files
No biome colors or light levels yet...
2015-02-01 11:58:50 +01:00
cd45c4009c Compute top non-air layer
This doesn't yet ignore non-opaque blocks.
2015-02-01 07:47:22 +01:00
2d2671a686 Use buffer API for chunk decompression 2015-02-01 06:04:56 +01:00
18ed3d4c5d Further chunk parsing 2015-02-01 05:54:42 +01:00
8403a4e71c Start analyzing the chunks 2015-02-01 05:18:35 +01:00
8a8a41a800 Parse chunk data on demand 2015-02-01 04:14:42 +01:00
fc1fc8fbbc Use template argument for list subtype, extract further information from chunks 2015-02-01 03:21:57 +01:00
a6a2a62812 More convenient tag access 2015-02-01 01:38:20 +01:00
cbe6461882 Implement most of the chunk format 2015-02-01 00:27:01 +01:00