0

Added definitions and support for all the various red sandstone blocks.

This commit is contained in:
Ean McLaughlin
2014-09-02 18:41:16 -06:00
committed by Andrew Chin
parent fd468f4cf3
commit ed09c5c965
2 changed files with 69 additions and 30 deletions

View File

@@ -262,6 +262,7 @@ is_stairs(int block) {
case 156: /* quartz stairs */
case 163: /* acacia wood stairs */
case 164: /* dark wood stairs */
case 180: /* red sandstone stairs */
return 1;
}
return 0;

View File

@@ -1152,6 +1152,18 @@ def sandstone(self, blockid, data):
if data == 2: # soft
return self.build_block(top, self.load_image_texture("assets/minecraft/textures/blocks/sandstone_smooth.png"))
# red sandstone
@material(blockid=179, data=range(3), solid=True)
def sandstone(self, blockid, data):
top = self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_top.png")
if data == 0: # normal
side = self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_normal.png")
return self.build_full_block(top, None, None, side, side, self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_bottom.png") )
if data == 1: # hieroglyphic
return self.build_block(top, self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_carved.png"))
if data == 2: # soft
return self.build_block(top, self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_smooth.png"))
# note block
block(blockid=25, top_image="assets/minecraft/textures/blocks/noteblock.png")
@@ -1545,16 +1557,18 @@ block(blockid=42, top_image="assets/minecraft/textures/blocks/iron_block.png")
# double slabs and slabs
# these wooden slabs are unobtainable without cheating, they are still
# here because lots of pre-1.3 worlds use this blocks
@material(blockid=[43, 44], data=range(16), transparent=(44,), solid=True)
@material(blockid=[43, 44, 181, 182], data=range(16), transparent=(44,182,), solid=True)
def slabs(self, blockid, data):
if blockid == 44:
if blockid == 44 or blockid == 182:
texture = data & 7
else: # data > 8 are special double slabs
texture = data
if blockid == 44 or blockid == 43:
if texture== 0: # stone slab
top = self.load_image_texture("assets/minecraft/textures/blocks/stone_slab_top.png")
side = self.load_image_texture("assets/minecraft/textures/blocks/stone_slab_side.png")
elif texture== 1: # smooth stone
elif texture== 1: # sandstone slab
top = self.load_image_texture("assets/minecraft/textures/blocks/sandstone_top.png")
side = self.load_image_texture("assets/minecraft/textures/blocks/sandstone_normal.png")
elif texture== 2: # wooden slab
@@ -1576,9 +1590,28 @@ def slabs(self, blockid, data):
else:
return None
elif blockid == 182: # single red sandstone slab
if texture == 0:
top = self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_top.png")
side = self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_normal.png")
else:
return None
elif blockid == 181: # double red sandstone slab
if texture == 0: # red sandstone
top = self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_top.png")
side = self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_normal.png")
elif texture == 8: # 'full' red sandstone (smooth)
top = side = self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_top");
else:
return None
if blockid == 43: # double slab
return self.build_block(top, side)
if blockid == 181: # double red sandstone slab
return self.build_block(top, side)
# cut the side texture in half
mask = side.crop((0,8,16,16))
side = Image.new(side.mode, side.size, self.bgcolor)
@@ -1709,8 +1742,8 @@ def fire(self, blockid, data):
# monster spawner
block(blockid=52, top_image="assets/minecraft/textures/blocks/mob_spawner.png", transparent=True)
# wooden, cobblestone, red brick, stone brick, netherbrick, sandstone, spruce, birch, jungle and quartz stairs.
@material(blockid=[53,67,108,109,114,128,134,135,136,156,163,164], data=range(128), transparent=True, solid=True, nospawn=True)
# wooden, cobblestone, red brick, stone brick, netherbrick, sandstone, spruce, birch, jungle, quartz, and red sandstone stairs.
@material(blockid=[53,67,108,109,114,128,134,135,136,156,163,164,180], data=range(128), transparent=True, solid=True, nospawn=True)
def stairs(self, blockid, data):
# preserve the upside-down bit
upside_down = data & 0x4
@@ -1747,17 +1780,22 @@ def stairs(self, blockid, data):
texture = self.load_image_texture("assets/minecraft/textures/blocks/planks_acacia.png").copy()
elif blockid == 164: # dark oak stairs
texture = self.load_image_texture("assets/minecraft/textures/blocks/planks_big_oak.png").copy()
elif blockid == 180: # red sandstone stairs
texture = self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_normal").copy()
outside_l = texture.copy()
outside_r = texture.copy()
inside_l = texture.copy()
inside_r = texture.copy()
# sandstone & quartz stairs have special top texture
# sandstone, red sandstone, and quartz stairs have special top texture
if blockid == 128:
texture = self.load_image_texture("assets/minecraft/textures/blocks/sandstone_top.png").copy()
elif blockid == 156:
texture = self.load_image_texture("assets/minecraft/textures/blocks/quartz_block_top.png").copy()
elif blockid == 180:
texture = self.load_image_texture("assets/minecraft/textures/blocks/red_sandstone_top").copy()
slab_top = texture.copy()