Specify default cache size to 16384 entries, and bump cache size for matter entangler
This commit is contained in:
parent
2d1c9184f4
commit
072d2187f8
@ -92,7 +92,7 @@ class MatterEntanglerBlockEntity(blockPos: BlockPos, blockState: BlockState) : M
|
|||||||
}
|
}
|
||||||
|
|
||||||
private inner class InputSlot(container: SlottedContainer, slot: Int) : FilteredContainerSlot(container, slot) {
|
private inner class InputSlot(container: SlottedContainer, slot: Int) : FilteredContainerSlot(container, slot) {
|
||||||
val insertCache = SimpleCache<ItemStackKey, Boolean>(1024L, Duration.ofMinutes(1))
|
val insertCache = SimpleCache<ItemStackKey, Boolean>(Duration.ofMinutes(1))
|
||||||
|
|
||||||
override fun canAutomationPlaceItem(itemStack: ItemStack): Boolean {
|
override fun canAutomationPlaceItem(itemStack: ItemStack): Boolean {
|
||||||
if (!super.canAutomationPlaceItem(itemStack))
|
if (!super.canAutomationPlaceItem(itemStack))
|
||||||
|
@ -202,7 +202,7 @@ sealed class AbstractPoweredFurnaceBlockEntity<P : AbstractCookingRecipe, S : Ma
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
// shared by all furnace instances, so cache should be large enough
|
// shared by all furnace instances, so cache should be large enough
|
||||||
private val acceptableItems = SimpleCache<ItemStackKey, Boolean>(16384L, Duration.ofMinutes(1))
|
private val acceptableItems = SimpleCache<ItemStackKey, Boolean>(Duration.ofMinutes(1))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +127,6 @@ class PlatePressBlockEntity(
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private val cache = SimpleCache<ItemStackKey, Boolean>(16384L, Duration.ofMinutes(1L))
|
private val cache = SimpleCache<ItemStackKey, Boolean>(Duration.ofMinutes(1L))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -610,3 +610,7 @@ fun <K : Any, V> SimpleCache(size: Long, freshness: Duration): Cache<K, V> {
|
|||||||
.expireAfterWrite(freshness)
|
.expireAfterWrite(freshness)
|
||||||
.build()
|
.build()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun <K : Any, V> SimpleCache(freshness: Duration): Cache<K, V> {
|
||||||
|
return SimpleCache(16384L, freshness)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user