0

Amend farmland rendering

- Use 'moisture' property to determine when to render farmland as moist
This commit is contained in:
Joseph Camp
2020-05-02 22:30:33 +00:00
parent 16753aad79
commit 6d5ccdfd54
2 changed files with 10 additions and 6 deletions

View File

@@ -2574,24 +2574,25 @@ def crops8(self, blockid, data):
alpha_over(img, crop3, (6,3), crop3)
return img
# farmland and grass path (15/16 blocks)
@material(blockid=[60,208], data=list(range(9)), solid=True)
@material(blockid=[60, 208], data=list(range(2)), solid=True, transparent=True, nospawn=True)
def farmland(self, blockid, data):
if blockid == 60:
side = self.load_image_texture("assets/minecraft/textures/block/dirt.png")
top = self.load_image_texture("assets/minecraft/textures/block/farmland_moist.png")
side = self.load_image_texture("assets/minecraft/textures/block/dirt.png").copy()
if data == 0:
top = self.load_image_texture("assets/minecraft/textures/block/farmland.png")
else:
top = self.load_image_texture("assets/minecraft/textures/block/farmland_moist.png")
# dirt.png is 16 pixels tall, so we need to crop it before building full block
side = side.crop((0, 1, 16, 16))
return self.build_full_block((top, 1), side, side, side, side)
else:
top = self.load_image_texture("assets/minecraft/textures/block/grass_path_top.png")
side = self.load_image_texture("assets/minecraft/textures/block/grass_path_side.png")
# side already has 1 transparent pixel at the top, so it doesn't need to be modified
# just shift the top image down 1 pixel
return self.build_full_block((top, 1), side, side, side, side)
return self.build_full_block((top, 1), side, side, side, side)
# signposts