Improved async ticks
This commit is contained in:
@@ -9,6 +9,7 @@ class CrateDisplay(
|
||||
|
||||
fun start() {
|
||||
plugin.scheduler.runTimer(1, 1) { tick() }
|
||||
plugin.scheduler.runAsyncTimer(1, 1) { tickAsync() }
|
||||
}
|
||||
|
||||
private fun tick() {
|
||||
@@ -18,4 +19,10 @@ class CrateDisplay(
|
||||
|
||||
tick++
|
||||
}
|
||||
|
||||
private fun tickAsync() {
|
||||
for (crate in PlacedCrates.values()) {
|
||||
crate.tickAsync(tick)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,10 +24,9 @@ class PlacedCrate(
|
||||
|
||||
internal fun tick(tick: Int) {
|
||||
tick.toLong() // Just shut up, compiler
|
||||
plugin.scheduler.runAsync { tickAsync(tick) }
|
||||
}
|
||||
|
||||
private fun tickAsync(tick: Int) {
|
||||
internal fun tickAsync(tick: Int) {
|
||||
tickParticles(tick)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user