unknown blocks are no longer assumed to be transparent
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
static PyObject *textures = NULL;
|
||||
static PyObject *chunk_mod = NULL;
|
||||
static PyObject *blockmap = NULL;
|
||||
static PyObject *known_blocks = NULL;
|
||||
static PyObject *transparent_blocks = NULL;
|
||||
|
||||
PyObject *init_chunk_render(PyObject *self, PyObject *args) {
|
||||
@@ -45,6 +46,9 @@ PyObject *init_chunk_render(PyObject *self, PyObject *args) {
|
||||
blockmap = PyObject_GetAttrString(textures, "blockmap");
|
||||
if (!blockmap)
|
||||
return NULL;
|
||||
known_blocks = PyObject_GetAttrString(textures, "known_blocks");
|
||||
if (!known_blocks)
|
||||
return NULL;
|
||||
transparent_blocks = PyObject_GetAttrString(textures, "transparent_blocks");
|
||||
if (!transparent_blocks)
|
||||
return NULL;
|
||||
@@ -56,6 +60,10 @@ int
|
||||
is_transparent(unsigned char b) {
|
||||
PyObject *block = PyInt_FromLong(b);
|
||||
int ret = PySequence_Contains(transparent_blocks, block);
|
||||
if (!ret)
|
||||
{
|
||||
ret = !(PySequence_Contains(known_blocks, block));
|
||||
}
|
||||
Py_DECREF(block);
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -546,7 +546,8 @@ blockmap_generators = {}
|
||||
blockmap = {}
|
||||
biome_grass_texture = None
|
||||
|
||||
transparent_blocks = set([0,])
|
||||
known_blocks = set()
|
||||
transparent_blocks = set()
|
||||
solid_blocks = set()
|
||||
fluid_blocks = set()
|
||||
nospawn_blocks = set()
|
||||
@@ -579,6 +580,7 @@ def material(blockid=[], data=[0], **kwargs):
|
||||
|
||||
for block in blockid:
|
||||
# set the property sets appropriately
|
||||
known_blocks.update([block])
|
||||
for prop in properties:
|
||||
try:
|
||||
if block in kwargs.get(prop, []):
|
||||
|
||||
Reference in New Issue
Block a user