Merge branch 'master' into rendermode-options
This commit is contained in:
@@ -165,6 +165,7 @@ static void
|
|||||||
rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *mask, PyObject *mask_light) {
|
rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *mask, PyObject *mask_light) {
|
||||||
RenderModeNormal *self = (RenderModeNormal *)data;
|
RenderModeNormal *self = (RenderModeNormal *)data;
|
||||||
int randx = 0,randy = 0;
|
int randx = 0,randy = 0;
|
||||||
|
unsigned char data_byte;
|
||||||
|
|
||||||
/* first, check to see if we should use biome-compatible src, mask */
|
/* first, check to see if we should use biome-compatible src, mask */
|
||||||
if (self->biome_data) {
|
if (self->biome_data) {
|
||||||
@@ -176,10 +177,10 @@ rendermode_normal_draw(void *data, RenderState *state, PyObject *src, PyObject *
|
|||||||
randy = rand() % 6 + 1 - 3;
|
randy = rand() % 6 + 1 - 3;
|
||||||
state->imgx = state->imgx + randx;
|
state->imgx = state->imgx + randx;
|
||||||
state->imgy = state->imgy + randy;
|
state->imgy = state->imgy + randy;
|
||||||
unsigned char data = getArrayByte3D(state->blockdata_expanded, state->x, state->y, state->z);
|
data_byte = getArrayByte3D(state->blockdata_expanded, state->x, state->y, state->z);
|
||||||
if (data == 1) {
|
if (data_byte == 1) {
|
||||||
src = mask = self->tall_grass_texture;
|
src = mask = self->tall_grass_texture;
|
||||||
} else if (data == 2) {
|
} else if (data_byte == 2) {
|
||||||
src = mask = self->tall_fern_texture;
|
src = mask = self->tall_fern_texture;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
32
world.py
32
world.py
@@ -208,23 +208,25 @@ class World(object):
|
|||||||
|
|
||||||
## The filename of this chunk
|
## The filename of this chunk
|
||||||
chunkFile = self.get_region_path(chunkX, chunkY)
|
chunkFile = self.get_region_path(chunkX, chunkY)
|
||||||
|
|
||||||
data=nbt.load_from_region(chunkFile, chunkX, chunkY)[1]
|
if chunkFile is not None:
|
||||||
level = data['Level']
|
data = nbt.load_from_region(chunkFile, chunkX, chunkY)[1]
|
||||||
blockArray = numpy.frombuffer(level['Blocks'], dtype=numpy.uint8).reshape((16,16,128))
|
if data is not None:
|
||||||
|
level = data['Level']
|
||||||
## The block for spawn *within* the chunk
|
blockArray = numpy.frombuffer(level['Blocks'], dtype=numpy.uint8).reshape((16,16,128))
|
||||||
inChunkX = spawnX - (chunkX*16)
|
|
||||||
inChunkZ = spawnZ - (chunkY*16)
|
## The block for spawn *within* the chunk
|
||||||
|
inChunkX = spawnX - (chunkX*16)
|
||||||
## find the first air block
|
inChunkZ = spawnZ - (chunkY*16)
|
||||||
while (blockArray[inChunkX, inChunkZ, spawnY] != 0):
|
|
||||||
spawnY += 1
|
## find the first air block
|
||||||
if spawnY == 128:
|
while (blockArray[inChunkX, inChunkZ, spawnY] != 0):
|
||||||
break
|
spawnY += 1
|
||||||
|
if spawnY == 128:
|
||||||
|
break
|
||||||
|
|
||||||
self.POI.append( dict(x=spawnX, y=spawnY, z=spawnZ,
|
self.POI.append( dict(x=spawnX, y=spawnY, z=spawnZ,
|
||||||
msg="Spawn", type="spawn", chunk=(inChunkX,inChunkZ)))
|
msg="Spawn", type="spawn", chunk=(chunkX, chunkY)))
|
||||||
self.spawn = (spawnX, spawnY, spawnZ)
|
self.spawn = (spawnX, spawnY, spawnZ)
|
||||||
|
|
||||||
def go(self, procs):
|
def go(self, procs):
|
||||||
|
|||||||
Reference in New Issue
Block a user