Merge branch 'master' into py-package
Conflicts: overviewer_core/data/config.js overviewer_core/data/web_assets/functions.js overviewer_core/data/web_assets/style.css setup.py web_assets/overviewer.css web_assets/style.css
This commit is contained in:
@@ -155,7 +155,12 @@ generate_pseudo_data(RenderState *state, unsigned char ancilData) {
|
||||
int x = state->x, y = state->y, z = state->z;
|
||||
unsigned char data = 0;
|
||||
|
||||
if (state->block == 9) { /* water */
|
||||
if (state->block == 2) { /* grass */
|
||||
/* return 0x10 if grass is covered in snow */
|
||||
if (z < 127 && getArrayByte3D(state->blocks, x, y, z+1) == 78)
|
||||
return 0x10;
|
||||
return ancilData;
|
||||
} else if (state->block == 9) { /* water */
|
||||
/* an aditional bit for top is added to the 4 bits of check_adjacent_blocks */
|
||||
if ((ancilData == 0) || (ancilData >= 10)) { /* static water, only top, and unkown ancildata values */
|
||||
data = 16;
|
||||
@@ -207,9 +212,75 @@ generate_pseudo_data(RenderState *state, unsigned char ancilData) {
|
||||
if ((above_level_data & 0x08)) { /* draw top right going up redstonewire */
|
||||
final_data = final_data | 0x10;
|
||||
}
|
||||
return final_data;
|
||||
return final_data;
|
||||
|
||||
} else if (state-> block == 54) { /* chests */
|
||||
/* the top 2 bits are used to store the type of chest
|
||||
* (single or double), the 2 bottom bits are used for
|
||||
* orientation, look textures.py for more information. */
|
||||
|
||||
/* if placed alone chests always face west, return 0 to make a
|
||||
* chest facing west */
|
||||
unsigned char chest_data = 0, air_data = 0, final_data = 0;
|
||||
|
||||
/* search for chests */
|
||||
chest_data = check_adjacent_blocks(state, x, y, z, 54);
|
||||
|
||||
/* search for air */
|
||||
air_data = check_adjacent_blocks(state, x, y, z, 0);
|
||||
|
||||
if (chest_data == 1) { /* another chest in the east */
|
||||
final_data = final_data | 0x8; /* only can face to north or south */
|
||||
if ( (air_data & 0x2) == 2 ) {
|
||||
final_data = final_data | 0x1; /* facing north */
|
||||
} else {
|
||||
final_data = final_data | 0x3; /* facing south */
|
||||
}
|
||||
|
||||
} else if (chest_data == 2) { /* in the north */
|
||||
final_data = final_data | 0x4; /* only can face to east or west */
|
||||
if ( !((air_data & 0x4) == 4) ) { /* 0 = west */
|
||||
final_data = final_data | 0x2; /* facing east */
|
||||
}
|
||||
|
||||
} else if (chest_data == 4) { /*in the west */
|
||||
final_data = final_data | 0x4;
|
||||
if ( (air_data & 0x2) == 2 ) {
|
||||
final_data = final_data | 0x1; /* facing north */
|
||||
} else {
|
||||
final_data = final_data | 0x3; /* facing south */
|
||||
}
|
||||
|
||||
} else if (chest_data == 8) { /*in the south */
|
||||
final_data = final_data | 0x8;
|
||||
if ( !((air_data & 0x4) == 4) ) {
|
||||
final_data = final_data | 0x2; /* facing east */
|
||||
}
|
||||
|
||||
} else if (chest_data == 0) {
|
||||
/* Single chest, determine the orientation */
|
||||
if ( ((air_data & 0x8) == 0) && ((air_data & 0x2) == 2) ) { /* block in +x and no block in -x */
|
||||
final_data = final_data | 0x1; /* facing north */
|
||||
|
||||
} else if ( ((air_data & 0x2) == 0) && ((air_data & 0x8) == 8)) {
|
||||
final_data = final_data | 0x3;
|
||||
|
||||
} else if ( ((air_data & 0x4) == 0) && ((air_data & 0x1) == 1)) {
|
||||
final_data = final_data | 0x2;
|
||||
} /* else, facing west, value = 0 */
|
||||
|
||||
} else {
|
||||
/* more than one adjacent chests! render as normal chest */
|
||||
return 0;
|
||||
}
|
||||
|
||||
return final_data;
|
||||
|
||||
} else if (state->block == 90) {
|
||||
return check_adjacent_blocks(state, x, y, z, state->block);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
@@ -329,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)) {
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user