More circular world test

This commit is contained in:
DBotThePony 2022-08-05 11:40:39 +07:00
parent 2653d043a9
commit 0866edcb74
Signed by: DBot
GPG Key ID: DCC23B5715498507
3 changed files with 3 additions and 3 deletions

View File

@ -107,7 +107,7 @@ fun main() {
var set = 0L
var parse = 0L
for (chunkX in 0 .. 61) {
for (chunkX in 0 .. 94) {
for (chunkY in 0 .. 61) {
var t = System.currentTimeMillis()
val data = db.read(byteArrayOf(1, 0, chunkX.toByte(), 0, chunkY.toByte()))

View File

@ -125,7 +125,7 @@ class StarboundClient : AutoCloseable {
val gl = GLStateTracker()
var world: ClientWorld? = ClientWorld(this, 0L, 0)
var world: ClientWorld? = ClientWorld(this, 0L, 94)
fun ensureSameThread() = gl.ensureSameThread()

View File

@ -258,7 +258,7 @@ abstract class World<This : World<This, ChunkType>, ChunkType : Chunk<This, Chun
*/
open fun computeIfAbsent(pos: ChunkPos): ChunkType {
@Suppress("Name_Shadowing")
val pos = pos.circular(widthInChunks)
val pos = if (isCircular) pos.circular(widthInChunks) else pos
val _lastAccessedChunk = lastAccessedChunk