0

Added Hoppers

Screenshot: http://i.imgur.com/nB2Nzp6.jpg
This commit is contained in:
skeight
2013-03-08 09:30:42 -08:00
parent f40049a79c
commit a1ebd9a03a

View File

@@ -4007,4 +4007,28 @@ def quartz_block(self, blockid, data):
elif data == 4: # east-west oriented
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))
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