From 1d40ea77d424a5d834192f762563840f21c135c1 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Wed, 5 Aug 2020 19:01:52 +0200 Subject: [PATCH] nether: move nether roof blocks into new class --- overviewer_core/src/block_class.c | 12 ++++++++++++ overviewer_core/src/block_class.h | 3 +++ overviewer_core/src/overviewer.h | 2 +- overviewer_core/src/primitives/nether.c | 4 +--- 4 files changed, 17 insertions(+), 4 deletions(-) diff --git a/overviewer_core/src/block_class.c b/overviewer_core/src/block_class.c index aeb5281..f895d60 100644 --- a/overviewer_core/src/block_class.c +++ b/overviewer_core/src/block_class.c @@ -259,3 +259,15 @@ const mc_block_t block_class_alt_height[] = { block_purpur_slab, block_wooden_slab}; const size_t block_class_alt_height_len = COUNT_OF(block_class_alt_height); + +const mc_block_t block_class_nether_roof[] = { + block_bedrock, + block_netherrack, + block_quartz_ore, + block_lava, + block_soul_sand, + block_basalt, + block_blackstone, + block_soul_soil, + block_nether_gold_ore}; +const size_t block_class_nether_roof_len = COUNT_OF(block_class_nether_roof); diff --git a/overviewer_core/src/block_class.h b/overviewer_core/src/block_class.h index 7071d70..086e8e1 100644 --- a/overviewer_core/src/block_class.h +++ b/overviewer_core/src/block_class.h @@ -48,4 +48,7 @@ extern const size_t block_class_ancil_len; extern const mc_block_t block_class_alt_height[]; extern const size_t block_class_alt_height_len; +extern const mc_block_t block_class_nether_roof[]; +extern const size_t block_class_nether_roof_len; + #endif diff --git a/overviewer_core/src/overviewer.h b/overviewer_core/src/overviewer.h index 670307c..4771323 100644 --- a/overviewer_core/src/overviewer.h +++ b/overviewer_core/src/overviewer.h @@ -31,7 +31,7 @@ // increment this value if you've made a change to the c extension // and want to force users to rebuild -#define OVERVIEWER_EXTENSION_VERSION 89 +#define OVERVIEWER_EXTENSION_VERSION 90 #include #include diff --git a/overviewer_core/src/primitives/nether.c b/overviewer_core/src/primitives/nether.c index 02e632f..ada8a47 100644 --- a/overviewer_core/src/primitives/nether.c +++ b/overviewer_core/src/primitives/nether.c @@ -37,9 +37,7 @@ walk_chunk(RenderState* state, RenderPrimitiveNether* data) { for (y = NETHER_ROOF - 1; y >= 0; y--) { blockid = get_data(state, BLOCKS, x, y - (state->chunky * 16), z); - if (block_class_is_subset(blockid, (mc_block_t[]){block_bedrock, block_netherrack, - block_quartz_ore, block_lava, block_soul_sand, block_basalt, block_blackstone, - block_soul_soil, block_nether_gold_ore}, 9)) + if (block_class_is_subset(blockid, block_class_nether_roof, block_class_nether_roof_len)) data->remove_block[x + 1][y][z + 1] = true; else break;