0

now using MCPatcher animated water/lava textures, if present

This commit is contained in:
Aaron Griffith
2011-11-07 16:55:36 -05:00
parent bca4b9b011
commit c0d37004cc

View File

@@ -529,12 +529,22 @@ def load_water():
Block 9, standing water, is given a block with only the top face showing. Block 9, standing water, is given a block with only the top face showing.
Block 8, flowing water, is given a full 3 sided cube.""" Block 8, flowing water, is given a full 3 sided cube."""
try:
# try the MCPatcher water first, in case it's present
watertexture = _load_image("custom_water_still.png")
watertexture = watertexture.crop((0, 0, watertexture.size[0], watertexture.size[0]))
except IOError:
watertexture = _load_image("water.png") watertexture = _load_image("water.png")
w1 = _build_block(watertexture, None) w1 = _build_block(watertexture, None)
blockmap[9] = generate_texture_tuple(w1,9) blockmap[9] = generate_texture_tuple(w1,9)
w2 = _build_block(watertexture, watertexture) w2 = _build_block(watertexture, watertexture)
blockmap[8] = generate_texture_tuple(w2,8) blockmap[8] = generate_texture_tuple(w2,8)
try:
# try the MCPatcher lava first, in case it's present
lavatexture = _load_image("custom_lava_still.png")
lavatexture = lavatexture.crop((0, 0, lavatexture.size[0], lavatexture.size[0]))
except IOError:
lavatexture = _load_image("lava.png") lavatexture = _load_image("lava.png")
lavablock = _build_block(lavatexture, lavatexture) lavablock = _build_block(lavatexture, lavatexture)
blockmap[10] = generate_texture_tuple(lavablock,10) blockmap[10] = generate_texture_tuple(lavablock,10)
@@ -599,6 +609,10 @@ def generate_special_texture(blockID, data):
if blockID == 9 or blockID == 20 or blockID == 79: # spring water, flowing water and waterfall water, AND glass, AND ice if blockID == 9 or blockID == 20 or blockID == 79: # spring water, flowing water and waterfall water, AND glass, AND ice
# water,glass and ice share the way to be rendered # water,glass and ice share the way to be rendered
if blockID == 9: if blockID == 9:
try:
texture = _load_image("custom_water_still.png")
texture = texture.crop((0, 0, texture.size[0], texture.size[0]))
except IOError:
texture = _load_image("water.png") texture = _load_image("water.png")
elif blockID == 20: elif blockID == 20:
texture = terrain_images[49] texture = terrain_images[49]