From bc56346badb15602fb3d33ab6a5444ad31fee04c Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Thu, 25 Jun 2020 22:49:06 +0200 Subject: [PATCH 1/8] Initial 1.16 block work - Add ancient debris - Add basalt - Add polished basalt - Add soul campfire --- .travis.yml | 2 +- docs/running.rst | 6 +++--- overviewer.py | 3 +++ overviewer_core/src/mc_id.h | 6 ++++++ overviewer_core/src/overviewer.h | 2 +- overviewer_core/textures.py | 32 +++++++++++++++++++++++++++----- overviewer_core/world.py | 13 +++++++++++-- 7 files changed, 52 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1f02d23..a5eee75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,7 +6,7 @@ python: - "3.7" - "3.8" env: - - MC_VERSION=1.15 + - MC_VERSION=1.16.1 before_install: - wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/Imaging.h - wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/ImagingUtils.h diff --git a/docs/running.rst b/docs/running.rst index ddeaa07..373cf48 100644 --- a/docs/running.rst +++ b/docs/running.rst @@ -273,14 +273,14 @@ If you want or need to provide your own textures, you have several options: :: - VERSION=1.15 + VERSION=1.16.1 mkdir -p ~/.minecraft/versions/${VERSION}/ wget https://overviewer.org/textures/${VERSION} -O ~/.minecraft/versions/${VERSION}/${VERSION}.jar If that's too confusing for you, then just take this single line and paste it into - a terminal to get 1.15 textures:: + a terminal to get 1.16 textures:: - wget https://overviewer.org/textures/1.15 -O ~/.minecraft/versions/1.15/1.15.jar + wget https://overviewer.org/textures/1.16.1 -O ~/.minecraft/versions/1.16.1/1.16.1.jar * You can also just run the launcher to install the client. diff --git a/overviewer.py b/overviewer.py index d4f30c8..29123af 100755 --- a/overviewer.py +++ b/overviewer.py @@ -239,6 +239,9 @@ def main(): f = tex.find_file("assets/minecraft/textures/block/grass_block_top.png", verbose=True) f = tex.find_file("assets/minecraft/textures/block/diamond_ore.png", verbose=True) f = tex.find_file("assets/minecraft/textures/block/acacia_planks.png", verbose=True) + # 1.16 + f = tex.find_file("assets/minecraft/textures/block/ancient_debris_top.png", + verbose=True) except IOError: logging.error("Could not find any texture files.") return 1 diff --git a/overviewer_core/src/mc_id.h b/overviewer_core/src/mc_id.h index 6637e2f..4ae570d 100644 --- a/overviewer_core/src/mc_id.h +++ b/overviewer_core/src/mc_id.h @@ -260,6 +260,12 @@ enum mc_block_id { block_structure_block = 255, block_jigsaw = 256, block_shulker_box = 257, + // 1.16 stuff + block_ancient_debris = 1000, + block_basalt = 1001, + block_polished_basalt = 1002, + block_soul_campfire = 1003, + block_prismarine_stairs = 11337, block_dark_prismarine_stairs = 11338, block_prismarine_brick_stairs = 11339, diff --git a/overviewer_core/src/overviewer.h b/overviewer_core/src/overviewer.h index b2f6190..a7da8d7 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 86 +#define OVERVIEWER_EXTENSION_VERSION 87 #include #include diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 25dd1eb..bb9994c 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -324,7 +324,7 @@ class Textures(object): if verbose: logging.info("Found %s in '%s'", filename, path) return open(path, mode) - raise TextureException("Could not find the textures while searching for '{0}'. Try specifying the 'texturepath' option in your config file.\nSet it to the path to a Minecraft Resource pack.\nAlternately, install the Minecraft client (which includes textures)\nAlso see \n(Remember, this version of Overviewer requires a 1.15-compatible resource pack)\n(Also note that I won't automatically use snapshots; you'll have to use the texturepath option to use a snapshot jar)".format(filename)) + raise TextureException("Could not find the textures while searching for '{0}'. Try specifying the 'texturepath' option in your config file.\nSet it to the path to a Minecraft Resource pack.\nAlternately, install the Minecraft client (which includes textures)\nAlso see \n(Remember, this version of Overviewer requires a 1.16-compatible resource pack)\n(Also note that I won't automatically use snapshots; you'll have to use the texturepath option to use a snapshot jar)".format(filename)) def load_image_texture(self, filename): # Textures may be animated or in a different resolution than 16x16. @@ -5459,18 +5459,21 @@ def barrel(self, blockid, data): return self.build_full_block(t_side.rotate(90), None, None, t_top, t_side.rotate(270)) -# Campfire -@material(blockid=11506, data=list(range(8)), solid=True, transparent=True, nospawn=True) +# Campfire (11506) and soul campfire (1003) +@material(blockid=[11506, 1003], data=list(range(8)), solid=True, transparent=True, nospawn=True) def campfire(self, blockid, data): # Do rotation, mask to not clobber lit data data = data & 0b100 | ((self.rotation + (data & 0b11)) % 4) + block_name = "campfire" if blockid == 11506 else "soul_campfire" # Load textures # Fire & lit log textures contain multiple tiles, since both are # 16px wide rely on load_image_texture() to crop appropriately - fire_raw_t = self.load_image_texture("assets/minecraft/textures/block/campfire_fire.png") + fire_raw_t = self.load_image_texture("assets/minecraft/textures/block/" + block_name + + "_fire.png") log_raw_t = self.load_image_texture("assets/minecraft/textures/block/campfire_log.png") - log_lit_raw_t = self.load_image_texture("assets/minecraft/textures/block/campfire_log_lit.png") + log_lit_raw_t = self.load_image_texture("assets/minecraft/textures/block/" + block_name + + "_log_lit.png") def create_tile(img_src, coord_crop, coord_paste, rot): # Takes an image, crops a region, optionally rotates the @@ -5683,3 +5686,22 @@ def bell(self, blockid, data): alpha_over(img, post_front_t, (0, 0), post_front_t) return img + + +# Ancient Debris +block(blockid=[1000], top_image="assets/minecraft/textures/block/ancient_debris_top.png", + side_image="assets/minecraft/textures/block/ancient_debris_side.png") + + +# Basalt +@material(blockid=[1001, 1002], data=list(range(3)), solid=True) +def basalt(self, blockid, data): + block_name = "polished_basalt" if blockid == 1002 else "basalt" + top = self.load_image_texture("assets/minecraft/textures/block/" + block_name + "_top.png") + side = self.load_image_texture("assets/minecraft/textures/block/" + block_name + "_side.png") + if data == 0: + return self.build_block(top, side) + elif data == 1: # east-west orientation + return self.build_full_block(side.rotate(90), None, None, top, side.rotate(90)) + elif data == 2: # north-south orientation + return self.build_full_block(side, None, None, side.rotate(270), top) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 5dcecad..e2535eb 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -686,6 +686,12 @@ class RegionSet(object): 'minecraft:tube_coral_fan': (8, 0), 'minecraft:tube_coral_wall_fan': (8, 0), + # Some 1.16 stuff that I'll arbitrarily shove in here due to ID bloat + 'minecraft:ancient_debris': (1000, 0), + 'minecraft:basalt': (1001, 0), + 'minecraft:polished_basalt': (1002, 0), + 'minecraft:soul_campfire': (1003, 0), + # New blocks 'minecraft:carved_pumpkin': (11300, 0), 'minecraft:spruce_pressure_plate': (11301, 0), @@ -1029,6 +1035,9 @@ class RegionSet(object): data = 3 if axis == 'z': data = 4 + elif key == 'minecraft:basalt' or key == 'minecraft:polished_basalt': + axis = palette_entry['Properties']['axis'] + data = {'y': 0, 'x': 1, 'z': 2}[axis] elif key in ['minecraft:redstone_torch','minecraft:redstone_wall_torch','minecraft:wall_torch']: if key.startswith('minecraft:redstone_') and palette_entry['Properties']['lit'] == 'true': block += 1 @@ -1141,7 +1150,7 @@ class RegionSet(object): # A moisture level of 7 has a different texture from other farmland data = 1 if palette_entry['Properties'].get('moisture', '0') == '7' else 0 elif key in ['minecraft:grindstone', 'minecraft:lectern', 'minecraft:campfire', - 'minecraft:bell']: + 'minecraft:bell', 'minecraft:soul_campfire']: p = palette_entry['Properties'] data = {'south': 0, 'west': 1, 'north': 2, 'east': 3}[p['facing']] if key == 'minecraft:grindstone': @@ -1149,7 +1158,7 @@ class RegionSet(object): elif key == 'minecraft:lectern': if p['has_book'] == 'true': data |= 4 - elif key == 'minecraft:campfire': + elif key == 'minecraft:campfire' or key == 'minecraft:soul_campfire': if p['lit'] == 'true': data |= 4 elif key == 'minecraft:bell': From fd2c0a057ad39aa98e3aefd6d52df5fe7356f0ea Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Thu, 25 Jun 2020 23:07:07 +0200 Subject: [PATCH 2/8] Add blackstone and netherite blocks --- overviewer_core/src/mc_id.h | 2 ++ overviewer_core/textures.py | 8 ++++++++ overviewer_core/world.py | 2 ++ 3 files changed, 12 insertions(+) diff --git a/overviewer_core/src/mc_id.h b/overviewer_core/src/mc_id.h index 4ae570d..0280b89 100644 --- a/overviewer_core/src/mc_id.h +++ b/overviewer_core/src/mc_id.h @@ -265,6 +265,8 @@ enum mc_block_id { block_basalt = 1001, block_polished_basalt = 1002, block_soul_campfire = 1003, + block_blackstone = 1004, + block_netherite_block = 1005, block_prismarine_stairs = 11337, block_dark_prismarine_stairs = 11338, diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index bb9994c..59e8e55 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -5705,3 +5705,11 @@ def basalt(self, blockid, data): return self.build_full_block(side.rotate(90), None, None, top, side.rotate(90)) elif data == 2: # north-south orientation return self.build_full_block(side, None, None, side.rotate(270), top) + + +# Blackstone block +block(blockid=[1004], top_image="assets/minecraft/textures/block/blackstone_top.png", + side_image="assets/minecraft/textures/block/blackstone.png") + +# Netherite +block(blockid=[1005], top_image="assets/minecraft/textures/block/netherite_block.png") diff --git a/overviewer_core/world.py b/overviewer_core/world.py index e2535eb..cfe9505 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -691,6 +691,8 @@ class RegionSet(object): 'minecraft:basalt': (1001, 0), 'minecraft:polished_basalt': (1002, 0), 'minecraft:soul_campfire': (1003, 0), + 'minecraft:blackstone': (1004, 0), + 'minecraft:netherite_block': (1005, 0), # New blocks 'minecraft:carved_pumpkin': (11300, 0), From a3e4812ca906146408171b34e3c313fcb5e7ee69 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Thu, 25 Jun 2020 23:15:48 +0200 Subject: [PATCH 3/8] world: skip zero-size region files Minecraft 1.16.1 loves writing these in singleplayer, and they cause a whole bunch of corruption warnings if we don't handle them in a special way like this. --- overviewer_core/world.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index cfe9505..6551dbd 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -288,7 +288,10 @@ class RegionSet(object): for x, y, regionfile in self._iterate_regionfiles(): # regionfile is a pathname - self.regionfiles[(x,y)] = (regionfile, os.path.getmtime(regionfile)) + if os.path.getsize(regionfile) != 0: + self.regionfiles[(x,y)] = (regionfile, os.path.getmtime(regionfile)) + else: + logging.debug("Skipping zero-size region file {}".format(regionfile)) self.empty_chunk = [None,None] logging.debug("Done scanning regions") From fcb3f2644dd0126339c3b353c489077b3c091ab0 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Mon, 13 Jul 2020 19:15:47 +0200 Subject: [PATCH 4/8] Shuffle around wall IDs, change wall check Previously, walls were all numbered at 21000+. This is bad because our blockmap is an array, so this caused our blockmap to take up 80 MiB of RAM in each worker process. This commit changes the wall numbering, and exploits some bitmasking to have the wall check run in constant time no matter how many walls there are. This is done with a simple mask and xor to check the prefix. RAM usage for the blockmap thus drops to like 44 MiB. This is in preparation for adding more walls for 1.16. --- overviewer_core/src/block_class.c | 24 ++++++------------- overviewer_core/src/block_class.h | 5 ++-- overviewer_core/src/iterate.c | 2 +- overviewer_core/src/mc_id.h | 38 +++++++++++++++++-------------- overviewer_core/textures.py | 30 ++++++++++++------------ overviewer_core/world.py | 29 ++++++++++++----------- 6 files changed, 60 insertions(+), 68 deletions(-) diff --git a/overviewer_core/src/block_class.c b/overviewer_core/src/block_class.c index 6112260..aeb5281 100644 --- a/overviewer_core/src/block_class.c +++ b/overviewer_core/src/block_class.c @@ -58,6 +58,13 @@ bool block_class_is_subset( return false; } +bool block_class_is_wall(mc_block_t block) { + mc_block_t mask = 0b11111111; + mc_block_t prefix = 0b111 << 8; // 1792 is the starting offset + // if the xor zeroes all bits, the prefix must've matched. + return (block & ~mask) ^ prefix == 0; +} + const mc_block_t block_class_stair[] = { block_oak_stairs, block_brick_stairs, @@ -252,20 +259,3 @@ 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_wall[] = { - block_andesite_wall, - block_brick_wall, - block_cobblestone_wall, - block_diorite_wall, - block_end_stone_brick_wall, - block_granite_wall, - block_mossy_cobblestone_wall, - block_mossy_stone_brick_wall, - block_nether_brick_wall, - block_prismarine_wall, - block_red_nether_brick_wall, - block_red_sandstone_wall, - block_sandstone_wall, - block_stone_brick_wall}; -const size_t block_class_wall_len = COUNT_OF(block_class_wall); diff --git a/overviewer_core/src/block_class.h b/overviewer_core/src/block_class.h index 58926fa..7071d70 100644 --- a/overviewer_core/src/block_class.h +++ b/overviewer_core/src/block_class.h @@ -28,6 +28,8 @@ bool block_class_is_subset( const mc_block_t block_class[], size_t block_class_len); +bool block_class_is_wall(mc_block_t block); + extern const mc_block_t block_class_stair[]; extern const size_t block_class_stair_len; @@ -46,7 +48,4 @@ 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_wall[]; -extern const size_t block_class_wall_len; - #endif diff --git a/overviewer_core/src/iterate.c b/overviewer_core/src/iterate.c index 3635090..262c28f 100644 --- a/overviewer_core/src/iterate.c +++ b/overviewer_core/src/iterate.c @@ -354,7 +354,7 @@ generate_pseudo_data(RenderState* state, uint16_t ancilData) { } } return data; - } else if (block_class_is_subset(state->block, block_class_wall, block_class_wall_len)) { + } else if (block_class_is_wall(state->block)) { /* check for walls and add one bit with the type of wall (mossy or cobblestone)*/ if (ancilData == 0x1) { return check_adjacent_blocks(state, x, y, z, state->block) | 0x10; diff --git a/overviewer_core/src/mc_id.h b/overviewer_core/src/mc_id.h index 0280b89..3e825cc 100644 --- a/overviewer_core/src/mc_id.h +++ b/overviewer_core/src/mc_id.h @@ -268,6 +268,26 @@ enum mc_block_id { block_blackstone = 1004, block_netherite_block = 1005, + // adding a gap in the numbering of walls to keep them all + // in one numbering block starting at 1792 + // all blocks between 1792 and 2047 are considered walls + // this is because our check looks for the prefix 0b11100000000 + block_andesite_wall = 1792, + block_brick_wall = 1793, + block_cobblestone_wall = 1794, + block_diorite_wall = 1795, + block_end_stone_brick_wall = 1796, + block_granite_wall = 1797, + block_mossy_cobblestone_wall = 1798, + block_mossy_stone_brick_wall = 1799, + block_nether_brick_wall = 1800, + block_prismarine_wall = 1801, + block_red_nether_brick_wall = 1802, + block_red_sandstone_wall = 1803, + block_sandstone_wall = 1804, + block_stone_brick_wall = 1805, + // end of walls + block_prismarine_stairs = 11337, block_dark_prismarine_stairs = 11338, block_prismarine_brick_stairs = 11339, @@ -344,23 +364,7 @@ enum mc_block_id { block_honey_block = 11504, block_sweet_berry_bush = 11505, block_campfire = 11506, - block_bell = 11507, - // adding a gap in the numbering of walls to keep them all - // in one numbering block starting at 21000 - block_andesite_wall = 21000, - block_brick_wall = 21001, - block_cobblestone_wall = 21002, - block_diorite_wall = 21003, - block_end_stone_brick_wall = 21004, - block_granite_wall = 21005, - block_mossy_cobblestone_wall = 21006, - block_mossy_stone_brick_wall = 21007, - block_nether_brick_wall = 21008, - block_prismarine_wall = 21009, - block_red_nether_brick_wall = 21010, - block_red_sandstone_wall = 21011, - block_sandstone_wall = 21012, - block_stone_brick_wall = 21013 + block_bell = 11507 }; typedef uint16_t mc_block_t; diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 59e8e55..d0d7f27 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -4691,24 +4691,24 @@ def beacon(self, blockid, data): # cobblestone and mossy cobblestone walls, chorus plants, mossy stone brick walls # one additional bit of data value added for mossy and cobblestone -@material(blockid=[199]+list(range(21000,21013+1)), data=list(range(32)), transparent=True, nospawn=True) +@material(blockid=[199]+list(range(1792, 1805 + 1)), data=list(range(32)), transparent=True, nospawn=True) def cobblestone_wall(self, blockid, data): walls_id_to_tex = { 199: "assets/minecraft/textures/block/chorus_plant.png", # chorus plants - 21000: "assets/minecraft/textures/block/andesite.png", - 21001: "assets/minecraft/textures/block/bricks.png", - 21002: "assets/minecraft/textures/block/cobblestone.png", - 21003: "assets/minecraft/textures/block/diorite.png", - 21004: "assets/minecraft/textures/block/end_stone_bricks.png", - 21005: "assets/minecraft/textures/block/granite.png", - 21006: "assets/minecraft/textures/block/mossy_cobblestone.png", - 21007: "assets/minecraft/textures/block/mossy_stone_bricks.png", - 21008: "assets/minecraft/textures/block/nether_bricks.png", - 21009: "assets/minecraft/textures/block/prismarine.png", - 21010: "assets/minecraft/textures/block/red_nether_bricks.png", - 21011: "assets/minecraft/textures/block/red_sandstone.png", - 21012: "assets/minecraft/textures/block/sandstone.png", - 21013: "assets/minecraft/textures/block/stone_bricks.png" + 1792: "assets/minecraft/textures/block/andesite.png", + 1793: "assets/minecraft/textures/block/bricks.png", + 1794: "assets/minecraft/textures/block/cobblestone.png", + 1795: "assets/minecraft/textures/block/diorite.png", + 1796: "assets/minecraft/textures/block/end_stone_bricks.png", + 1797: "assets/minecraft/textures/block/granite.png", + 1798: "assets/minecraft/textures/block/mossy_cobblestone.png", + 1799: "assets/minecraft/textures/block/mossy_stone_bricks.png", + 1800: "assets/minecraft/textures/block/nether_bricks.png", + 1801: "assets/minecraft/textures/block/prismarine.png", + 1802: "assets/minecraft/textures/block/red_nether_bricks.png", + 1803: "assets/minecraft/textures/block/red_sandstone.png", + 1804: "assets/minecraft/textures/block/sandstone.png", + 1805: "assets/minecraft/textures/block/stone_bricks.png" } t = self.load_image_texture(walls_id_to_tex[blockid]).copy() diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 6551dbd..52cf8c6 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -814,21 +814,20 @@ class RegionSet(object): 'minecraft:campfire': (11506, 0), 'minecraft:bell': (11507, 0), # adding a gap in the numbering of walls to keep them all - # in one numbering block starting at 21000 - 'minecraft:andesite_wall': (21000, 0), - 'minecraft:brick_wall': (21001, 0), - 'minecraft:cobblestone_wall': (21002, 0), - 'minecraft:diorite_wall': (21003, 0), - 'minecraft:end_stone_brick_wall': (21004, 0), - 'minecraft:granite_wall': (21005, 0), - 'minecraft:mossy_cobblestone_wall': (21006, 0), - 'minecraft:mossy_stone_brick_wall': (21007, 0), - 'minecraft:nether_brick_wall': (21008, 0), - 'minecraft:prismarine_wall': (21009, 0), - 'minecraft:red_nether_brick_wall': (21010, 0), - 'minecraft:red_sandstone_wall': (21011, 0), - 'minecraft:sandstone_wall': (21012, 0), - 'minecraft:stone_brick_wall': (21013, 0), + 'minecraft:andesite_wall': (1792, 0), + 'minecraft:brick_wall': (1793, 0), + 'minecraft:cobblestone_wall': (1794, 0), + 'minecraft:diorite_wall': (1795, 0), + 'minecraft:end_stone_brick_wall': (1796, 0), + 'minecraft:granite_wall': (1797, 0), + 'minecraft:mossy_cobblestone_wall': (1798, 0), + 'minecraft:mossy_stone_brick_wall': (1799, 0), + 'minecraft:nether_brick_wall': (1800, 0), + 'minecraft:prismarine_wall': (1801, 0), + 'minecraft:red_nether_brick_wall': (1802, 0), + 'minecraft:red_sandstone_wall': (1803, 0), + 'minecraft:sandstone_wall': (1804, 0), + 'minecraft:stone_brick_wall': (1805, 0), } colors = [ 'white', 'orange', 'magenta', 'light_blue', From 3ac090a7a07fb39fcf7aac65eeed475d06f1b4e3 Mon Sep 17 00:00:00 2001 From: InrcedibleHolg Date: Sun, 12 Jul 2020 11:23:43 +0200 Subject: [PATCH 5/8] nether biomes --- overviewer_core/src/mc_id.h | 12 ++++++++ overviewer_core/src/overviewer.h | 2 +- overviewer_core/textures.py | 52 +++++++++++++++++++++++++++++++- overviewer_core/world.py | 26 +++++++++++++++- 4 files changed, 89 insertions(+), 3 deletions(-) diff --git a/overviewer_core/src/mc_id.h b/overviewer_core/src/mc_id.h index 3e825cc..aabc748 100644 --- a/overviewer_core/src/mc_id.h +++ b/overviewer_core/src/mc_id.h @@ -267,6 +267,18 @@ enum mc_block_id { block_soul_campfire = 1003, block_blackstone = 1004, block_netherite_block = 1005, + block_warped_nylium = 1006, + block_crimson_nylium = 1007, + block_warped_wart_block = 1010, + block_shroomlight = 1011, + block_twisting_vines = 1012, + block_twisting_vines_plant = 1013, + block_weeping_vines = 1014, + block_weeping_vines_plant = 1015, + block_warped_fungus = 1016, + block_crimson_fungus = 1017, + block_warped_roots = 1018, + block_crimson_roots = 1019, // adding a gap in the numbering of walls to keep them all // in one numbering block starting at 1792 diff --git a/overviewer_core/src/overviewer.h b/overviewer_core/src/overviewer.h index a7da8d7..ef55ab6 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 87 +#define OVERVIEWER_EXTENSION_VERSION 88 #include #include diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index d0d7f27..aee4bb4 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -1077,7 +1077,8 @@ block(blockid=15, top_image="assets/minecraft/textures/block/iron_ore.png") # coal ore block(blockid=16, top_image="assets/minecraft/textures/block/coal_ore.png") -@material(blockid=[17,162,11306,11307,11308,11309,11310,11311], data=list(range(12)), solid=True) +@material(blockid=[17, 162, 11306, 11307, 11308, 11309, 11310, 11311, 1008, 1009], + data=list(range(12)), solid=True) def wood(self, blockid, data): # extract orientation and wood type frorm data bits wood_type = data & 3 @@ -1172,6 +1173,32 @@ def wood(self, blockid, data): if wood_type == 3: # jungle wood top = self.load_image_texture("assets/minecraft/textures/block/stripped_jungle_log.png") side = top + if blockid == 1008: # nether logs aka stem + if wood_type == 0: # warped_stem + top = self.load_image_texture("assets/minecraft/textures/block/warped_stem_top.png") + side = self.load_image_texture("assets/minecraft/textures/block/warped_stem.png") + if wood_type == 1: # stripped_warped_stem + top = self.load_image_texture("assets/minecraft/textures/block/warped_stem_top.png") + side = self.load_image_texture("assets/minecraft/textures/block/stripped_warped_stem.png") + if wood_type == 2: # crimson_stem + top = self.load_image_texture("assets/minecraft/textures/block/crimson_stem_top.png") + side = self.load_image_texture("assets/minecraft/textures/block/crimson_stem.png") + if wood_type == 3: # crimson_stem + top = self.load_image_texture("assets/minecraft/textures/block/crimson_stem_top.png") + side = self.load_image_texture("assets/minecraft/textures/block/stripped_crimson_stem.png") + if blockid == 1009: # nether hyphae + if wood_type == 0: # warped_hyphae + top = self.load_image_texture("assets/minecraft/textures/block/warped_stem.png") + side = top + if wood_type == 1: # stripped_warped_hyphae + top = self.load_image_texture("assets/minecraft/textures/block/stripped_warped_stem.png") + side = top + if wood_type == 2: # crimson_hyphae + top = self.load_image_texture("assets/minecraft/textures/block/crimson_stem.png") + side = top + if wood_type == 3: # stripped_crimson_hyphae + top = self.load_image_texture("assets/minecraft/textures/block/stripped_crimson_stem.png") + side = top elif blockid == 11311: # stripped acacia/dark wood: if wood_type == 0: # acacia top = self.load_image_texture("assets/minecraft/textures/block/stripped_acacia_log.png") @@ -1688,6 +1715,15 @@ def flower(self, blockid, data): sprite(blockid=39, imagename="assets/minecraft/textures/block/brown_mushroom.png") # red mushroom sprite(blockid=40, imagename="assets/minecraft/textures/block/red_mushroom.png") +# warped fungus +sprite(blockid=1016, imagename="assets/minecraft/textures/block/warped_fungus.png") +# crimson fungus +sprite(blockid=1017, imagename="assets/minecraft/textures/block/crimson_fungus.png") +# warped roots +sprite(blockid=1018, imagename="assets/minecraft/textures/block/warped_roots.png") +# crimson roots +sprite(blockid=1019, imagename="assets/minecraft/textures/block/crimson_roots.png") + # block of gold block(blockid=41, top_image="assets/minecraft/textures/block/gold_block.png") # block of iron @@ -3666,6 +3702,8 @@ block(blockid=88, top_image="assets/minecraft/textures/block/soul_sand.png") # glowstone block(blockid=89, top_image="assets/minecraft/textures/block/glowstone.png") +# shroomlight +block(blockid=1011, top_image="assets/minecraft/textures/block/shroomlight.png") # portal @material(blockid=90, data=[1, 2, 4, 5, 8, 10], transparent=True) @@ -4225,6 +4263,12 @@ def stem(self, blockid, data): return img +# nether vines +billboard(blockid=1012, imagename="assets/minecraft/textures/block/twisting_vines.png") +billboard(blockid=1013, imagename="assets/minecraft/textures/block/twisting_vines_plant.png") +billboard(blockid=1014, imagename="assets/minecraft/textures/block/weeping_vines.png") +billboard(blockid=1015, imagename="assets/minecraft/textures/block/weeping_vines_plant.png") + # vines @material(blockid=106, data=list(range(32)), transparent=True, solid=False, nospawn=True) def vines(self, blockid, data): @@ -4234,6 +4278,7 @@ def vines(self, blockid, data): # 1 UNWSE # 2 UWSEN # 3 USENW + if self.rotation in [1, 2, 3]: bit_map = {1: [5, 3, 2, 1, 4], 2: [5, 2, 1, 4, 3], @@ -4359,6 +4404,9 @@ def fence_gate(self, blockid, data): # mycelium block(blockid=110, top_image="assets/minecraft/textures/block/mycelium_top.png", side_image="assets/minecraft/textures/block/mycelium_side.png") +# warped_nylium & crimson_nylium +block(blockid=1006, top_image="assets/minecraft/textures/block/warped_nylium.png", side_image="assets/minecraft/textures/block/warped_nylium_side.png") +block(blockid=1007, top_image="assets/minecraft/textures/block/crimson_nylium.png", side_image="assets/minecraft/textures/block/crimson_nylium_side.png") # lilypad # At the moment of writing this lilypads has no ancil data and their @@ -5151,6 +5199,8 @@ block(blockid=213, top_image="assets/minecraft/textures/block/magma.png") # nether wart block block(blockid=214, top_image="assets/minecraft/textures/block/nether_wart_block.png") +# warped wart block +block(blockid=1010, top_image="assets/minecraft/textures/block/warped_wart_block.png") # red nether brick block(blockid=215, top_image="assets/minecraft/textures/block/red_nether_bricks.png") diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 52cf8c6..516e057 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -696,6 +696,29 @@ class RegionSet(object): 'minecraft:soul_campfire': (1003, 0), 'minecraft:blackstone': (1004, 0), 'minecraft:netherite_block': (1005, 0), + 'minecraft:warped_nylium': (1006, 0), + 'minecraft:crimson_nylium': (1007, 0), + # Nether logs aka stem + 'minecraft:warped_stem': (1008, 0), + 'minecraft:stripped_warped_stem': (1008, 1), + 'minecraft:crimson_stem': (1008, 2), + 'minecraft:stripped_crimson_stem': (1008, 3), + # hyphae + 'minecraft:warped_hyphae': (1009, 0), + 'minecraft:stripped_warped_hyphae': (1009, 1), + 'minecraft:crimson_hyphae': (1009, 2), + 'minecraft:stripped_crimson_hyphae': (1009, 3), + # nether biomes + 'minecraft:warped_wart_block': (1010, 0), + 'minecraft:shroomlight': (1011, 0), + 'minecraft:twisting_vines': (1012, 0), + 'minecraft:twisting_vines_plant': (1013, 0), + 'minecraft:weeping_vines': (1014, 0), + 'minecraft:weeping_vines_plant': (1015, 0), + 'minecraft:warped_fungus': (1016, 0), + 'minecraft:crimson_fungus': (1017, 0), + 'minecraft:warped_roots': (1018, 0), + 'minecraft:crimson_roots': (1019, 0), # New blocks 'minecraft:carved_pumpkin': (11300, 0), @@ -1027,7 +1050,8 @@ class RegionSet(object): (key == 'minecraft:piston_head' and p.get('type', 'normal') == 'sticky') or (key == 'minecraft:observer' and p.get('powered', 'false') == 'true')): data |= 0x08 - elif key.endswith('_log') or key.endswith('_wood') or key == 'minecraft:bone_block': + elif (key.endswith('_log') or key.endswith('_wood') or + key == 'minecraft:bone_block' or key.endswith('_stem')): axis = palette_entry['Properties']['axis'] if axis == 'x': data |= 4 From 0a9d1961c55b77722b19cb01c7e24165c81c68c9 Mon Sep 17 00:00:00 2001 From: InrcedibleHolg Date: Tue, 4 Aug 2020 19:20:09 +0200 Subject: [PATCH 6/8] add soul_soil, nether_gold_ore, removelist --- overviewer_core/src/mc_id.h | 3 ++- overviewer_core/src/overviewer.h | 2 +- overviewer_core/src/primitives/nether.c | 4 +++- overviewer_core/textures.py | 6 ++++++ overviewer_core/world.py | 2 ++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/overviewer_core/src/mc_id.h b/overviewer_core/src/mc_id.h index aabc748..903bad2 100644 --- a/overviewer_core/src/mc_id.h +++ b/overviewer_core/src/mc_id.h @@ -279,7 +279,8 @@ enum mc_block_id { block_crimson_fungus = 1017, block_warped_roots = 1018, block_crimson_roots = 1019, - + block_soul_soil = 1020, + block_nether_gold_ore = 1021, // adding a gap in the numbering of walls to keep them all // in one numbering block starting at 1792 // all blocks between 1792 and 2047 are considered walls diff --git a/overviewer_core/src/overviewer.h b/overviewer_core/src/overviewer.h index ef55ab6..670307c 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 88 +#define OVERVIEWER_EXTENSION_VERSION 89 #include #include diff --git a/overviewer_core/src/primitives/nether.c b/overviewer_core/src/primitives/nether.c index 9ef0299..02e632f 100644 --- a/overviewer_core/src/primitives/nether.c +++ b/overviewer_core/src/primitives/nether.c @@ -37,7 +37,9 @@ 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}, 4)) + 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)) data->remove_block[x + 1][y][z + 1] = true; else break; diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index aee4bb4..09b1bee 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -4407,6 +4407,12 @@ block(blockid=110, top_image="assets/minecraft/textures/block/mycelium_top.png", # warped_nylium & crimson_nylium block(blockid=1006, top_image="assets/minecraft/textures/block/warped_nylium.png", side_image="assets/minecraft/textures/block/warped_nylium_side.png") block(blockid=1007, top_image="assets/minecraft/textures/block/crimson_nylium.png", side_image="assets/minecraft/textures/block/crimson_nylium_side.png") +# soul soil +soul_soil_texture="assets/minecraft/textures/block/soul_soil.png" +block(blockid=1020, top_image=soul_soil_texture, side_image=soul_soil_texture) +# nether gold ore +nether_gold_texture="assets/minecraft/textures/block/nether_gold_ore.png" +block(blockid=1021, top_image=nether_gold_texture, side_image=nether_gold_texture) # lilypad # At the moment of writing this lilypads has no ancil data and their diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 516e057..7e775fd 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -719,6 +719,8 @@ class RegionSet(object): 'minecraft:crimson_fungus': (1017, 0), 'minecraft:warped_roots': (1018, 0), 'minecraft:crimson_roots': (1019, 0), + 'minecraft:soul_soil': (1020, 0), + 'minecraft:nether_gold_ore': (1021, 0), # New blocks 'minecraft:carved_pumpkin': (11300, 0), From 0776bf0a93a4d44ff3ec26a84588030ebbb63da5 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Wed, 5 Aug 2020 18:52:21 +0200 Subject: [PATCH 7/8] textures: fix various small nitpicks - don't redundantly declare a side image when it's the same as top - change wood blocks to get textures from a dict --- overviewer_core/textures.py | 189 +++++++++++++----------------------- 1 file changed, 65 insertions(+), 124 deletions(-) diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 09b1bee..0c470b2 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -30,6 +30,8 @@ import functools from . import util +BLOCKTEX = "assets/minecraft/textures/block/" + # global variables to collate information in @material decorators blockmap_generators = {} @@ -1090,125 +1092,67 @@ def wood(self, blockid, data): if wood_orientation == 4: wood_orientation = 8 elif wood_orientation == 8: wood_orientation = 4 - # choose textures - if blockid == 17: # regular wood: - if wood_type == 0: # normal - top = self.load_image_texture("assets/minecraft/textures/block/oak_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/oak_log.png") - if wood_type == 1: # spruce - top = self.load_image_texture("assets/minecraft/textures/block/spruce_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/spruce_log.png") - if wood_type == 2: # birch - top = self.load_image_texture("assets/minecraft/textures/block/birch_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/birch_log.png") - if wood_type == 3: # jungle wood - top = self.load_image_texture("assets/minecraft/textures/block/jungle_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/jungle_log.png") - elif blockid == 162: # acacia/dark wood: - if wood_type == 0: # acacia - top = self.load_image_texture("assets/minecraft/textures/block/acacia_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/acacia_log.png") - elif wood_type == 1: # dark oak - top = self.load_image_texture("assets/minecraft/textures/block/dark_oak_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/dark_oak_log.png") - else: - top = self.load_image_texture("assets/minecraft/textures/block/acacia_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/acacia_log.png") - if blockid == 11306: # stripped regular wood: - if wood_type == 0: # normal - top = self.load_image_texture("assets/minecraft/textures/block/stripped_oak_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/stripped_oak_log.png") - if wood_type == 1: # spruce - top = self.load_image_texture("assets/minecraft/textures/block/stripped_spruce_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/stripped_spruce_log.png") - if wood_type == 2: # birch - top = self.load_image_texture("assets/minecraft/textures/block/stripped_birch_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/stripped_birch_log.png") - if wood_type == 3: # jungle wood - top = self.load_image_texture("assets/minecraft/textures/block/stripped_jungle_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/stripped_jungle_log.png") - elif blockid == 11307: # stripped acacia/dark wood: - if wood_type == 0: # acacia - top = self.load_image_texture("assets/minecraft/textures/block/stripped_acacia_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/stripped_acacia_log.png") - elif wood_type == 1: # dark oak - top = self.load_image_texture("assets/minecraft/textures/block/stripped_dark_oak_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/stripped_dark_oak_log.png") - else: - top = self.load_image_texture("assets/minecraft/textures/block/stripped_acacia_log_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/stripped_acacia_log.png") - if blockid == 11308: # regular bark: - if wood_type == 0: # normal - top = self.load_image_texture("assets/minecraft/textures/block/oak_log.png") - side = top - if wood_type == 1: # spruce - top = self.load_image_texture("assets/minecraft/textures/block/spruce_log.png") - side = top - if wood_type == 2: # birch - top = self.load_image_texture("assets/minecraft/textures/block/birch_log.png") - side = top - if wood_type == 3: # jungle wood - top = self.load_image_texture("assets/minecraft/textures/block/jungle_log.png") - side = top - elif blockid == 11309: # acacia/dark bark: - if wood_type == 0: # acacia - top = self.load_image_texture("assets/minecraft/textures/block/acacia_log.png") - side = top - elif wood_type == 1: # dark oak - top = self.load_image_texture("assets/minecraft/textures/block/dark_oak_log.png") - side = top - else: - top = self.load_image_texture("assets/minecraft/textures/block/acacia_log.png") - side = top - if blockid == 11310: # stripped regular wood: - if wood_type == 0: # normal - top = self.load_image_texture("assets/minecraft/textures/block/stripped_oak_log.png") - side = top - if wood_type == 1: # spruce - top = self.load_image_texture("assets/minecraft/textures/block/stripped_spruce_log.png") - side = top - if wood_type == 2: # birch - top = self.load_image_texture("assets/minecraft/textures/block/stripped_birch_log.png") - side = top - if wood_type == 3: # jungle wood - top = self.load_image_texture("assets/minecraft/textures/block/stripped_jungle_log.png") - side = top - if blockid == 1008: # nether logs aka stem - if wood_type == 0: # warped_stem - top = self.load_image_texture("assets/minecraft/textures/block/warped_stem_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/warped_stem.png") - if wood_type == 1: # stripped_warped_stem - top = self.load_image_texture("assets/minecraft/textures/block/warped_stem_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/stripped_warped_stem.png") - if wood_type == 2: # crimson_stem - top = self.load_image_texture("assets/minecraft/textures/block/crimson_stem_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/crimson_stem.png") - if wood_type == 3: # crimson_stem - top = self.load_image_texture("assets/minecraft/textures/block/crimson_stem_top.png") - side = self.load_image_texture("assets/minecraft/textures/block/stripped_crimson_stem.png") - if blockid == 1009: # nether hyphae - if wood_type == 0: # warped_hyphae - top = self.load_image_texture("assets/minecraft/textures/block/warped_stem.png") - side = top - if wood_type == 1: # stripped_warped_hyphae - top = self.load_image_texture("assets/minecraft/textures/block/stripped_warped_stem.png") - side = top - if wood_type == 2: # crimson_hyphae - top = self.load_image_texture("assets/minecraft/textures/block/crimson_stem.png") - side = top - if wood_type == 3: # stripped_crimson_hyphae - top = self.load_image_texture("assets/minecraft/textures/block/stripped_crimson_stem.png") - side = top - elif blockid == 11311: # stripped acacia/dark wood: - if wood_type == 0: # acacia - top = self.load_image_texture("assets/minecraft/textures/block/stripped_acacia_log.png") - side = top - elif wood_type == 1: # dark oak - top = self.load_image_texture("assets/minecraft/textures/block/stripped_dark_oak_log.png") - side = top - else: - top = self.load_image_texture("assets/minecraft/textures/block/stripped_acacia_log.png") - side = top + # dictionary of blockid : { wood_type : (top, side) } + wood_tex = { + 17: { + 0: ("oak_log_top.png", "oak_log.png"), + 1: ("spruce_log_top.png", "spruce_log.png"), + 2: ("birch_log_top.png", "birch_log.png"), + 3: ("jungle_log_top.png", "jungle_log.png"), + }, + 162: { + 0: ("acacia_log_top.png", "acacia_log.png"), + 1: ("dark_oak_log_top.png", "dark_oak_log.png"), + }, + 11306: { + 0: ("stripped_oak_log_top.png", "stripped_oak_log.png"), + 1: ("stripped_spruce_log_top.png", "stripped_spruce_log.png"), + 2: ("stripped_birch_log_top.png", "stripped_birch_log.png"), + 3: ("stripped_jungle_log_top.png", "stripped_jungle_log.png"), + }, + 11307: { + 0: ("stripped_acacia_log_top.png", "stripped_acacia_log.png"), + 1: ("stripped_dark_oak_log_top.png", "stripped_dark_oak_log.png"), + }, + 11308: { + 0: ("oak_log.png", None), + 1: ("spruce_log.png", None), + 2: ("birch_log.png", None), + 3: ("jungle_log.png", None), + }, + 11309: { + 0: ("acacia_log.png", None), + 1: ("dark_oak_log.png", None), + }, + 11310: { + 0: ("stripped_oak_log.png", None), + 1: ("stripped_spruce_log.png", None), + 2: ("stripped_birch_log.png", None), + 3: ("stripped_jungle_log.png", None), + }, + 11311: { + 0: ("stripped_acacia_log.png", None), + 1: ("stripped_dark_oak_log.png", None), + }, + 1008: { + 0: ("warped_stem_top.png", "warped_stem.png"), + 1: ("warped_stem_top.png", "stripped_warped_stem.png"), + 2: ("crimson_stem_top.png", "crimson_stem.png"), + 3: ("crimson_stem_top.png", "stripped_crimson_stem.png"), + }, + 1009: { + 0: ("warped_stem.png", None), + 1: ("stripped_warped_stem.png", None), + 2: ("crimson_stem.png", None), + 3: ("stripped_crimson_stem.png", None), + } + } + + top_f, side_f = wood_tex[blockid].get(wood_type, wood_tex[blockid][0]) + if not side_f: + side_f = top_f + top = self.load_image_texture(BLOCKTEX + top_f) + side = self.load_image_texture(BLOCKTEX + side_f) # choose orientation and paste textures if wood_orientation == 0: @@ -4278,7 +4222,6 @@ def vines(self, blockid, data): # 1 UNWSE # 2 UWSEN # 3 USENW - if self.rotation in [1, 2, 3]: bit_map = {1: [5, 3, 2, 1, 4], 2: [5, 2, 1, 4, 3], @@ -4408,11 +4351,9 @@ block(blockid=110, top_image="assets/minecraft/textures/block/mycelium_top.png", block(blockid=1006, top_image="assets/minecraft/textures/block/warped_nylium.png", side_image="assets/minecraft/textures/block/warped_nylium_side.png") block(blockid=1007, top_image="assets/minecraft/textures/block/crimson_nylium.png", side_image="assets/minecraft/textures/block/crimson_nylium_side.png") # soul soil -soul_soil_texture="assets/minecraft/textures/block/soul_soil.png" -block(blockid=1020, top_image=soul_soil_texture, side_image=soul_soil_texture) +block(blockid=1020, top_image="assets/minecraft/textures/block/soul_soil.png") # nether gold ore -nether_gold_texture="assets/minecraft/textures/block/nether_gold_ore.png" -block(blockid=1021, top_image=nether_gold_texture, side_image=nether_gold_texture) +block(blockid=1021, top_image="assets/minecraft/textures/block/nether_gold_ore.png") # lilypad # At the moment of writing this lilypads has no ancil data and their From 1d40ea77d424a5d834192f762563840f21c135c1 Mon Sep 17 00:00:00 2001 From: Nicolas F Date: Wed, 5 Aug 2020 19:01:52 +0200 Subject: [PATCH 8/8] 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;