mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-14 09:56:37 -04:00
bump kutil to 1.15
* This finally fixes some interrupting issues and missing chunks
This commit is contained in:
parent
e9be189404
commit
0df6f16c64
2
pom.xml
2
pom.xml
@ -510,7 +510,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.bixilon</groupId>
|
<groupId>de.bixilon</groupId>
|
||||||
<artifactId>kutil</artifactId>
|
<artifactId>kutil</artifactId>
|
||||||
<version>1.14.1</version>
|
<version>1.15</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.netty</groupId>
|
<groupId>io.netty</groupId>
|
||||||
|
@ -102,6 +102,7 @@ class WorldRenderer(
|
|||||||
private val preparingTasks: MutableSet<SectionPrepareTask> = mutableSetOf() // current running section preparing tasks
|
private val preparingTasks: MutableSet<SectionPrepareTask> = mutableSetOf() // current running section preparing tasks
|
||||||
private val preparingTasksLock = SimpleLock()
|
private val preparingTasksLock = SimpleLock()
|
||||||
|
|
||||||
|
@Volatile
|
||||||
private var workingOnQueue = false
|
private var workingOnQueue = false
|
||||||
private val queue: MutableList<WorldQueueItem> = mutableListOf() // queue, that is visible, and should be rendered
|
private val queue: MutableList<WorldQueueItem> = mutableListOf() // queue, that is visible, and should be rendered
|
||||||
private val queueSet: MutableSet<WorldQueueItem> = HashSet() // queue, that is visible, and should be rendered
|
private val queueSet: MutableSet<WorldQueueItem> = HashSet() // queue, that is visible, and should be rendered
|
||||||
@ -448,19 +449,20 @@ class WorldRenderer(
|
|||||||
}
|
}
|
||||||
workingOnQueue = true
|
workingOnQueue = true
|
||||||
|
|
||||||
|
|
||||||
val items: MutableList<WorldQueueItem> = mutableListOf()
|
val items: MutableList<WorldQueueItem> = mutableListOf()
|
||||||
queueLock.lock()
|
queueLock.lock()
|
||||||
for (i in 0 until maxPreparingTasks - size) {
|
for (i in 0 until maxPreparingTasks - size) {
|
||||||
if (queue.isEmpty()) {
|
if (queue.isEmpty()) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
val item = queue.removeAt(0)
|
val item = queue.removeFirst()
|
||||||
queueSet.remove(item)
|
queueSet.remove(item)
|
||||||
items += item
|
items += item
|
||||||
}
|
}
|
||||||
queueLock.unlock()
|
queueLock.unlock()
|
||||||
for (item in items) {
|
for (item in items) {
|
||||||
val task = SectionPrepareTask(item.chunkPosition, item.sectionHeight, ThreadPoolRunnable(if (item.chunkPosition == cameraChunkPosition) HIGH else LOW, interuptable = true)) // Our own chunk is the most important one ToDo: Also make neighbour chunks important
|
val task = SectionPrepareTask(item.chunkPosition, item.sectionHeight, ThreadPoolRunnable(if (item.chunkPosition == cameraChunkPosition) HIGH else LOW, interruptable = true)) // Our own chunk is the most important one ToDo: Also make neighbour chunks important
|
||||||
task.runnable.runnable = Runnable {
|
task.runnable.runnable = Runnable {
|
||||||
prepareItem(item, task, task.runnable)
|
prepareItem(item, task, task.runnable)
|
||||||
}
|
}
|
||||||
@ -490,7 +492,7 @@ class WorldRenderer(
|
|||||||
return queueItemUnload(item)
|
return queueItemUnload(item)
|
||||||
}
|
}
|
||||||
item.mesh = mesh
|
item.mesh = mesh
|
||||||
runnable.interuptable = false
|
runnable.interruptable = false
|
||||||
meshesToLoadLock.lock()
|
meshesToLoadLock.lock()
|
||||||
if (meshesToLoadSet.remove(item)) {
|
if (meshesToLoadSet.remove(item)) {
|
||||||
meshesToLoad.remove(item) // Remove duplicates
|
meshesToLoad.remove(item) // Remove duplicates
|
||||||
@ -509,6 +511,7 @@ class WorldRenderer(
|
|||||||
throw exception
|
throw exception
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
task.runnable.interruptable = false
|
||||||
preparingTasksLock.lock()
|
preparingTasksLock.lock()
|
||||||
preparingTasks -= task
|
preparingTasks -= task
|
||||||
preparingTasksLock.unlock()
|
preparingTasksLock.unlock()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user