0

Fix biomes for Minecraft 1.15

Fixes #1650.

Mojang changed the biomes code so that it now can have different
biomes for different Y levels. We need to adjust our logic accordingly,
which is done through some small BiomeDispensary class where we shove
a numpy'd Mojang array in and can then read out the biomes for each level.

Biome data is now stored per-section, which needed some changes on the C
side of things. I didn't change anything in the biome overlay code so
I wouldn't be surprised if it's broken now, but for the time being I'd
rather have 1.15 fixed than some obscure overlay.

Tested to work with 1.14 and 1.15 data. No new biomes have been added
to the code yet.
This commit is contained in:
Nicolas F
2019-12-10 23:12:16 +01:00
parent 9607636d49
commit 268938a706
4 changed files with 57 additions and 14 deletions

View File

@@ -31,7 +31,7 @@
// increment this value if you've made a change to the c extesion
// and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 77
#define OVERVIEWER_EXTENSION_VERSION 78
#include <stdbool.h>
#include <stdint.h>
@@ -87,7 +87,7 @@ typedef struct {
/* all the sections in a given chunk */
struct {
/* all there is to know about each section */
PyArrayObject *blocks, *data, *skylight, *blocklight;
PyArrayObject *blocks, *data, *skylight, *blocklight, *biomes;
} sections[SECTIONS_PER_CHUNK];
} ChunkData;
typedef struct {
@@ -210,7 +210,7 @@ static inline uint32_t get_data(RenderState* state, DataType type, int32_t x, in
data_array = state->chunks[chunkx][chunkz].sections[chunky].skylight;
break;
case BIOMES:
data_array = state->chunks[chunkx][chunkz].biomes;
data_array = state->chunks[chunkx][chunkz].sections[chunky].biomes;
};
if (data_array == NULL)