Skip to content

Commit a24ad4c

Browse files
Fixed rendering of new height and depth limit in 1.18
1 parent 7171af5 commit a24ad4c

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

overviewer_core/src/iterate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ bool load_chunk(RenderState* state, int32_t x, int32_t z, uint8_t required) {
178178
if (!ycoord)
179179
continue;
180180

181-
sectiony = PyLong_AsLong(ycoord);
181+
sectiony = PyLong_AsLong(ycoord) + 4;
182182
if (sectiony >= 0 && sectiony < SECTIONS_PER_CHUNK)
183183
load_chunk_section(dest, sectiony, section);
184184
}
@@ -353,7 +353,7 @@ generate_pseudo_data(RenderState* state, uint16_t ancilData) {
353353
/* calculate the global block coordinates of this position */
354354
wx = (state->chunkx * 16) + x;
355355
wz = (state->chunkz * 16) + z;
356-
wy = (state->chunky * 16) + y;
356+
wy = ((state->chunky - 4) * 16) + y;
357357
/* lilypads orientation is obtained with these magic numbers */
358358
/* magic numbers obtained from: */
359359
/* http://llbit.se/?p=1537 */

overviewer_core/src/overviewer.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
// increment this value if you've made a change to the c extension
3333
// and want to force users to rebuild
34-
#define OVERVIEWER_EXTENSION_VERSION 107
34+
#define OVERVIEWER_EXTENSION_VERSION 108
3535

3636
#include <stdbool.h>
3737
#include <stdint.h>
@@ -78,7 +78,7 @@ PyObject* resize_half_wrap(PyObject* self, PyObject* args);
7878
typedef struct _RenderMode RenderMode;
7979

8080
/* in iterate.c */
81-
#define SECTIONS_PER_CHUNK 16
81+
#define SECTIONS_PER_CHUNK 24
8282
typedef struct {
8383
/* whether this chunk is loaded: use load_chunk to load */
8484
int32_t loaded;

overviewer_core/tileset.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1081,7 +1081,7 @@ def _render_rendertile(self, tile):
10811081
max_chunk_mtime = 0
10821082
for col, row, chunkx, chunky, chunkz, chunk_mtime in chunks:
10831083
xpos = -192 + (col - colstart) * 192
1084-
ypos = -96 + (row - rowstart) * 96 + (16 - 1 - chunky) * 192
1084+
ypos = -96 + (row - rowstart) * 96 + (24 - 1 - chunky) * 192
10851085

10861086
if chunk_mtime > max_chunk_mtime:
10871087
max_chunk_mtime = chunk_mtime
@@ -1324,12 +1324,12 @@ def get_tiles_by_chunk(chunkcol, chunkrow):
13241324
colrange = (tilecol,)
13251325

13261326
# If this chunk is in a row divisible by 4, then it touches the
1327-
# tile above it as well. Also touches the next 4 tiles down (16
1327+
# tile above it as well. Also touches the next 6 tiles down (24
13281328
# rows)
13291329
if chunkrow % 4 == 0:
1330-
rowrange = range(tilerow - 4, tilerow + 32 + 1, 4)
1330+
rowrange = range(tilerow - 4, tilerow + 48 + 1, 4)
13311331
else:
1332-
rowrange = range(tilerow, tilerow + 32 + 1, 4)
1332+
rowrange = range(tilerow, tilerow + 48 + 1, 4)
13331333

13341334
return product(colrange, rowrange)
13351335

@@ -1360,12 +1360,12 @@ def get_mtime(x, y):
13601360
# First do the odd. For each chunk in the tile's odd column the tile
13611361
# "passes through" three chunk sections.
13621362
oddcol_sections = []
1363-
for i, y in enumerate(reversed(range(16))):
1363+
for i, y in enumerate(reversed(range(24))):
13641364
for row in range(tile.row + 3 - i * 2, tile.row - 2 - i * 2, -2):
13651365
oddcol_sections.append((tile.col + 1, row, y))
13661366

13671367
evencol_sections = []
1368-
for i, y in enumerate(reversed(range(16))):
1368+
for i, y in enumerate(reversed(range(24))):
13691369
for row in range(tile.row + 4 - i * 2, tile.row - 3 - i * 2, -2):
13701370
evencol_sections.append((tile.col + 2, row, y))
13711371
evencol_sections.append((tile.col, row, y))

overviewer_core/world.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ def find_true_spawn(self):
200200
## clamp spawnY to a sane value, in-chunk value
201201
if spawnY < 0:
202202
spawnY = 0
203-
if spawnY > 255:
204-
spawnY = 255
203+
if spawnY > 319:
204+
spawnY = 319
205205

206206
## The chunk that holds the spawn location
207207
chunkX = spawnX//16
@@ -236,7 +236,7 @@ def find_true_spawn(self):
236236
spawnY += 1
237237
# Next section, start at local 0
238238
inChunkY = 0
239-
return spawnX, 256, spawnZ
239+
return spawnX, 320, spawnZ
240240

241241
class RegionSet(object):
242242
"""This object is the gateway to a particular Minecraft dimension within a

0 commit comments

Comments
 (0)