Add all the new stairs in 1.3.
This commit is contained in:
@@ -158,7 +158,8 @@ get_lighting_color(RenderPrimitiveLighting *self, RenderState *state,
|
||||
blocklevel = get_data(state, BLOCKLIGHT, x, y, z);
|
||||
|
||||
/* special half-step handling, stairs handling */
|
||||
if (block == 44 || block == 53 || block == 67 || block == 108 || block == 109 || block == 114) {
|
||||
if (block == 44 || block == 53 || block == 67 || block == 108 || block == 109 || block == 114 ||
|
||||
block == 128 || block == 134 || block == 135 || block == 136) {
|
||||
unsigned int upper_block;
|
||||
|
||||
/* stairs and half-blocks take the skylevel from the upper block if it's transparent */
|
||||
@@ -167,7 +168,9 @@ get_lighting_color(RenderPrimitiveLighting *self, RenderState *state,
|
||||
do {
|
||||
upper_counter++;
|
||||
upper_block = get_data(state, BLOCKS, x, y + upper_counter, z);
|
||||
} while (upper_block == 44 || upper_block == 53 || upper_block == 67 || upper_block == 108 || upper_block == 109 || upper_block == 114);
|
||||
} while (upper_block == 44 || upper_block == 53 || upper_block == 67 || upper_block == 108 ||
|
||||
upper_block == 109 || upper_block == 114 || upper_block == 128 || upper_block == 134 ||
|
||||
upper_block == 135 || upper_block == 136);
|
||||
if (is_transparent(upper_block)) {
|
||||
skylevel = get_data(state, SKYLIGHT, x, y + upper_counter, z);
|
||||
} else {
|
||||
|
||||
@@ -1491,8 +1491,8 @@ def fire(self, blockid, data):
|
||||
# monster spawner
|
||||
block(blockid=52, top_index=34, transparent=True)
|
||||
|
||||
# wooden, cobblestone, red brick, stone brick, netherbrick and sandstone stairs.
|
||||
@material(blockid=[53,67,108,109,114,128], data=range(8), transparent=True, solid=True, nospawn=True)
|
||||
# wooden, cobblestone, red brick, stone brick, netherbrick, sandstone, spruce, birch and jungle stairs.
|
||||
@material(blockid=[53,67,108,109,114,128,134,135,136], data=range(8), transparent=True, solid=True, nospawn=True)
|
||||
def stairs(self, blockid, data):
|
||||
|
||||
# first, rotations
|
||||
@@ -1528,6 +1528,13 @@ def stairs(self, blockid, data):
|
||||
texture = self.terrain_images[224]
|
||||
elif blockid == 128: # sandstone stairs
|
||||
texture = self.terrain_images[192]
|
||||
elif blockid == 134: # spruce wood stairs
|
||||
texture = self.terrain_images[198]
|
||||
elif blockid == 135: # birch wood stairs
|
||||
texture = self.terrain_images[214]
|
||||
elif blockid == 136: # jungle good stairs
|
||||
texture = self.terrain_images[199]
|
||||
|
||||
|
||||
side = texture.copy()
|
||||
half_block_u = texture.copy() # up, down, left, right
|
||||
@@ -1535,6 +1542,11 @@ def stairs(self, blockid, data):
|
||||
half_block_l = texture.copy()
|
||||
half_block_r = texture.copy()
|
||||
|
||||
# sandstone stairs have spcial top texture
|
||||
if blockid == 128:
|
||||
half_block_u = self.terrain_images[176].copy()
|
||||
half_block_d = self.terrain_images[176].copy()
|
||||
|
||||
# generate needed geometries
|
||||
ImageDraw.Draw(side).rectangle((0,0,7,6),outline=(0,0,0,0),fill=(0,0,0,0))
|
||||
ImageDraw.Draw(half_block_u).rectangle((0,8,15,15),outline=(0,0,0,0),fill=(0,0,0,0))
|
||||
|
||||
Reference in New Issue
Block a user