0

nether: move nether roof blocks into new class

This commit is contained in:
Nicolas F
2020-08-05 19:01:52 +02:00
parent 0776bf0a93
commit 1d40ea77d4
4 changed files with 17 additions and 4 deletions

View File

@@ -259,3 +259,15 @@ const mc_block_t block_class_alt_height[] = {
block_purpur_slab, block_purpur_slab,
block_wooden_slab}; block_wooden_slab};
const size_t block_class_alt_height_len = COUNT_OF(block_class_alt_height); 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);

View File

@@ -48,4 +48,7 @@ extern const size_t block_class_ancil_len;
extern const mc_block_t block_class_alt_height[]; extern const mc_block_t block_class_alt_height[];
extern const size_t block_class_alt_height_len; 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 #endif

View File

@@ -31,7 +31,7 @@
// increment this value if you've made a change to the c extension // increment this value if you've made a change to the c extension
// and want to force users to rebuild // and want to force users to rebuild
#define OVERVIEWER_EXTENSION_VERSION 89 #define OVERVIEWER_EXTENSION_VERSION 90
#include <stdbool.h> #include <stdbool.h>
#include <stdint.h> #include <stdint.h>

View File

@@ -37,9 +37,7 @@ walk_chunk(RenderState* state, RenderPrimitiveNether* data) {
for (y = NETHER_ROOF - 1; y >= 0; y--) { for (y = NETHER_ROOF - 1; y >= 0; y--) {
blockid = get_data(state, BLOCKS, x, y - (state->chunky * 16), z); blockid = get_data(state, BLOCKS, x, y - (state->chunky * 16), z);
if (block_class_is_subset(blockid, (mc_block_t[]){block_bedrock, block_netherrack, if (block_class_is_subset(blockid, block_class_nether_roof, block_class_nether_roof_len))
block_quartz_ore, block_lava, block_soul_sand, block_basalt, block_blackstone,
block_soul_soil, block_nether_gold_ore}, 9))
data->remove_block[x + 1][y][z + 1] = true; data->remove_block[x + 1][y][z + 1] = true;
else else
break; break;