0

Add portals to textures.py, needed changes in chunk.py and iterate.c and added beds to transparent blocks.

This commit is contained in:
Alejandro Aguilera
2011-05-08 02:10:19 +02:00
parent a379a731df
commit 3c8d7e6442
4 changed files with 24 additions and 5 deletions

View File

@@ -114,9 +114,9 @@ def get_tileentity_data(level):
return data
# This set holds blocks ids that can be seen through, for occlusion calculations
transparent_blocks = set([ 0, 6, 8, 9, 18, 20, 27, 28, 37, 38, 39, 40, 44, 50,
51, 52, 53, 55, 59, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 74, 75, 76, 77, 78, 79, 81, 83, 85, 92])
transparent_blocks = set([ 0, 6, 8, 9, 18, 20, 26, 27, 28, 37, 38, 39, 40, 44,
50, 51, 52, 53, 55, 59, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 74, 75, 76, 77, 78, 79, 81, 83, 85, 90, 92])
# This set holds block ids that are solid blocks
solid_blocks = set([1, 2, 3, 4, 5, 7, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,

View File

@@ -276,6 +276,8 @@ generate_pseudo_data(RenderState *state, unsigned char ancilData) {
return final_data;
} else if (state->block == 90) {
return check_adjacent_blocks(state, x, y, z, state->block);
}
@@ -398,7 +400,7 @@ chunk_render(PyObject *self, PyObject *args) {
PyObject *tmp;
unsigned char ancilData = getArrayByte3D(blockdata_expanded, state.x, state.y, state.z);
if ((state.block == 85) || (state.block == 9) || (state.block == 55) || (state.block == 54) || (state.block == 2)) {
if ((state.block == 85) || (state.block == 9) || (state.block == 55) || (state.block == 54) || (state.block == 2) || (state.block == 90)) {
ancilData = generate_pseudo_data(&state, ancilData);
}

View File

@@ -1186,6 +1186,22 @@ def generate_special_texture(blockID, data):
return (img.convert("RGB"), img.split()[3])
if blockID == 90: # portal
portaltexture = _load_image("portal.png")
img = Image.new("RGBA", (24,24), (38,92,255,0))
side = transform_image_side(portaltexture)
otherside = side.transpose(Image.FLIP_TOP_BOTTOM)
if data in (1,4):
composite.alpha_over(img, side, (5,4), side)
if data in (2,8):
composite.alpha_over(img, otherside, (5,4), otherside)
return (img.convert("RGB"), img.split()[3])
if blockID == 92: # cake! (without bites, at the moment)
top = terrain_images[121]
@@ -1292,7 +1308,7 @@ def getBiomeData(worlddir, chunkX, chunkY):
special_blocks = set([ 2, 6, 9, 17, 18, 23, 27, 28, 35, 43, 44, 50, 51,
53, 54, 55, 58, 59, 61, 62, 64, 65, 66, 67, 71, 75,
76, 85, 86, 91, 92])
76, 85, 86, 90, 91, 92])
# this is a map of special blockIDs to a list of all
# possible values for ancillary data that it might have.
@@ -1326,6 +1342,7 @@ special_map[75] = (1,2,3,4,5) # off redstone torch, orientation
special_map[76] = (1,2,3,4,5) # on redstone torch, orientation
special_map[85] = range(17) # fences, all the possible combination, uses pseudo data
special_map[86] = range(5) # pumpkin, orientation
special_map[90] = (1,2,4,8) # portal, in 2 orientations, 4 cases, uses pseudo data
special_map[91] = range(5) # jack-o-lantern, orientation
special_map[92] = range(6) # cake!

BIN
textures/portal.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 672 B