another mutablelist>arraylist

This commit is contained in:
Player Name 2026-08-01 04:37:36 +02:00
parent 572ec05137
commit 7e0b684a20

View file

@ -24,13 +24,8 @@ object MapChunkRenderer {
fun render(player: Player) {
val last = player.playerFlags.lastViewport
val updated: ArrayList<RegionChunk> = ArrayList()
val current: ArrayList<MutableList<RegionChunk>> = ArrayList()
val current: ArrayList<ArrayList<RegionChunk>> = ArrayList()
// Center the build area on the loaded scene anchor (lastSceneGraph), NOT the live player position.
// The client's 13x13 build area is anchored at lastSceneGraph; addressing chunks relative to it keeps
// every chunk packet inside the client's scene window even when the player has drifted up to 3 chunks
// from the anchor (the scene graph only rebuilds at a drift of 4). Using player.location here instead
// 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)
for (dcx in -BUILD_AREA_DEPTH..BUILD_AREA_DEPTH) {
@ -76,7 +71,7 @@ object MapChunkRenderer {
* @param c The region chunk.
* @return `True` if so.
*/
private fun containsChunk(list: MutableList<MutableList<RegionChunk>>, c: RegionChunk): Boolean {
private fun containsChunk(list: ArrayList<ArrayList<RegionChunk>>, c: RegionChunk): Boolean {
val sizeList = list.size
for (x in 0 until sizeList) {
val chunkSize: Int = list[x].size