0

Merge pull request #895 from skeight/snapshot

1.5 Pre-Release updates/fixes
This commit is contained in:
Alejandro Aguilera
2013-03-11 04:11:43 -07:00
2 changed files with 31 additions and 5 deletions

View File

@@ -159,7 +159,7 @@ get_lighting_color(RenderPrimitiveLighting *self, RenderState *state,
/* special half-step handling, stairs handling */
if (block == 44 || block == 53 || block == 67 || block == 108 || block == 109 || block == 114 ||
block == 128 || block == 134 || block == 135 || block == 136) {
block == 128 || block == 134 || block == 135 || block == 136 || block == 156) {
unsigned int upper_block;
/* stairs and half-blocks take the skylevel from the upper block if it's transparent */
@@ -170,7 +170,7 @@ get_lighting_color(RenderPrimitiveLighting *self, RenderState *state,
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 || upper_block == 128 || upper_block == 134 ||
upper_block == 135 || upper_block == 136);
upper_block == 135 || upper_block == 136 || upper_block == 156 );
if (is_transparent(upper_block)) {
skylevel = get_data(state, SKYLIGHT, x, y + upper_counter, z);
} else {

View File

@@ -1387,6 +1387,8 @@ def slabs(self, blockid, data):
top = side = self.load_image_texture("textures/blocks/stonebricksmooth.png")
elif texture== 6: # nether brick slab
top = side = self.load_image_texture("textures/blocks/netherBrick.png")
elif texture== 7: #quartz
top = side = self.load_image_texture("textures/blocks/quartzblock_side.png")
else:
return None
@@ -3052,7 +3054,7 @@ def comparator(self, blockid, data):
active_torch = build_torch(True)
inactive_torch = build_torch(False)
back_torch = active_torch if blockid == 150 else inactive_torch
back_torch = active_torch if (blockid == 150 or data & 0b1000 == 0b1000) else inactive_torch
static_torch_img = active_torch if (data & 0b100 == 0b100) else inactive_torch
img = self.build_full_block( (top, increment), None, None, side, side)
@@ -3505,8 +3507,8 @@ def end_portal(self, blockid, data):
return img
# end portal frame
@material(blockid=120, data=range(5), transparent=True)
# end portal frame (data range 8 to get all orientations of filled)
@material(blockid=120, data=range(8), transparent=True)
def end_portal_frame(self, blockid, data):
# The bottom 2 bits are oritation info but seems there is no
# graphical difference between orientations
@@ -4006,3 +4008,27 @@ def quartz_block(self, blockid, data):
if self.rotation in (0,2):
return self.build_full_block(side.rotate(90), None, None, side.rotate(90), top)
return self.build_full_block(side, None, None, top, side.rotate(90))
# hopper
@material(blockid=154, data=range(4), transparent=True)
def hopper(self, blockid, data):
#build the top
side = self.load_image_texture("textures/blocks/hopper.png")
top = self.load_image_texture("textures/blocks/hopper_top.png")
bottom = self.load_image_texture("textures/blocks/hopper_inside.png")
hop_top = self.build_full_block((top,10), side, side, side, side, side)
#build a solid block for mid/top
hop_mid = self.build_full_block((top,5), side, side, side, side, side)
hop_bot = self.build_block(side,side)
hop_mid = hop_mid.resize((17,17),Image.ANTIALIAS)
hop_bot = hop_bot.resize((10,10),Image.ANTIALIAS)
#compose the final block
img = Image.new("RGBA", (24,24), self.bgcolor)
alpha_over(img, hop_bot, (7,14), hop_bot)
alpha_over(img, hop_mid, (3,3), hop_mid)
alpha_over(img, hop_top, (0,-6), hop_top)
return img