diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterEntanglerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterEntanglerBlockEntity.kt index dbdd0e799..5dfb606a1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterEntanglerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterEntanglerBlockEntity.kt @@ -92,7 +92,7 @@ class MatterEntanglerBlockEntity(blockPos: BlockPos, blockState: BlockState) : M } private inner class InputSlot(container: SlottedContainer, slot: Int) : FilteredContainerSlot(container, slot) { - val insertCache = SimpleCache(1024L, Duration.ofMinutes(1)) + val insertCache = SimpleCache(Duration.ofMinutes(1)) override fun canAutomationPlaceItem(itemStack: ItemStack): Boolean { if (!super.canAutomationPlaceItem(itemStack)) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt index 1145eec92..6ef977b1a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt @@ -202,7 +202,7 @@ sealed class AbstractPoweredFurnaceBlockEntity

(16384L, Duration.ofMinutes(1)) + private val acceptableItems = SimpleCache(Duration.ofMinutes(1)) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/PlatePressBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/PlatePressBlockEntity.kt index a415dfc26..59d6d166a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/PlatePressBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/PlatePressBlockEntity.kt @@ -127,6 +127,6 @@ class PlatePressBlockEntity( } companion object { - private val cache = SimpleCache(16384L, Duration.ofMinutes(1L)) + private val cache = SimpleCache(Duration.ofMinutes(1L)) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt index d839a4269..c099f54d9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/Ext.kt @@ -610,3 +610,7 @@ fun SimpleCache(size: Long, freshness: Duration): Cache { .expireAfterWrite(freshness) .build() } + +fun SimpleCache(freshness: Duration): Cache { + return SimpleCache(16384L, freshness) +}