Add Barrel Block
- Barrel Block with 6 directions and open/closed state - One of the missing Blocks in #1613
This commit is contained in:
@@ -5263,3 +5263,30 @@ block(blockid=11503, top_image="assets/minecraft/textures/block/honeycomb_block.
|
||||
|
||||
# honey_block
|
||||
block(blockid=11504, top_image="assets/minecraft/textures/block/honey_block_top.png", side_image="assets/minecraft/textures/block/honey_block_side.png")
|
||||
|
||||
|
||||
# Barrel
|
||||
@material(blockid=11418, data=list(range(12)), solid=True)
|
||||
def barrel(self, blockid, data):
|
||||
t_bottom = self.load_image("assets/minecraft/textures/block/barrel_bottom.png")
|
||||
t_side = self.load_image("assets/minecraft/textures/block/barrel_side.png")
|
||||
|
||||
if data & 0x01:
|
||||
t_top = self.load_image("assets/minecraft/textures/block/barrel_top_open.png")
|
||||
else:
|
||||
t_top = self.load_image("assets/minecraft/textures/block/barrel_top.png")
|
||||
data = data >> 1
|
||||
|
||||
if data == 0: # up
|
||||
return self.build_full_block(t_top, None, None, t_side, t_side)
|
||||
elif data == 1: # down
|
||||
t_side = t_side.rotate(180)
|
||||
return self.build_full_block(t_bottom, None, None, t_side, t_side)
|
||||
elif data == 2: # south
|
||||
return self.build_full_block(t_side.rotate(180), None, None, t_side.rotate(270), t_top)
|
||||
elif data == 3: # east
|
||||
return self.build_full_block(t_side.rotate(270), None, None, t_bottom, t_side.rotate(90))
|
||||
elif data == 4: # north
|
||||
return self.build_full_block(t_side, None, None, t_side.rotate(90), t_bottom)
|
||||
else: # west
|
||||
return self.build_full_block(t_side.rotate(90), None, None, t_top, t_side.rotate(270))
|
||||
|
||||
@@ -835,6 +835,7 @@ class RegionSet(object):
|
||||
"minecraft:smooth_red_sandstone_stairs": (11415, 0),
|
||||
'minecraft:bamboo': (11416, 0),
|
||||
"minecraft:composter": (11417, 0),
|
||||
"minecraft:barrel": (11418, 0),
|
||||
# 1.15 blocks below
|
||||
'minecraft:beehive': (11501, 0),
|
||||
'minecraft:bee_nest': (11502, 0),
|
||||
@@ -1144,6 +1145,12 @@ class RegionSet(object):
|
||||
data = 0
|
||||
elif key == "minecraft:composter":
|
||||
data = palette_entry['Properties']['level']
|
||||
elif key == "minecraft:barrel":
|
||||
facing_data = {'up': 0, 'down': 1, 'south': 2, 'east': 3, 'north': 4, 'west': 5}
|
||||
data = (
|
||||
(facing_data[palette_entry['Properties']['facing']] << 1) +
|
||||
(1 if palette_entry['Properties']['open'] == 'true' else 0)
|
||||
)
|
||||
return (block, data)
|
||||
|
||||
def get_type(self):
|
||||
|
||||
Reference in New Issue
Block a user