0

trapdoor orientation

non-oak trapdoors
dried kelp blocks
This commit is contained in:
James Miller
2018-12-16 05:17:19 -08:00
parent 2b2ad76c81
commit 72c8a1dbd8
2 changed files with 31 additions and 11 deletions

View File

@@ -3483,7 +3483,7 @@ def comparator(self, blockid, data):
# trapdoor
# the trapdoor is looks like a sprite when opened, that's not good
@material(blockid=[96,167], data=range(16), transparent=True, nospawn=True)
@material(blockid=[96,167,11332,11333,11334,11335,11336], data=range(16), transparent=True, nospawn=True)
def trapdoor(self, blockid, data):
# rotation
@@ -3505,11 +3505,19 @@ def trapdoor(self, blockid, data):
elif (data & 0b0011) == 3: data = data & 0b1100 | 0
# texture generation
if blockid == 96:
texture = self.load_image_texture("assets/minecraft/textures/block/oak_trapdoor.png")
else:
texture = self.load_image_texture("assets/minecraft/textures/block/iron_trapdoor.png")
texturepath = {96:"assets/minecraft/textures/block/oak_trapdoor.png",
167:"assets/minecraft/textures/block/iron_trapdoor.png",
11332:"assets/minecraft/textures/block/spruce_trapdoor.png",
11333:"assets/minecraft/textures/block/birch_trapdoor.png",
11334:"assets/minecraft/textures/block/jungle_trapdoor.png",
11335:"assets/minecraft/textures/block/acacia_trapdoor.png",
11336:"assets/minecraft/textures/block/dark_oak_trapdoor.png"
}[blockid]
if data & 0x4 == 0x4: # opened trapdoor
if data & 0x08 == 0x08: texture = self.load_image_texture(texturepath).transpose(Image.FLIP_TOP_BOTTOM)
else: texture = self.load_image_texture(texturepath)
if data & 0x3 == 0: # west
img = self.build_full_block(None, None, None, None, texture)
if data & 0x3 == 1: # east
@@ -3518,8 +3526,9 @@ def trapdoor(self, blockid, data):
img = self.build_full_block(None, None, texture, None, None)
if data & 0x3 == 3: # north
img = self.build_full_block(None, None, None, texture, None)
elif data & 0x4 == 0: # closed trapdoor
texture = self.load_image_texture(texturepath)
if data & 0x8 == 0x8: # is a top trapdoor
img = Image.new("RGBA", (24,24), self.bgcolor)
t = self.build_full_block((texture, 12), None, None, texture, texture)
@@ -4850,3 +4859,8 @@ def glazed_terracotta(self, blockid, data):
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):
top = self.load_image_texture("assets/minecraft/textures/block/dried_kelp_top.png")
return self.build_block(top, self.load_image_texture("assets/minecraft/textures/block/dried_kelp_side.png"))

View File

@@ -460,11 +460,6 @@ class RegionSet(object):
'minecraft:cake': (92, 0),
'minecraft:repeater': (93,0),
'minecraft:oak_trapdoor': (96, 0),
'minecraft:spruce_trapdoor': (96, 0), #wrong
'minecraft:birch_trapdoor': (96, 0),
'minecraft:jungle_trapdoor': (96, 0),
'minecraft:acacia_trapdoor': (96, 0),
'minecraft:dark_oak_trapdoor': (96, 0),
'minecraft:infested_stone': (97, 0),
'minecraft:stone_bricks': (98, 0),
'minecraft:infested_stone_bricks': (98, 0),
@@ -766,6 +761,12 @@ class RegionSet(object):
'minecraft:jungle_button': (11328,0),
'minecraft:acacia_button': (11329,0),
'minecraft:dark_oak_button': (11330,0),
'minecraft:dried_kelp_block': (11331,0),
'minecraft:spruce_trapdoor': (11332, 0),
'minecraft:birch_trapdoor': (11333, 0),
'minecraft:jungle_trapdoor': (11334, 0),
'minecraft:acacia_trapdoor': (11335, 0),
'minecraft:dark_oak_trapdoor': (11336, 0),
}
colors = [ 'white', 'orange', 'magenta', 'light_blue',
@@ -927,6 +928,11 @@ class RegionSet(object):
'south': 0x03,
'east': 0x02,
}[p['facing']]
elif key.endswith('_trapdoor'):
p = palette_entry['Properties']
data = {'south': 1, 'north': 0, 'east': 3, 'west': 2}[p['facing']]
if p['open'] == 'true': data |= 0x04
if p['half'] == 'top': data |= 0x08
return (block, data)