Amend shulker box rendering
- Correct shulker box side textures being resized to 4x4 resolution - Use intended texture for 'uncolored' shulker boxes instead of purple
This commit is contained in:
@@ -259,6 +259,7 @@ enum mc_block_id {
|
|||||||
block_concrete_powder = 252,
|
block_concrete_powder = 252,
|
||||||
block_structure_block = 255,
|
block_structure_block = 255,
|
||||||
block_jigsaw = 256,
|
block_jigsaw = 256,
|
||||||
|
block_shulker_box = 257,
|
||||||
block_prismarine_stairs = 11337,
|
block_prismarine_stairs = 11337,
|
||||||
block_dark_prismarine_stairs = 11338,
|
block_dark_prismarine_stairs = 11338,
|
||||||
block_prismarine_brick_stairs = 11339,
|
block_prismarine_brick_stairs = 11339,
|
||||||
|
|||||||
@@ -4982,29 +4982,24 @@ def observer(self, blockid, data):
|
|||||||
|
|
||||||
return img
|
return img
|
||||||
|
|
||||||
# shulker box
|
|
||||||
@material(blockid=list(range(219,235)), data=list(range(6)), solid=True, nospawn=True)
|
|
||||||
def shulker_box(self, blockid, data):
|
|
||||||
# first, do the rotation if needed
|
|
||||||
data = data & 7
|
|
||||||
if self.rotation == 1:
|
|
||||||
if data == 2: data = 5
|
|
||||||
elif data == 3: data = 4
|
|
||||||
elif data == 4: data = 2
|
|
||||||
elif data == 5: data = 3
|
|
||||||
elif self.rotation == 2:
|
|
||||||
if data == 2: data = 3
|
|
||||||
elif data == 3: data = 2
|
|
||||||
elif data == 4: data = 5
|
|
||||||
elif data == 5: data = 4
|
|
||||||
elif self.rotation == 3:
|
|
||||||
if data == 2: data = 4
|
|
||||||
elif data == 3: data = 5
|
|
||||||
elif data == 4: data = 3
|
|
||||||
elif data == 5: data = 2
|
|
||||||
|
|
||||||
color = color_map[blockid - 219]
|
# shulker box
|
||||||
shulker_t = self.load_image_texture("assets/minecraft/textures/entity/shulker/shulker_%s.png" % color).copy()
|
@material(blockid=list(range(219, 235)) + [257], data=list(range(6)), solid=True, nospawn=True)
|
||||||
|
def shulker_box(self, blockid, data):
|
||||||
|
# Do rotation
|
||||||
|
if self.rotation in [1, 2, 3] and data in [2, 3, 4, 5]:
|
||||||
|
rotation_map = {1: {2: 5, 3: 4, 4: 2, 5: 3},
|
||||||
|
2: {2: 3, 3: 2, 4: 5, 5: 4},
|
||||||
|
3: {2: 4, 3: 5, 4: 3, 5: 2}}
|
||||||
|
data = rotation_map[self.rotation][data]
|
||||||
|
|
||||||
|
if blockid == 257:
|
||||||
|
# Uncolored shulker box
|
||||||
|
file_name = "shulker.png"
|
||||||
|
else:
|
||||||
|
file_name = "shulker_%s.png" % color_map[blockid - 219]
|
||||||
|
|
||||||
|
shulker_t = self.load_image("assets/minecraft/textures/entity/shulker/%s" % file_name).copy()
|
||||||
w, h = shulker_t.size
|
w, h = shulker_t.size
|
||||||
res = w // 4
|
res = w // 4
|
||||||
# Cut out the parts of the shulker texture we need for the box
|
# Cut out the parts of the shulker texture we need for the box
|
||||||
@@ -5032,6 +5027,7 @@ def shulker_box(self, blockid, data):
|
|||||||
|
|
||||||
return img
|
return img
|
||||||
|
|
||||||
|
|
||||||
# structure block
|
# structure block
|
||||||
@material(blockid=255, data=list(range(4)), solid=True)
|
@material(blockid=255, data=list(range(4)), solid=True)
|
||||||
def structure_block(self, blockid, data):
|
def structure_block(self, blockid, data):
|
||||||
|
|||||||
@@ -655,23 +655,6 @@ class RegionSet(object):
|
|||||||
'minecraft:red_nether_bricks': (215, 0),
|
'minecraft:red_nether_bricks': (215, 0),
|
||||||
'minecraft:bone_block': (216, 0),
|
'minecraft:bone_block': (216, 0),
|
||||||
'minecraft:observer': (218, 0),
|
'minecraft:observer': (218, 0),
|
||||||
'minecraft:white_shulker_box': (219, 0),
|
|
||||||
'minecraft:orange_shulker_box': (220, 0),
|
|
||||||
'minecraft:magenta_shulker_box': (221, 0),
|
|
||||||
'minecraft:light_blue_shulker_box': (222, 0),
|
|
||||||
'minecraft:yellow_shulker_box': (223, 0),
|
|
||||||
'minecraft:lime_shulker_box': (224, 0),
|
|
||||||
'minecraft:pink_shulker_box': (225, 0),
|
|
||||||
'minecraft:gray_shulker_box': (226, 0),
|
|
||||||
'minecraft:light_gray_shulker_box': (227, 0),
|
|
||||||
'minecraft:cyan_shulker_box': (228, 0),
|
|
||||||
'minecraft:shulker_box': (229, 0), # wrong color
|
|
||||||
'minecraft:purple_shulker_box': (229, 0),
|
|
||||||
'minecraft:blue_shulker_box': (230, 0),
|
|
||||||
'minecraft:brown_shulker_box': (231, 0),
|
|
||||||
'minecraft:green_shulker_box': (232, 0),
|
|
||||||
'minecraft:red_shulker_box': (233, 0),
|
|
||||||
'minecraft:black_shulker_box': (234, 0),
|
|
||||||
'minecraft:white_glazed_terracotta': (235, 0),
|
'minecraft:white_glazed_terracotta': (235, 0),
|
||||||
'minecraft:orange_glazed_terracotta': (236, 0),
|
'minecraft:orange_glazed_terracotta': (236, 0),
|
||||||
'minecraft:magenta_glazed_terracotta': (237, 0),
|
'minecraft:magenta_glazed_terracotta': (237, 0),
|
||||||
@@ -691,6 +674,7 @@ class RegionSet(object):
|
|||||||
|
|
||||||
'minecraft:structure_block': (255, 0),
|
'minecraft:structure_block': (255, 0),
|
||||||
'minecraft:jigsaw': (256, 0),
|
'minecraft:jigsaw': (256, 0),
|
||||||
|
'minecraft:shulker_box': (257, 0),
|
||||||
|
|
||||||
'minecraft:armor_stand': (416, 0), # not rendering
|
'minecraft:armor_stand': (416, 0), # not rendering
|
||||||
|
|
||||||
@@ -861,6 +845,7 @@ class RegionSet(object):
|
|||||||
self._blockmap['minecraft:%s_stained_glass_pane' % colors[i]] = (160, i)
|
self._blockmap['minecraft:%s_stained_glass_pane' % colors[i]] = (160, i)
|
||||||
self._blockmap['minecraft:%s_banner' % colors[i]] = (176, i) # not rendering
|
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_wall_banner' % colors[i]] = (177, i) # not rendering
|
||||||
|
self._blockmap['minecraft:%s_shulker_box' % colors[i]] = (219 + i, 0)
|
||||||
self._blockmap['minecraft:%s_concrete' % colors[i]] = (251, i)
|
self._blockmap['minecraft:%s_concrete' % colors[i]] = (251, i)
|
||||||
self._blockmap['minecraft:%s_concrete_powder' % colors[i]] = (252, i)
|
self._blockmap['minecraft:%s_concrete_powder' % colors[i]] = (252, i)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user