Compare commits
No commits in common. "b65c80d55e7b16ec729d326f2b2ad7ffd8e6fa52" and "83baf5a8a019b9a49fa29130d1208136ba315748" have entirely different histories.
b65c80d55e
...
83baf5a8a0
@ -331,7 +331,6 @@ abstract class MatteryBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: Bloc
|
|||||||
|
|
||||||
init {
|
init {
|
||||||
capabilityCaches.add(this)
|
capabilityCaches.add(this)
|
||||||
waitForServerLevel { rebuildCache() }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun get(): T? {
|
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!")
|
// IllegalStateException("Do not call getCapability on an invalid cache or from the invalidation listener!")
|
||||||
// what a shame.
|
// what a shame.
|
||||||
{ onceServer { if (!isRemoved && creationVersion == currentVersion) listeners.accept(cache?.capability) } })
|
{ 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) {
|
if (!level.isClientSide) {
|
||||||
subscribe()
|
subscribe()
|
||||||
waitForServerLevel.forEach { it.invoke() }
|
waitForServerLevel.forEach { it.invoke() }
|
||||||
|
capabilityCaches.forEach { it.rebuildCache() }
|
||||||
waitForServerLevel.clear()
|
waitForServerLevel.clear()
|
||||||
} else {
|
} else {
|
||||||
waitForServerLevel.clear()
|
waitForServerLevel.clear()
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
package ru.dbotthepony.mc.otm.core.util
|
package ru.dbotthepony.mc.otm.core.util
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList
|
import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectArraySet
|
import it.unimi.dsi.fastutil.objects.ObjectAVLTreeSet
|
||||||
import org.apache.logging.log4j.LogManager
|
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 {
|
class TickList : ITickable {
|
||||||
private val tickers = LinkedList<IConditionalTickable>()
|
private val tickers = LinkedList<IConditionalTickable>()
|
||||||
private val queuedTickers = ObjectArraySet<IConditionalTickable>()
|
private val queuedTickers = ArrayList<IConditionalTickable>()
|
||||||
|
|
||||||
private val timers = PriorityQueue<Timer>()
|
private val timers = PriorityQueue<Timer>()
|
||||||
private val namedTimers = HashMap<Any?, Timer>()
|
private val namedTimers = HashMap<Any?, Timer>()
|
||||||
@ -68,10 +71,6 @@ class TickList : ITickable {
|
|||||||
add(this)
|
add(this)
|
||||||
} else {
|
} else {
|
||||||
queuedTickers.remove(this)
|
queuedTickers.remove(this)
|
||||||
|
|
||||||
if (!inTicker) {
|
|
||||||
tickers.remove(this)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user