Revert "map chunk render debug"

This reverts commit aa4d62a556d09c20013485a874475a2fa3e0d824.
This commit is contained in:
Player Name 2026-06-28 21:20:54 +02:00
parent 25842c7518
commit 8af95dbd4d

View file

@ -1,6 +1,5 @@
package core.game.world.update
import core.api.log
import core.game.node.entity.player.Player
import core.game.world.map.Location
import core.game.world.map.RegionChunk
@ -8,7 +7,6 @@ import core.game.world.map.build.DynamicRegion
import core.net.packet.PacketRepository
import core.net.packet.context.ClearChunkContext
import core.net.packet.out.ClearRegionChunk
import core.tools.Log
import java.util.*
/**
@ -35,45 +33,20 @@ object MapChunkRenderer {
// pushes the viewport edge to drift+6 chunks from the anchor, off-window, so edge items never render.
val anchor = player.playerFlags.lastSceneGraph ?: player.location
val center = Location.create(anchor.x, anchor.y, player.location.z)
log(MapChunkRenderer::class.java, Log.FINE,
"anchor=${anchor} center=${center} " +
"anchorChunk=(${anchor.absChunkX},${anchor.absChunkY}) " +
"anchorOffset=(${anchor.chunkOffsetX},${anchor.chunkOffsetY}) " +
"playerLoc=${player.location}")
val itemChunkX = 392
val itemChunkY = 476
var itemChunkSamples = 0
for (dcx in -buildAreaDepth..+buildAreaDepth) {
val addX = ArrayList<RegionChunk>()
for (dcy in -buildAreaDepth..+buildAreaDepth) {
val newloc = center.transform(dcx * 8, dcy * 8, 0)
addX.add(newloc.chunk)
if (newloc.absChunkX == itemChunkX && newloc.absChunkY == itemChunkY) {
itemChunkSamples++
if (true) {
log(MapChunkRenderer::class.java, Log.FINE,
"item chunk sampled at grid[$dcx+6][$dcy+6] newloc=${newloc}")
}
}
}
current.add(addX)
}
if (true) {
log(MapChunkRenderer::class.java, Log.FINE, "itemChunkSamples=$itemChunkSamples")
}
var sizeX = last.size
for (x in 0 until sizeX) {
val sizeY: Int = last[x].size
for (y in 0 until sizeY) {
val previous = last[x][y] ?: continue
val isItemChunk = previous.currentBase.absChunkX == itemChunkX && previous.currentBase.absChunkY == itemChunkY
if (isItemChunk) {
log(MapChunkRenderer::class.java, Log.FINE,
"last has item chunk at [$x][$y], containsChunk=${containsChunk(current, previous)}")
}
if (containsChunk(current, previous)) {
updated.add(previous)
continue
@ -90,12 +63,6 @@ object MapChunkRenderer {
val sizeY: Int = current[x].size
for (y in 0 until sizeY) {
val chunk = current[x][y]
val isItemChunk = chunk.currentBase.absChunkX == itemChunkX && chunk.currentBase.absChunkY == itemChunkY
if (isItemChunk) {
log(MapChunkRenderer::class.java, Log.FINE,
"item chunk at grid[$x][$y] -> ${if (updated.contains(chunk)) "UPDATE" else "SYNCHRONIZE"} " +
"(inLast=${updated.contains(chunk)}) ")
}
if (updated.contains(chunk)) {
chunk.update(player)
} else {