Add pumpkin and melon stems.
This commit is contained in:
@@ -159,6 +159,8 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
|
|||||||
state->block == 18 ||
|
state->block == 18 ||
|
||||||
/* tallgrass, but not dead shrubs */
|
/* tallgrass, but not dead shrubs */
|
||||||
(state->block == 31 && getArrayByte3D(state->blockdata_expanded, state->x, state->y, state->z) != 0) ||
|
(state->block == 31 && getArrayByte3D(state->blockdata_expanded, state->x, state->y, state->z) != 0) ||
|
||||||
|
/* pumpkin/melon stem */
|
||||||
|
((state->block == 104) || (state->block == 105)) ||
|
||||||
/* vines */
|
/* vines */
|
||||||
state->block == 106)
|
state->block == 106)
|
||||||
{
|
{
|
||||||
@@ -192,6 +194,14 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
|
|||||||
/* tall grass */
|
/* tall grass */
|
||||||
color = PySequence_GetItem(self->grasscolor, index);
|
color = PySequence_GetItem(self->grasscolor, index);
|
||||||
break;
|
break;
|
||||||
|
case 104:
|
||||||
|
/* pumpkin stem */
|
||||||
|
color = PySequence_GetItem(self->grasscolor, index);
|
||||||
|
break;
|
||||||
|
case 105:
|
||||||
|
/* melon stem */
|
||||||
|
color = PySequence_GetItem(self->grasscolor, index);
|
||||||
|
break;
|
||||||
case 106:
|
case 106:
|
||||||
/* vines */
|
/* vines */
|
||||||
color = PySequence_GetItem(self->grasscolor, index);
|
color = PySequence_GetItem(self->grasscolor, index);
|
||||||
@@ -210,9 +220,10 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
|
|||||||
Py_DECREF(color);
|
Py_DECREF(color);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (state->block == 2 || state->block == 31) /* grass */
|
if (state->block == 2 || state->block == 31 ||
|
||||||
|
state->block == 104 || state->block == 105)
|
||||||
|
/* grass and pumpkin/melon stems */
|
||||||
{
|
{
|
||||||
/* grass */
|
|
||||||
r = 115;
|
r = 115;
|
||||||
g = 175;
|
g = 175;
|
||||||
b = 71;
|
b = 71;
|
||||||
|
|||||||
@@ -271,8 +271,8 @@ def _build_block(top, side, blockID=None):
|
|||||||
otherside = ImageEnhance.Brightness(otherside).enhance(0.8)
|
otherside = ImageEnhance.Brightness(otherside).enhance(0.8)
|
||||||
otherside.putalpha(othersidealpha)
|
otherside.putalpha(othersidealpha)
|
||||||
|
|
||||||
## special case for tall-grass, fern and dead shrub,
|
## special case for tall-grass, fern, dead shrub, and pumpkin/melon stem
|
||||||
if blockID in (31,32):
|
if blockID in (31,32,104,105):
|
||||||
front = original_texture.resize((14,11), Image.ANTIALIAS)
|
front = original_texture.resize((14,11), Image.ANTIALIAS)
|
||||||
composite.alpha_over(img, front, (5,9))
|
composite.alpha_over(img, front, (5,9))
|
||||||
return img
|
return img
|
||||||
@@ -1783,6 +1783,23 @@ def generate_special_texture(blockID, data):
|
|||||||
composite.alpha_over(img,dw_right, (6,3),dw_right) # bottom right
|
composite.alpha_over(img,dw_right, (6,3),dw_right) # bottom right
|
||||||
|
|
||||||
return generate_texture_tuple(img, blockID)
|
return generate_texture_tuple(img, blockID)
|
||||||
|
|
||||||
|
if blockID == 104 or blockID == 105: # pumpkin and melon stems.
|
||||||
|
# the ancildata value indicates how much of the texture
|
||||||
|
# is shown.
|
||||||
|
if data & 7 != 7 or data & 48 == 0:
|
||||||
|
# not fully grown stem or no pumpkin/melon touching it,
|
||||||
|
# straight up stem
|
||||||
|
t = terrain_images[111].copy()
|
||||||
|
ImageDraw.Draw(t).rectangle((0,0,15,int(16 - 16*((data + 1)/8.))),outline=(0,0,0,0),fill=(0,0,0,0))
|
||||||
|
img = _build_block(t, t, blockID)
|
||||||
|
return generate_texture_tuple(img, blockID)
|
||||||
|
|
||||||
|
else: # fully grown, and a pumpking/melon touching it,
|
||||||
|
# corner stem
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
if blockID == 106: # vine
|
if blockID == 106: # vine
|
||||||
img = Image.new("RGBA", (24,24), bgcolor)
|
img = Image.new("RGBA", (24,24), bgcolor)
|
||||||
raw_texture = terrain_images[143]
|
raw_texture = terrain_images[143]
|
||||||
@@ -2253,8 +2270,8 @@ def getBiomeData(worlddir, chunkX, chunkY):
|
|||||||
special_blocks = set([ 2, 6, 9, 17, 18, 20, 26, 23, 27, 28, 29, 31, 33,
|
special_blocks = set([ 2, 6, 9, 17, 18, 20, 26, 23, 27, 28, 29, 31, 33,
|
||||||
34, 35, 43, 44, 50, 51, 53, 54, 55, 58, 59, 61, 62,
|
34, 35, 43, 44, 50, 51, 53, 54, 55, 58, 59, 61, 62,
|
||||||
63, 64, 65, 66, 67, 68, 71, 75, 76, 79, 85, 86, 90,
|
63, 64, 65, 66, 67, 68, 71, 75, 76, 79, 85, 86, 90,
|
||||||
91, 92, 93, 94, 96, 98, 99, 100, 101, 102, 106, 107,
|
91, 92, 93, 94, 96, 98, 99, 100, 101, 102, 104, 105,
|
||||||
108, 109])
|
106, 107, 108, 109])
|
||||||
|
|
||||||
# this is a map of special blockIDs to a list of all
|
# this is a map of special blockIDs to a list of all
|
||||||
# possible values for ancillary data that it might have.
|
# possible values for ancillary data that it might have.
|
||||||
@@ -2314,6 +2331,8 @@ special_map[99] = range(11) # huge brown mushroom, side, corner, etc, piece
|
|||||||
special_map[100] = range(11) # huge red mushroom, side, corner, etc, piece
|
special_map[100] = range(11) # huge red mushroom, side, corner, etc, piece
|
||||||
special_map[101]= range(16) # iron bars, all the possible combination, uses pseudo data
|
special_map[101]= range(16) # iron bars, all the possible combination, uses pseudo data
|
||||||
special_map[102]= range(16) # glass panes, all the possible combination, uses pseudo data
|
special_map[102]= range(16) # glass panes, all the possible combination, uses pseudo data
|
||||||
|
special_map[104] = range(8) # pumpkin stem, size of the stem
|
||||||
|
special_map[105] = range(8) # melon stem, size of the stem
|
||||||
special_map[106] = (1,2,4,8) # vine, orientation
|
special_map[106] = (1,2,4,8) # vine, orientation
|
||||||
special_map[107] = range(8) # fence gates, orientation + open bit
|
special_map[107] = range(8) # fence gates, orientation + open bit
|
||||||
special_map[108]= range(4) # red stairs, orientation
|
special_map[108]= range(4) # red stairs, orientation
|
||||||
|
|||||||
Reference in New Issue
Block a user