diff --git a/overviewer_core/src/block_class.c b/overviewer_core/src/block_class.c index c07f47d..6112260 100644 --- a/overviewer_core/src/block_class.c +++ b/overviewer_core/src/block_class.c @@ -164,7 +164,6 @@ const mc_block_t block_class_ancil[] = { block_flowing_water, block_water, block_glass, - block_chest, block_redstone_wire, block_ice, block_fence, @@ -190,7 +189,6 @@ const mc_block_t block_class_ancil[] = { block_double_plant, block_stained_glass_pane, block_stained_glass, - block_trapped_chest, block_spruce_fence, block_birch_fence, block_jungle_fence, diff --git a/overviewer_core/src/iterate.c b/overviewer_core/src/iterate.c index f27e400..3635090 100644 --- a/overviewer_core/src/iterate.c +++ b/overviewer_core/src/iterate.c @@ -316,43 +316,6 @@ generate_pseudo_data(RenderState* state, uint16_t ancilData) { } return final_data; - } else if (block_class_is_subset(state->block, (mc_block_t[]){block_chest, block_trapped_chest}, 2)) { - /* Orientation is given by ancilData, pseudo data needed to - * choose from single or double chest and the correct half of - * the chest. */ - - /* Add two bits to ancilData to store single or double chest - * and which half of the chest it is: bit 0x10 = second half - * bit 0x8 = first half */ - - uint8_t chest_data = 0, final_data = 0; - - /* search for adjacent chests of the same type */ - chest_data = check_adjacent_blocks(state, x, y, z, state->block); - - if (chest_data == 1) { /* another chest in the upper-left */ - final_data = final_data | 0x10 | ancilData; - - } else if (chest_data == 2) { /* in the bottom-left */ - final_data = final_data | 0x8 | ancilData; - - } else if (chest_data == 4) { /*in the bottom-right */ - final_data = final_data | 0x8 | ancilData; - - } else if (chest_data == 8) { /*in the upper-right */ - final_data = final_data | 0x10 | ancilData; - - } else if (chest_data == 0) { - /* Single chest, determine the orientation */ - final_data = ancilData; - - } else { - /* more than one adjacent chests! That shouldn't be - * possible! render as normal chest */ - return 0; - } - return final_data; - } else if (block_class_is_subset(state->block, (mc_block_t[]){block_iron_bars, block_glass_pane, block_stained_glass_pane}, 3)) { /* iron bars and glass panes: * they seem to stick to almost everything but air, diff --git a/overviewer_core/src/overviewer.h b/overviewer_core/src/overviewer.h index 3debcf9..a65da08 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 80 +#define OVERVIEWER_EXTENSION_VERSION 81 #include #include diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 30788cf..1c34ee6 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -2341,7 +2341,8 @@ def chests(self, blockid, data): alpha_over(side_r, side_r_top, (1, 1)) alpha_over(side_r, side_r_bottom, (1, 5)) - if data & 24 == 8: # double chest, first half + # double chest, left half + if ((data & 24 == 8 and data & 7 in [3, 5]) or (data & 24 == 16 and data & 7 in [2, 4])): top = top.crop((0, 0, 16, 16)) top.load() front = front.crop((0, 0, 16, 16)) @@ -2350,7 +2351,8 @@ def chests(self, blockid, data): back.load() #~ side = side_l - elif data & 24 == 16: # double, second half + # double chest, right half + elif ((data & 24 == 16 and data & 7 in [3, 5]) or (data & 24 == 8 and data & 7 in [2, 4])): top = top.crop((16, 0, 32, 16)) top.load() front = front.crop((16, 0, 32, 16)) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 19e69f0..db41f2f 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -1022,6 +1022,10 @@ class RegionSet(object): elif key in ['minecraft:ladder', 'minecraft:chest', 'minecraft:ender_chest', 'minecraft:trapped_chest', 'minecraft:furnace']: facing = palette_entry['Properties']['facing'] data = {'north': 2, 'south': 3, 'west': 4, 'east': 5}[facing] + if key in ['minecraft:chest', 'minecraft:trapped_chest']: + # type property should exist, but default to 'single' just in case + chest_type = palette_entry['Properties'].get('type', 'single') + data |= {'left': 0x8, 'right': 0x10, 'single': 0x0}[chest_type] elif key in ['minecraft:beehive', 'minecraft:bee_nest']: facing = palette_entry['Properties']['facing'] honey_level = int(palette_entry['Properties']['honey_level'])