diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt index 7455987c3..592b64844 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatteryPoweredBlockEntity.kt @@ -12,7 +12,7 @@ import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer import ru.dbotthepony.mc.otm.core.math.Decimal abstract class MatteryPoweredBlockEntity(p_155228_: BlockEntityType<*>, p_155229_: BlockPos, p_155230_: BlockState) : MatteryDeviceBlockEntity(p_155228_, p_155229_, p_155230_) { - val batteryContainer = SlottedContainer.simple(1, AutomationFilters.DISCHARGABLE.simpleProvider, ::markDirtyFast).also(::addDroppableContainer) + val batteryContainer = SlottedContainer.simple(1, AutomationFilters.DISCHARGABLE.filteredProvider, ::markDirtyFast).also(::addDroppableContainer) open val energy: IMatteryEnergyStorage? get() = null diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryPoweredMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryPoweredMenu.kt index 2774dca95..a8853c826 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryPoweredMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatteryPoweredMenu.kt @@ -16,7 +16,7 @@ abstract class MatteryPoweredMenu protected constructor( tile: MatteryPoweredBlockEntity? = null ) : MatteryMenu(menuType, containerID, inventory, tile) { val energyWidget = LevelGaugeWidget(this, tile?.energy) - val batterySlot = BatteryMenuSlot(tile?.batteryContainer ?: SlottedContainer.simple(1), 0) + val batterySlot = BatteryMenuSlot(tile?.batteryContainer ?: SlottedContainer.filtered(1), 0) val redstoneConfig = EnumInputWithFeedback(this) init { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/Slots.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/Slots.kt index f14232d0e..c657e90bc 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/Slots.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/Slots.kt @@ -140,7 +140,7 @@ open class OutputMenuSlot(container: Container, index: Int, x: Int = 0, y: Int = } } -open class BatteryMenuSlot(container: Container, index: Int, x: Int = 0, y: Int = 0) : MatteryMenuSlot(container, index, x, y) { +open class BatteryMenuSlot(container: Container, index: Int, x: Int = 0, y: Int = 0) : UserFilteredMenuSlot(container, index, x, y) { override fun mayPlace(itemStack: ItemStack): Boolean { return super.mayPlace(itemStack) && (itemStack.energy?.canExtract() ?: false) }