Compare commits

..

No commits in common. "b65c80d55e7b16ec729d326f2b2ad7ffd8e6fa52" and "83baf5a8a019b9a49fa29130d1208136ba315748" have entirely different histories.

2 changed files with 8 additions and 13 deletions

View File

@ -331,7 +331,6 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
init {
capabilityCaches.add(this)
waitForServerLevel { rebuildCache() }
}
override fun get(): T? {
@ -362,10 +361,6 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
// IllegalStateException("Do not call getCapability on an invalid cache or from the invalidation listener!")
// what a shame.
{ onceServer { if (!isRemoved && creationVersion == currentVersion) listeners.accept(cache?.capability) } })
onceServer {
if (!isRemoved && creationVersion == currentVersion) listeners.accept(cache?.capability)
}
}
}
@ -381,6 +376,7 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
if (!level.isClientSide) {
subscribe()
waitForServerLevel.forEach { it.invoke() }
capabilityCaches.forEach { it.rebuildCache() }
waitForServerLevel.clear()
} else {
waitForServerLevel.clear()

View File

@ -1,13 +1,16 @@
package ru.dbotthepony.mc.otm.core.util
import it.unimi.dsi.fastutil.objects.ObjectArrayList
import it.unimi.dsi.fastutil.objects.ObjectArraySet
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap
import it.unimi.dsi.fastutil.objects.ObjectAVLTreeSet
import org.apache.logging.log4j.LogManager
import java.util.*
import ru.dbotthepony.mc.otm.core.addSorted
import java.util.LinkedList
import java.util.PriorityQueue
import java.util.concurrent.atomic.AtomicInteger
class TickList : ITickable {
private val tickers = LinkedList<IConditionalTickable>()
private val queuedTickers = ObjectArraySet<IConditionalTickable>()
private val queuedTickers = ArrayList<IConditionalTickable>()
private val timers = PriorityQueue<Timer>()
private val namedTimers = HashMap<Any?, Timer>()
@ -68,10 +71,6 @@ class TickList : ITickable {
add(this)
} else {
queuedTickers.remove(this)
if (!inTicker) {
tickers.remove(this)
}
}
}
}