Remove HandlerFilter
This commit is contained in:
parent
7c6d58b782
commit
fd9960bd86
@ -6,7 +6,6 @@ import net.minecraft.world.level.block.state.BlockState
|
|||||||
import ru.dbotthepony.mc.otm.capability.energy
|
import ru.dbotthepony.mc.otm.capability.energy
|
||||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||||
import ru.dbotthepony.mc.otm.capability.extractEnergy
|
import ru.dbotthepony.mc.otm.capability.extractEnergy
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||||
|
@ -29,7 +29,6 @@ import net.minecraft.world.phys.Vec3
|
|||||||
import net.neoforged.neoforge.capabilities.Capabilities
|
import net.neoforged.neoforge.capabilities.Capabilities
|
||||||
import ru.dbotthepony.mc.otm.block.decorative.CargoCrateBlock
|
import ru.dbotthepony.mc.otm.block.decorative.CargoCrateBlock
|
||||||
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||||
|
@ -18,7 +18,6 @@ import ru.dbotthepony.mc.otm.capability.item.CombinedItemHandler
|
|||||||
import ru.dbotthepony.mc.otm.capability.fluid.BlockMatteryFluidHandler
|
import ru.dbotthepony.mc.otm.capability.fluid.BlockMatteryFluidHandler
|
||||||
import ru.dbotthepony.mc.otm.capability.moveFluid
|
import ru.dbotthepony.mc.otm.capability.moveFluid
|
||||||
import ru.dbotthepony.mc.otm.config.ItemsConfig
|
import ru.dbotthepony.mc.otm.config.ItemsConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.get
|
import ru.dbotthepony.mc.otm.container.get
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilter
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilter
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
|
@ -18,7 +18,6 @@ import net.neoforged.neoforge.capabilities.Capabilities
|
|||||||
import net.neoforged.neoforge.fluids.FluidStack
|
import net.neoforged.neoforge.fluids.FluidStack
|
||||||
import net.neoforged.neoforge.fluids.capability.IFluidHandler
|
import net.neoforged.neoforge.fluids.capability.IFluidHandler
|
||||||
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.core.immutableList
|
import ru.dbotthepony.mc.otm.core.immutableList
|
||||||
|
@ -21,7 +21,6 @@ import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
|||||||
import ru.dbotthepony.mc.otm.capability.matter.MatterStorageImpl
|
import ru.dbotthepony.mc.otm.capability.matter.MatterStorageImpl
|
||||||
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.UpgradeContainer
|
import ru.dbotthepony.mc.otm.container.UpgradeContainer
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
||||||
|
@ -16,7 +16,6 @@ import ru.dbotthepony.mc.otm.capability.FlowDirection
|
|||||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||||
import ru.dbotthepony.mc.otm.capability.matter.IMatterStorage
|
import ru.dbotthepony.mc.otm.capability.matter.IMatterStorage
|
||||||
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.core.immutableList
|
import ru.dbotthepony.mc.otm.core.immutableList
|
||||||
|
@ -21,7 +21,6 @@ import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
|||||||
import ru.dbotthepony.mc.otm.capability.matter.MatterStorageImpl
|
import ru.dbotthepony.mc.otm.capability.matter.MatterStorageImpl
|
||||||
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
||||||
|
@ -24,7 +24,6 @@ import ru.dbotthepony.mc.otm.capability.matter.PatternState
|
|||||||
import ru.dbotthepony.mc.otm.capability.matter.MatterStorageImpl
|
import ru.dbotthepony.mc.otm.capability.matter.MatterStorageImpl
|
||||||
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.UpgradeContainer
|
import ru.dbotthepony.mc.otm.container.UpgradeContainer
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
|
@ -25,7 +25,6 @@ import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
|
|||||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||||
import ru.dbotthepony.mc.otm.capability.matter.*
|
import ru.dbotthepony.mc.otm.capability.matter.*
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||||
|
@ -20,7 +20,6 @@ import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
|
|||||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||||
import ru.dbotthepony.mc.otm.capability.matter.PatternState
|
import ru.dbotthepony.mc.otm.capability.matter.PatternState
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.menu.matter.MatterScannerMenu
|
import ru.dbotthepony.mc.otm.menu.matter.MatterScannerMenu
|
||||||
|
@ -19,7 +19,6 @@ import ru.dbotthepony.mc.otm.capability.energyStoredMattery
|
|||||||
import ru.dbotthepony.mc.otm.capability.matteryEnergy
|
import ru.dbotthepony.mc.otm.capability.matteryEnergy
|
||||||
import ru.dbotthepony.mc.otm.capability.maxEnergyStoredMattery
|
import ru.dbotthepony.mc.otm.capability.maxEnergyStoredMattery
|
||||||
import ru.dbotthepony.mc.otm.capability.transcieveEnergy
|
import ru.dbotthepony.mc.otm.capability.transcieveEnergy
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
|
@ -12,7 +12,6 @@ import ru.dbotthepony.mc.otm.capability.*
|
|||||||
import ru.dbotthepony.mc.otm.capability.energy.GeneratorEnergyStorage
|
import ru.dbotthepony.mc.otm.capability.energy.GeneratorEnergyStorage
|
||||||
import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
|
import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.menu.tech.ChemicalGeneratorMenu
|
import ru.dbotthepony.mc.otm.menu.tech.ChemicalGeneratorMenu
|
||||||
|
@ -11,7 +11,6 @@ import ru.dbotthepony.mc.otm.block.entity.ItemJob
|
|||||||
import ru.dbotthepony.mc.otm.block.entity.JobContainer
|
import ru.dbotthepony.mc.otm.block.entity.JobContainer
|
||||||
import ru.dbotthepony.mc.otm.block.entity.JobStatus
|
import ru.dbotthepony.mc.otm.block.entity.JobStatus
|
||||||
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.menu.tech.CobblerMenu
|
import ru.dbotthepony.mc.otm.menu.tech.CobblerMenu
|
||||||
|
@ -16,7 +16,6 @@ import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
|
|||||||
import ru.dbotthepony.mc.otm.capability.moveEnergy
|
import ru.dbotthepony.mc.otm.capability.moveEnergy
|
||||||
import ru.dbotthepony.mc.otm.config.EnergyBalanceValues
|
import ru.dbotthepony.mc.otm.config.EnergyBalanceValues
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.core.math.RelativeSide
|
import ru.dbotthepony.mc.otm.core.math.RelativeSide
|
||||||
|
@ -18,7 +18,6 @@ import ru.dbotthepony.mc.otm.capability.FlowDirection
|
|||||||
import ru.dbotthepony.mc.otm.capability.energy.CombinedProfiledEnergyStorage
|
import ru.dbotthepony.mc.otm.capability.energy.CombinedProfiledEnergyStorage
|
||||||
import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
|
import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
|
||||||
import ru.dbotthepony.mc.otm.capability.moveEnergy
|
import ru.dbotthepony.mc.otm.capability.moveEnergy
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.core.math.RelativeSide
|
import ru.dbotthepony.mc.otm.core.math.RelativeSide
|
||||||
|
@ -16,7 +16,6 @@ import ru.dbotthepony.mc.otm.capability.extractEnergy
|
|||||||
import ru.dbotthepony.mc.otm.capability.maxEnergyStoredMattery
|
import ru.dbotthepony.mc.otm.capability.maxEnergyStoredMattery
|
||||||
import ru.dbotthepony.mc.otm.capability.moveEnergy
|
import ru.dbotthepony.mc.otm.capability.moveEnergy
|
||||||
import ru.dbotthepony.mc.otm.capability.receiveEnergy
|
import ru.dbotthepony.mc.otm.capability.receiveEnergy
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
|
@ -24,7 +24,6 @@ import ru.dbotthepony.mc.otm.block.tech.EssenceStorageBlock
|
|||||||
import ru.dbotthepony.mc.otm.capability.item.CombinedItemHandler
|
import ru.dbotthepony.mc.otm.capability.item.CombinedItemHandler
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.EnhancedContainer
|
import ru.dbotthepony.mc.otm.container.EnhancedContainer
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.ContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
|
@ -9,7 +9,6 @@ import net.minecraft.world.level.block.state.BlockState
|
|||||||
import net.neoforged.neoforge.capabilities.Capabilities
|
import net.neoforged.neoforge.capabilities.Capabilities
|
||||||
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.MatteryDeviceBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.block.entity.decorative.CargoCrateBlockEntity
|
import ru.dbotthepony.mc.otm.block.entity.decorative.CargoCrateBlockEntity
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.core.multiblock.BlockEntityTag
|
import ru.dbotthepony.mc.otm.core.multiblock.BlockEntityTag
|
||||||
|
@ -15,7 +15,6 @@ import ru.dbotthepony.mc.otm.capability.matter.MatterStorageImpl
|
|||||||
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
import ru.dbotthepony.mc.otm.capability.matter.ProfiledMatterStorage
|
||||||
import ru.dbotthepony.mc.otm.capability.moveMatter
|
import ru.dbotthepony.mc.otm.capability.moveMatter
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
import ru.dbotthepony.mc.otm.container.slotted.SlottedContainer
|
||||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
import ru.dbotthepony.mc.otm.core.math.Decimal
|
||||||
|
@ -18,7 +18,6 @@ import ru.dbotthepony.mc.otm.capability.UpgradeType
|
|||||||
import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
|
import ru.dbotthepony.mc.otm.capability.energy.ProfiledEnergyStorage
|
||||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||||
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
import ru.dbotthepony.mc.otm.config.MachinesConfig
|
||||||
import ru.dbotthepony.mc.otm.container.HandlerFilter
|
|
||||||
import ru.dbotthepony.mc.otm.container.balance
|
import ru.dbotthepony.mc.otm.container.balance
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
import ru.dbotthepony.mc.otm.container.slotted.AutomationFilters
|
||||||
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
import ru.dbotthepony.mc.otm.container.slotted.FilteredContainerSlot
|
||||||
|
@ -1,153 +0,0 @@
|
|||||||
package ru.dbotthepony.mc.otm.container
|
|
||||||
|
|
||||||
import net.minecraft.world.item.ItemStack
|
|
||||||
import net.neoforged.neoforge.capabilities.Capabilities
|
|
||||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
|
||||||
import ru.dbotthepony.mc.otm.capability.fluid.stream
|
|
||||||
import ru.dbotthepony.mc.otm.core.isNotEmpty
|
|
||||||
import ru.dbotthepony.mc.otm.core.math.Decimal
|
|
||||||
|
|
||||||
interface HandlerFilter {
|
|
||||||
fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
fun preInsert(slot: Int, stack: ItemStack, simulate: Boolean) {}
|
|
||||||
fun preExtract(slot: Int, amount: Int, simulate: Boolean) {}
|
|
||||||
|
|
||||||
fun modifyInsertCount(slot: Int, stack: ItemStack, existing: ItemStack, simulate: Boolean): Int {
|
|
||||||
return stack.count
|
|
||||||
}
|
|
||||||
|
|
||||||
fun modifyExtractCount(slot: Int, amount: Int, simulate: Boolean): Int {
|
|
||||||
return amount
|
|
||||||
}
|
|
||||||
|
|
||||||
fun and(other: HandlerFilter): HandlerFilter {
|
|
||||||
return object : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return this@HandlerFilter.canInsert(slot, stack) && other.canInsert(slot, stack)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return this@HandlerFilter.canExtract(slot, amount, stack) && other.canExtract(slot, amount, stack)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun preInsert(slot: Int, stack: ItemStack, simulate: Boolean) {
|
|
||||||
this@HandlerFilter.preInsert(slot, stack, simulate)
|
|
||||||
other.preInsert(slot, stack, simulate)
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun preExtract(slot: Int, amount: Int, simulate: Boolean) {
|
|
||||||
this@HandlerFilter.preExtract(slot, amount, simulate)
|
|
||||||
other.preExtract(slot, amount, simulate)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object FluidContainers : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(Capabilities.FluidHandler.ITEM)?.let { it.tanks > 0 } ?: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object DrainableFluidContainers : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(Capabilities.FluidHandler.ITEM)?.let { it.stream().anyMatch { it.isNotEmpty } } ?: false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return !canInsert(slot, stack)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object OnlyIn : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object OnlyOut : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object Both : HandlerFilter
|
|
||||||
|
|
||||||
object Dischargeable : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(Capabilities.EnergyStorage.ITEM)?.let { it.canExtract() && it.extractEnergy(Int.MAX_VALUE, true) > 0 } ?: false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(Capabilities.EnergyStorage.ITEM)?.let { !it.canExtract() || it.extractEnergy(Int.MAX_VALUE, true) <= 0 } ?: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object Chargeable : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(Capabilities.EnergyStorage.ITEM)?.let { it.canReceive() && it.receiveEnergy(Int.MAX_VALUE, true) > 0 } ?: false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(Capabilities.EnergyStorage.ITEM)?.let { !it.canReceive() || it.receiveEnergy(Int.MAX_VALUE, true) <= 0 } ?: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object ChemicalFuel : HandlerFilter {
|
|
||||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getBurnTime(null) <= 0
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getBurnTime(null) > 0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object IsPattern : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(MatteryCapability.PATTERN_ITEM) != null
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object MatterProviders : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(MatteryCapability.MATTER_ITEM)
|
|
||||||
?.let { it.matterFlow.output && it.extractMatterChecked(Decimal.POSITIVE_INFINITY, true) > Decimal.ZERO }
|
|
||||||
?: false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(MatteryCapability.MATTER_ITEM)
|
|
||||||
?.let { !it.matterFlow.output || it.extractMatterChecked(Decimal.POSITIVE_INFINITY, true) <= Decimal.ZERO }
|
|
||||||
?: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
object MatterConsumers : HandlerFilter {
|
|
||||||
override fun canInsert(slot: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(MatteryCapability.MATTER_ITEM)
|
|
||||||
?.let { it.matterFlow.input && it.receiveMatterChecked(Decimal.POSITIVE_INFINITY, true) > Decimal.ZERO }
|
|
||||||
?: false
|
|
||||||
}
|
|
||||||
|
|
||||||
override fun canExtract(slot: Int, amount: Int, stack: ItemStack): Boolean {
|
|
||||||
return stack.getCapability(MatteryCapability.MATTER_ITEM)
|
|
||||||
?.let { !it.matterFlow.input || it.receiveMatterChecked(Decimal.POSITIVE_INFINITY, true) <= Decimal.ZERO }
|
|
||||||
?: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user