diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 8189fbe..57f560c 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -5096,59 +5096,30 @@ def concrete(self, blockid, data): texture = self.load_image_texture("assets/minecraft/textures/block/%s_concrete_powder.png" % color_map[data]) return self.build_block(texture, texture) + # Glazed Terracotta -@material(blockid=list(range(235,251)), data=list(range(8)), solid=True) +@material(blockid=list(range(235, 251)), data=list(range(4)), solid=True) def glazed_terracotta(self, blockid, data): - texture = self.load_image_texture("assets/minecraft/textures/block/%s_glazed_terracotta.png" % color_map[blockid - 235]) - glazed_terracotta_orientation = data & 3 - - # Glazed Terracotta rotations are need seperate handling for each render direction + # Do rotation + data = (self.rotation + data) % 4 - if self.rotation == 0: # rendering north upper-left - # choose orientation and paste textures - if glazed_terracotta_orientation == 0: # south / Player was facing North - return self.build_block(texture, texture) - elif glazed_terracotta_orientation == 1: # west / Player was facing east - return self.build_full_block(texture.rotate(270), None, None, texture.rotate(90), texture.rotate(270)) - elif glazed_terracotta_orientation == 2: # North / Player was facing South - return self.build_full_block(texture.rotate(180), None, None, texture.rotate(180), texture.rotate(180)) - elif glazed_terracotta_orientation == 3: # east / Player was facing west - return self.build_full_block(texture.rotate(90), None, None, texture.rotate(270), texture.rotate(90)) + texture = self.load_image_texture("assets/minecraft/textures/block/%s_glazed_terracotta.png" % + color_map[blockid - 235]).copy() + texture_side4 = texture.transpose(Image.FLIP_LEFT_RIGHT) + + if data == 0: # South + return self.build_full_block(texture, None, None, texture, texture_side4.rotate(270)) + elif data == 1: # West + return self.build_full_block(texture.rotate(270), None, None, texture.rotate(90), + texture_side4.rotate(180)) + elif data == 2: # North + return self.build_full_block(texture.rotate(180), None, None, texture.rotate(180), + texture_side4.rotate(90)) + elif data == 3: # East + return self.build_full_block(texture.rotate(90), None, None, texture.rotate(270), + texture_side4) - elif self.rotation == 1: # north upper-right - # choose orientation and paste textures - if glazed_terracotta_orientation == 0: # south / Player was facing North - return self.build_full_block(texture.rotate(270), None, None, texture.rotate(90), texture.rotate(270)) - elif glazed_terracotta_orientation == 1: # west / Player was facing east - return self.build_full_block(texture.rotate(180), None, None, texture.rotate(180), texture.rotate(180)) - elif glazed_terracotta_orientation == 2: # North / Player was facing South - return self.build_full_block(texture.rotate(90), None, None, texture.rotate(270), texture.rotate(90)) - elif glazed_terracotta_orientation == 3: # east / Player was facing west - return self.build_block(texture, texture) - - elif self.rotation == 2: # north lower-right - # choose orientation and paste textures - if glazed_terracotta_orientation == 0: # south / Player was facing North - return self.build_full_block(texture.rotate(180), None, None, texture.rotate(180), texture.rotate(180)) - elif glazed_terracotta_orientation == 1: # west / Player was facing east - return self.build_full_block(texture.rotate(90), None, None, texture.rotate(270), texture.rotate(90)) - elif glazed_terracotta_orientation == 2: # North / Player was facing South - return self.build_block(texture, texture) - elif glazed_terracotta_orientation == 3: # east / Player was facing west - return self.build_full_block(texture.rotate(270), None, None, texture.rotate(90), texture.rotate(270)) - - elif self.rotation == 3: # north lower-left - # choose orientation and paste textures - if glazed_terracotta_orientation == 0: # south / Player was facing North - return self.build_full_block(texture.rotate(90), None, None, texture.rotate(270), texture.rotate(90)) - elif glazed_terracotta_orientation == 1: # west / Player was facing east - return self.build_block(texture, texture) - elif glazed_terracotta_orientation == 2: # North / Player was facing South - return self.build_full_block(texture.rotate(270), None, None, texture.rotate(90), texture.rotate(270)) - elif glazed_terracotta_orientation == 3: # east / Player was facing west - return self.build_full_block(texture.rotate(180), None, None, texture.rotate(180), texture.rotate(180)) - # dried kelp block @material(blockid=11331, data=[0], solid=True) def sandstone(self, blockid, data): diff --git a/overviewer_core/world.py b/overviewer_core/world.py index c3cce39..ee68c0c 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -655,22 +655,6 @@ class RegionSet(object): 'minecraft:red_nether_bricks': (215, 0), 'minecraft:bone_block': (216, 0), 'minecraft:observer': (218, 0), - 'minecraft:white_glazed_terracotta': (235, 0), - 'minecraft:orange_glazed_terracotta': (236, 0), - 'minecraft:magenta_glazed_terracotta': (237, 0), - 'minecraft:light_blue_glazed_terracotta': (238, 0), - 'minecraft:yellow_glazed_terracotta': (239, 0), - 'minecraft:lime_glazed_terracotta': (240, 0), - 'minecraft:pink_glazed_terracotta': (241, 0), - 'minecraft:gray_glazed_terracotta': (242, 0), - 'minecraft:light_gray_glazed_terracotta': (243, 0), - 'minecraft:cyan_glazed_terracotta': (244, 0), - 'minecraft:purple_glazed_terracotta': (245, 0), - 'minecraft:blue_glazed_terracotta': (246, 0), - 'minecraft:brown_glazed_terracotta': (247, 0), - 'minecraft:green_glazed_terracotta': (248, 0), - 'minecraft:red_glazed_terracotta': (249, 0), - 'minecraft:black_glazed_terracotta': (250, 0), 'minecraft:structure_block': (255, 0), 'minecraft:jigsaw': (256, 0), @@ -846,6 +830,7 @@ class RegionSet(object): self._blockmap['minecraft:%s_banner' % colors[i]] = (176, i) # not rendering self._blockmap['minecraft:%s_wall_banner' % colors[i]] = (177, i) # not rendering self._blockmap['minecraft:%s_shulker_box' % colors[i]] = (219 + i, 0) + self._blockmap['minecraft:%s_glazed_terracotta' % colors[i]] = (235 + i, 0) self._blockmap['minecraft:%s_concrete' % colors[i]] = (251, i) self._blockmap['minecraft:%s_concrete_powder' % colors[i]] = (252, i) @@ -1050,7 +1035,8 @@ class RegionSet(object): data = {'east': 1, 'west': 2, 'south': 3, 'north': 4}[facing] else: data = 5 - elif key in ['minecraft:carved_pumpkin', 'minecraft:jack_o_lantern'] or key.endswith('glazed_terracotta'): + elif (key in ['minecraft:carved_pumpkin', 'minecraft:jack_o_lantern'] or + key.endswith('glazed_terracotta')): facing = palette_entry['Properties']['facing'] data = {'south': 0, 'west': 1, 'north': 2, 'east': 3}[facing] elif key in ['minecraft:vine', 'minecraft:brown_mushroom_block',