Better package structure in capabilities
This commit is contained in:
parent
5c5c68742b
commit
16ea829514
@ -4,6 +4,7 @@ import mekanism.api.energy.IStrictEnergyHandler;
|
||||
import net.minecraftforge.common.capabilities.*;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive;
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage;
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler;
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IReplicationTaskProvider;
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IPatternStorage;
|
||||
|
@ -10,7 +10,7 @@ import ru.dbotthepony.mc.otm.block.entity.matter.MatterDecomposerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.matter.MatterRecyclerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.matter.MatterReplicatorBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.matter.MatterScannerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.defineDecimal
|
||||
import ru.dbotthepony.mc.otm.item.EnergySwordItem
|
||||
|
@ -30,7 +30,7 @@ import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.android.AndroidActiveFeature
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchManager
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.client.render.DynamicBufferSource
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
|
@ -5,25 +5,19 @@ import net.minecraft.ChatFormatting
|
||||
import net.minecraft.client.multiplayer.ClientLevel
|
||||
import net.minecraft.network.FriendlyByteBuf
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.server.level.ServerLevel
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
import net.minecraft.world.entity.Entity
|
||||
import net.minecraft.world.entity.item.ItemEntity
|
||||
import net.minecraftforge.event.ForgeEventFactory
|
||||
import net.minecraftforge.network.NetworkEvent
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchManager
|
||||
import ru.dbotthepony.mc.otm.android.AndroidSwitchableFeature
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergyInner
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
import ru.dbotthepony.mc.otm.core.TextComponent
|
||||
import ru.dbotthepony.mc.otm.core.Vector
|
||||
import ru.dbotthepony.mc.otm.core.formatPower
|
||||
import ru.dbotthepony.mc.otm.core.formatSi
|
||||
import ru.dbotthepony.mc.otm.core.getEntitiesInEllipsoid
|
||||
import ru.dbotthepony.mc.otm.core.minus
|
||||
import ru.dbotthepony.mc.otm.core.plus
|
||||
|
@ -3,7 +3,6 @@ package ru.dbotthepony.mc.otm.android.feature
|
||||
import com.mojang.blaze3d.systems.RenderSystem
|
||||
import com.mojang.blaze3d.vertex.PoseStack
|
||||
import net.minecraft.ChatFormatting
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.network.FriendlyByteBuf
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
@ -15,13 +14,12 @@ import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchManager
|
||||
import ru.dbotthepony.mc.otm.android.AndroidSwitchableFeature
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
import ru.dbotthepony.mc.otm.core.Vector
|
||||
import ru.dbotthepony.mc.otm.core.formatPower
|
||||
import ru.dbotthepony.mc.otm.core.plus
|
||||
import ru.dbotthepony.mc.otm.core.set
|
||||
import ru.dbotthepony.mc.otm.network.MatteryPacket
|
||||
import ru.dbotthepony.mc.otm.network.MatteryPlayerNetworkChannel
|
||||
import ru.dbotthepony.mc.otm.network.enqueueWork
|
||||
|
@ -8,7 +8,7 @@ import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.android.AndroidFeature
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchManager
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
import ru.dbotthepony.mc.otm.registry.AndroidFeatures
|
||||
import ru.dbotthepony.mc.otm.registry.StatNames
|
||||
|
@ -6,7 +6,7 @@ import net.minecraft.world.effect.MobEffects
|
||||
import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.android.AndroidSwitchableFeature
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
import ru.dbotthepony.mc.otm.registry.AndroidFeatures
|
||||
|
||||
|
@ -17,7 +17,7 @@ import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchManager
|
||||
import ru.dbotthepony.mc.otm.android.AndroidSwitchableFeature
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.client.render.ResearchIcons
|
||||
import ru.dbotthepony.mc.otm.core.Vector
|
||||
import ru.dbotthepony.mc.otm.core.formatPower
|
||||
|
@ -21,10 +21,9 @@ import net.minecraft.world.phys.shapes.CollisionContext
|
||||
import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.AndroidStationBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.WorkerState
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.core.orNull
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
@ -22,8 +22,8 @@ import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.ChemicalGeneratorBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.WorkerState
|
||||
import ru.dbotthepony.mc.otm.capability.GeneratorEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.ItemEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.GeneratorEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.ItemEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.core.map
|
||||
|
@ -19,7 +19,6 @@ import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.PlatePressBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.WorkerState
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
|
@ -12,7 +12,7 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import net.minecraft.world.phys.AABB
|
||||
import net.minecraftforge.common.ForgeConfigSpec
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.DecimalConfigValue
|
||||
import ru.dbotthepony.mc.otm.core.defineDecimal
|
||||
|
@ -23,6 +23,7 @@ import ru.dbotthepony.mc.otm.block.BatteryBankBlock
|
||||
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.compat.mekanism.Mattery2MekanismEnergyWrapper
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainerHooks
|
||||
|
@ -22,6 +22,7 @@ import ru.dbotthepony.mc.otm.*
|
||||
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.capability.energy.GeneratorEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainerHooks
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
|
@ -19,6 +19,7 @@ import net.minecraftforge.energy.IEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.*
|
||||
import ru.dbotthepony.mc.otm.block.EnergyCounterBlock
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.compat.mekanism.Mattery2MekanismEnergyWrapper
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.menu.EnergyCounterMenu
|
||||
|
@ -14,7 +14,7 @@ import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.capabilities.ForgeCapabilities
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.canSetBatteryMattery
|
||||
import ru.dbotthepony.mc.otm.capability.energy
|
||||
|
@ -15,6 +15,9 @@ import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.capabilities.ForgeCapabilities
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.capability.energy.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.ItemEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.ifHas
|
||||
|
@ -10,7 +10,7 @@ import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.TooltipFlag
|
||||
import net.minecraft.world.level.BlockGetter
|
||||
import net.minecraft.world.level.block.Block
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.core.map
|
||||
|
||||
|
@ -16,7 +16,7 @@ import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainerHooks
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
|
@ -22,9 +22,9 @@ import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.block.matter.MatterBottlerBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.WorkerState
|
||||
import ru.dbotthepony.mc.otm.capability.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterDirection
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterHandlerImpl
|
||||
|
@ -20,9 +20,9 @@ import net.minecraftforge.items.IItemHandler
|
||||
import ru.dbotthepony.mc.otm.ConciseBalanceValues
|
||||
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterDirection
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterHandlerImpl
|
||||
|
@ -20,9 +20,9 @@ import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.ConciseBalanceValues
|
||||
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterDirection
|
||||
import ru.dbotthepony.mc.otm.capability.matter.MatterHandlerImpl
|
||||
|
@ -19,9 +19,9 @@ import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.ConciseBalanceValues
|
||||
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.matter.*
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainerHandler
|
||||
|
@ -19,9 +19,9 @@ import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.ConciseBalanceValues
|
||||
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryWorkerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.BlockEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IPatternState
|
||||
import ru.dbotthepony.mc.otm.capability.matter.PatternState
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
|
@ -17,7 +17,7 @@ import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.menu.DriveRackMenu
|
||||
import ru.dbotthepony.mc.otm.core.map
|
||||
|
@ -1,6 +1,5 @@
|
||||
package ru.dbotthepony.mc.otm.block.entity.storage
|
||||
|
||||
import net.minecraft.MethodsReturnNonnullByDefault
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.network.chat.Component
|
||||
@ -14,20 +13,17 @@ import net.minecraft.world.level.block.state.BlockState
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.block.IDroppableContainer
|
||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.storage.DriveViewerBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.WorkerState
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.menu.DriveViewerMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.container.set
|
||||
import ru.dbotthepony.mc.otm.core.map
|
||||
import ru.dbotthepony.mc.otm.core.set
|
||||
import ru.dbotthepony.mc.otm.registry.MBlocks
|
||||
import javax.annotation.ParametersAreNonnullByDefault
|
||||
|
||||
class DriveViewerBlockEntity(p_155229_: BlockPos, p_155230_: BlockState) : MatteryPoweredBlockEntity(MBlockEntities.DRIVE_VIEWER, p_155229_, p_155230_), IDroppableContainer {
|
||||
override fun setChanged() {
|
||||
|
@ -5,7 +5,6 @@ import net.minecraft.core.BlockPos
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.core.NonNullList
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.nbt.StringTag
|
||||
import net.minecraft.network.FriendlyByteBuf
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.server.level.ServerLevel
|
||||
@ -30,13 +29,12 @@ import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.container.get
|
||||
import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode
|
||||
import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.core.ifHas
|
||||
import ru.dbotthepony.mc.otm.menu.ItemMonitorMenu
|
||||
import ru.dbotthepony.mc.otm.network.MatteryPacket
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
|
@ -24,7 +24,7 @@ import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.storage.AbstractStorageImportExport.Companion.FILTER_KEY
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.container.ItemFilter
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.graph.Graph6Node
|
||||
@ -34,7 +34,6 @@ import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph
|
||||
import ru.dbotthepony.mc.otm.menu.StorageBusMenu
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.registry.MBlocks
|
||||
import ru.dbotthepony.mc.otm.registry.MNames
|
||||
import ru.dbotthepony.mc.otm.storage.*
|
||||
import java.lang.ref.WeakReference
|
||||
import java.math.BigInteger
|
||||
|
@ -22,6 +22,9 @@ import ru.dbotthepony.mc.otm.block.CableBlock
|
||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractStepInner
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractStepInnerBi
|
||||
import ru.dbotthepony.mc.otm.container.ItemFilter
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.graph.Graph6Node
|
||||
|
@ -17,8 +17,8 @@ import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.transferInner
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.transferInner
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode
|
||||
import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph
|
||||
|
@ -17,7 +17,7 @@ import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.storage.DriveRackBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
|
@ -22,7 +22,7 @@ import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.storage.DriveViewerBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.WorkerState
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
|
@ -17,7 +17,7 @@ import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.storage.ItemMonitorBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
|
@ -23,7 +23,7 @@ import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.block.StorageCableBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.storage.StorageBusBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
import ru.dbotthepony.mc.otm.core.unaryMinus
|
||||
|
@ -24,7 +24,7 @@ import ru.dbotthepony.mc.otm.block.StorageCableBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.storage.StorageExporterBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.storage.StorageImporterBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
import ru.dbotthepony.mc.otm.core.unaryMinus
|
||||
|
@ -17,7 +17,7 @@ import net.minecraft.world.phys.shapes.VoxelShape
|
||||
import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity
|
||||
import ru.dbotthepony.mc.otm.block.entity.storage.StoragePowerSupplierBlockEntity
|
||||
import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.WorkerEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.registry.MBlockEntities
|
||||
import ru.dbotthepony.mc.otm.shapes.BlockShapes
|
||||
|
||||
|
@ -9,6 +9,7 @@ import net.minecraftforge.common.capabilities.ICapabilityProvider
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.energy.IEnergyStorage
|
||||
import net.minecraftforge.fml.ModList
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.compat.cos.cosmeticArmorAwareStream
|
||||
import ru.dbotthepony.mc.otm.compat.cos.cosmeticArmorStream
|
||||
import ru.dbotthepony.mc.otm.compat.cos.isCosmeticArmorLoaded
|
||||
|
@ -1,4 +1,4 @@
|
||||
package ru.dbotthepony.mc.otm.capability
|
||||
package ru.dbotthepony.mc.otm.capability.android
|
||||
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
@ -6,6 +6,9 @@ import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraftforge.common.capabilities.ForgeCapabilities
|
||||
import net.minecraftforge.common.util.INBTSerializable
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergy
|
||||
import ru.dbotthepony.mc.otm.capability.receiveEnergy
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.getDecimal
|
||||
import ru.dbotthepony.mc.otm.core.getItemStack
|
@ -1,4 +1,4 @@
|
||||
package ru.dbotthepony.mc.otm.capability
|
||||
package ru.dbotthepony.mc.otm.capability.android
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.Reference2ObjectOpenHashMap
|
||||
import net.minecraft.ChatFormatting
|
||||
@ -44,6 +44,9 @@ import ru.dbotthepony.mc.otm.android.AndroidResearch
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchManager
|
||||
import ru.dbotthepony.mc.otm.android.AndroidResearchType
|
||||
import ru.dbotthepony.mc.otm.android.AndroidSwitchableFeature
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.UUIDIntModifiersMap
|
||||
import ru.dbotthepony.mc.otm.capability.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.container.MatteryContainer
|
||||
import ru.dbotthepony.mc.otm.container.stream
|
@ -1,258 +1,27 @@
|
||||
|
||||
@file:Suppress("unused")
|
||||
|
||||
package ru.dbotthepony.mc.otm.capability
|
||||
package ru.dbotthepony.mc.otm.capability.energy
|
||||
|
||||
import net.minecraft.ChatFormatting
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.world.item.BlockItem
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.TooltipFlag
|
||||
import net.minecraft.world.level.BlockGetter
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.block.entity.BlockEntity
|
||||
import net.minecraftforge.common.ForgeConfigSpec
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.capabilities.ForgeCapabilities
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider
|
||||
import net.minecraftforge.common.util.INBTSerializable
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.energy.IEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.ConciseBalanceValues
|
||||
import ru.dbotthepony.mc.otm.VerboseBalanceValues
|
||||
import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity
|
||||
import ru.dbotthepony.mc.otm.compat.mekanism.Mattery2MekanismEnergyWrapper
|
||||
import ru.dbotthepony.mc.otm.capability.FlowDirection
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.core.defineDecimal
|
||||
import ru.dbotthepony.mc.otm.core.formatPower
|
||||
import ru.dbotthepony.mc.otm.core.map
|
||||
import ru.dbotthepony.mc.otm.core.mapIf
|
||||
import ru.dbotthepony.mc.otm.core.set
|
||||
import ru.dbotthepony.mc.otm.core.tagNotNull
|
||||
|
||||
sealed interface IEnergyStorageImpl {
|
||||
val maxInput: Decimal?
|
||||
val maxOutput: Decimal?
|
||||
val direction: FlowDirection
|
||||
}
|
||||
|
||||
private fun batteryLevel(it: IEnergyStorage, tooltips: MutableList<Component>) {
|
||||
tooltips.add(TranslatableComponent(
|
||||
"otm.item.power.storage",
|
||||
it.energyStored.formatPower(),
|
||||
it.maxEnergyStored.formatPower()
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
}
|
||||
|
||||
private fun batteryLevel(it: IMatteryEnergyStorage, tooltips: MutableList<Component>) {
|
||||
tooltips.add(TranslatableComponent(
|
||||
"otm.item.power.storage",
|
||||
it.batteryLevel.formatPower(),
|
||||
it.maxBatteryLevel.formatPower()
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
|
||||
if (it is IEnergyStorageImpl) {
|
||||
when (it.direction) {
|
||||
FlowDirection.INPUT -> {
|
||||
if (it.maxInput != null) {
|
||||
tooltips.add(TranslatableComponent("otm.item.power.throughput_mono", it.maxInput!!.formatPower()).withStyle(ChatFormatting.GRAY))
|
||||
} else {
|
||||
tooltips.add(TranslatableComponent("otm.item.power.throughput_mono", TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY)).withStyle(ChatFormatting.GRAY))
|
||||
}
|
||||
}
|
||||
|
||||
FlowDirection.OUTPUT -> {
|
||||
if (it.maxOutput != null) {
|
||||
tooltips.add(TranslatableComponent("otm.item.power.throughput_mono", it.maxOutput!!.formatPower()).withStyle(ChatFormatting.GRAY))
|
||||
} else {
|
||||
tooltips.add(TranslatableComponent("otm.item.power.throughput_mono", TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY)).withStyle(ChatFormatting.GRAY))
|
||||
}
|
||||
}
|
||||
|
||||
FlowDirection.BI_DIRECTIONAL -> {
|
||||
val maxInput = it.maxInput
|
||||
val maxOutput = it.maxOutput
|
||||
|
||||
if (maxInput != null && maxOutput != null) {
|
||||
tooltips.add(TranslatableComponent("otm.item.power.throughput", maxInput.formatPower(), maxOutput.formatPower()).withStyle(ChatFormatting.GRAY))
|
||||
} else if (maxInput != null) {
|
||||
tooltips.add(TranslatableComponent("otm.item.power.throughput",
|
||||
maxInput.formatPower(),
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY)
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
} else if (maxOutput != null) {
|
||||
tooltips.add(TranslatableComponent("otm.item.power.throughput",
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY),
|
||||
maxOutput.formatPower(),
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
} else {
|
||||
tooltips.add(TranslatableComponent("otm.item.power.throughput",
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY),
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY),
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sealed class ItemEnergyStorageImpl(
|
||||
final override val direction: FlowDirection,
|
||||
protected val itemStack: ItemStack,
|
||||
maxBatteryLevel: Decimal,
|
||||
maxInput: Decimal?,
|
||||
maxOutput: Decimal?,
|
||||
val initialBatteryLevel: Decimal = Decimal.ZERO
|
||||
) : IMatteryEnergyStorage, ICapabilityProvider, IEnergyStorageImpl {
|
||||
final override var maxInput: Decimal? = maxInput
|
||||
protected set
|
||||
|
||||
final override var maxOutput: Decimal? = maxOutput
|
||||
protected set
|
||||
|
||||
private val resolver = LazyOptional.of { this }
|
||||
private val resolverMekanism = if (isMekanismLoaded) LazyOptional.of { Mattery2MekanismEnergyWrapper(this) } else null
|
||||
|
||||
override fun <T : Any> getCapability(cap: Capability<T>, side: Direction?): LazyOptional<T> {
|
||||
if (cap == ForgeCapabilities.ENERGY || cap == MatteryCapability.ENERGY) {
|
||||
return resolver.cast()
|
||||
} else if (cap == MatteryCapability.MEKANISM_ENERGY) {
|
||||
return resolverMekanism?.cast() ?: LazyOptional.empty()
|
||||
}
|
||||
|
||||
return LazyOptional.empty()
|
||||
}
|
||||
|
||||
override var maxBatteryLevel: Decimal = maxBatteryLevel
|
||||
protected set
|
||||
|
||||
override var batteryLevel: Decimal
|
||||
get() = itemStack.tag?.map(ENERGY_KEY, Decimal::deserializeNBT) ?: initialBatteryLevel
|
||||
set(value) {
|
||||
itemStack.tagNotNull[ENERGY_KEY] = value.serializeNBT()
|
||||
}
|
||||
|
||||
override fun extractEnergyOuter(howMuch: Decimal, simulate: Boolean): Decimal {
|
||||
if (direction == FlowDirection.INPUT)
|
||||
return Decimal.ZERO
|
||||
|
||||
return extractEnergyInner(howMuch, simulate)
|
||||
}
|
||||
|
||||
override fun receiveEnergyOuter(howMuch: Decimal, simulate: Boolean): Decimal {
|
||||
if (direction == FlowDirection.OUTPUT)
|
||||
return Decimal.ZERO
|
||||
|
||||
return receiveEnergyInner(howMuch, simulate)
|
||||
}
|
||||
|
||||
override fun extractEnergyInner(howMuch: Decimal, simulate: Boolean): Decimal {
|
||||
if (!howMuch.isPositive || itemStack.count != 1)
|
||||
return Decimal.ZERO
|
||||
|
||||
@Suppress("NAME_SHADOWING")
|
||||
var howMuch = howMuch
|
||||
val maxOutput = maxOutput
|
||||
|
||||
if (maxOutput != null) {
|
||||
howMuch = howMuch.coerceAtMost(maxOutput)
|
||||
}
|
||||
|
||||
val batteryLevel = batteryLevel
|
||||
|
||||
if (!batteryLevel.isPositive)
|
||||
return Decimal.ZERO
|
||||
|
||||
val newLevel = (batteryLevel - howMuch).moreThanZero()
|
||||
val diff = (batteryLevel - newLevel)
|
||||
|
||||
if (!simulate && batteryLevel != newLevel) {
|
||||
this.batteryLevel = newLevel
|
||||
}
|
||||
|
||||
return diff
|
||||
}
|
||||
|
||||
override fun receiveEnergyInner(howMuch: Decimal, simulate: Boolean): Decimal {
|
||||
if (!howMuch.isPositive || itemStack.count != 1)
|
||||
return Decimal.ZERO
|
||||
|
||||
@Suppress("NAME_SHADOWING")
|
||||
var howMuch = howMuch
|
||||
val maxInput = maxInput
|
||||
|
||||
if (maxInput != null) {
|
||||
howMuch = howMuch.coerceAtMost(maxInput)
|
||||
}
|
||||
|
||||
val batteryLevel = batteryLevel
|
||||
|
||||
if (batteryLevel >= maxBatteryLevel)
|
||||
return Decimal.ZERO
|
||||
|
||||
val newLevel = (batteryLevel + howMuch).coerceAtMost(maxBatteryLevel)
|
||||
val diff = (newLevel - batteryLevel)
|
||||
|
||||
if (!simulate && batteryLevel != newLevel) {
|
||||
this.batteryLevel = newLevel
|
||||
}
|
||||
|
||||
return diff
|
||||
}
|
||||
|
||||
override fun canExtract(): Boolean {
|
||||
return direction != FlowDirection.INPUT
|
||||
}
|
||||
|
||||
override fun canReceive(): Boolean {
|
||||
return direction != FlowDirection.OUTPUT
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val ENERGY_KEY = "energy"
|
||||
|
||||
fun appendHoverText(itemStack: ItemStack, level: Level?, tooltips: MutableList<Component>, flag: TooltipFlag) {
|
||||
appendHoverText(itemStack, tooltips)
|
||||
}
|
||||
|
||||
fun appendHoverText(itemStack: ItemStack, tooltips: MutableList<Component>) {
|
||||
val energy = itemStack.energy ?: return
|
||||
|
||||
if (energy is IMatteryEnergyStorage) {
|
||||
batteryLevel(energy, tooltips)
|
||||
} else {
|
||||
batteryLevel(energy, tooltips)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open class EnergyConsumerItem(
|
||||
stack: ItemStack,
|
||||
maxBatteryLevel: Decimal,
|
||||
maxInput: Decimal? = null,
|
||||
maxOutput: Decimal? = maxInput,
|
||||
initialBatteryLevel: Decimal = Decimal.ZERO
|
||||
) : ItemEnergyStorageImpl(FlowDirection.INPUT, stack, maxBatteryLevel, maxInput, maxOutput, initialBatteryLevel)
|
||||
|
||||
open class EnergyProducerItem(
|
||||
stack: ItemStack,
|
||||
maxBatteryLevel: Decimal,
|
||||
maxInput: Decimal? = null,
|
||||
maxOutput: Decimal? = maxInput,
|
||||
initialBatteryLevel: Decimal = Decimal.ZERO
|
||||
) : ItemEnergyStorageImpl(FlowDirection.OUTPUT, stack, maxBatteryLevel, maxInput, maxOutput, initialBatteryLevel)
|
||||
|
||||
open class EnergyCapacitorItem(
|
||||
stack: ItemStack,
|
||||
maxBatteryLevel: Decimal,
|
||||
maxInput: Decimal? = null,
|
||||
maxOutput: Decimal? = maxInput,
|
||||
initialBatteryLevel: Decimal = Decimal.ZERO
|
||||
) : ItemEnergyStorageImpl(FlowDirection.BI_DIRECTIONAL, stack, maxBatteryLevel, maxInput, maxOutput, initialBatteryLevel)
|
||||
|
||||
sealed class BlockEnergyStorageImpl(
|
||||
protected val listener: () -> Unit,
|
@ -0,0 +1,102 @@
|
||||
package ru.dbotthepony.mc.otm.capability.energy
|
||||
|
||||
import net.minecraft.ChatFormatting
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraftforge.energy.IEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.FlowDirection
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.TranslatableComponent
|
||||
import ru.dbotthepony.mc.otm.core.formatPower
|
||||
|
||||
sealed interface IEnergyStorageImpl {
|
||||
val maxInput: Decimal?
|
||||
val maxOutput: Decimal?
|
||||
val direction: FlowDirection
|
||||
}
|
||||
|
||||
internal fun batteryLevel(it: IEnergyStorage, tooltips: MutableList<Component>) {
|
||||
tooltips.add(
|
||||
TranslatableComponent(
|
||||
"otm.item.power.storage",
|
||||
it.energyStored.formatPower(),
|
||||
it.maxEnergyStored.formatPower()
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
}
|
||||
|
||||
internal fun batteryLevel(it: IMatteryEnergyStorage, tooltips: MutableList<Component>) {
|
||||
tooltips.add(
|
||||
TranslatableComponent(
|
||||
"otm.item.power.storage",
|
||||
it.batteryLevel.formatPower(),
|
||||
it.maxBatteryLevel.formatPower()
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
|
||||
if (it is IEnergyStorageImpl) {
|
||||
when (it.direction) {
|
||||
FlowDirection.INPUT -> {
|
||||
if (it.maxInput != null) {
|
||||
tooltips.add(
|
||||
TranslatableComponent("otm.item.power.throughput_mono", it.maxInput!!.formatPower()).withStyle(
|
||||
ChatFormatting.GRAY
|
||||
))
|
||||
} else {
|
||||
tooltips.add(
|
||||
TranslatableComponent(
|
||||
"otm.item.power.throughput_mono",
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY)
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
}
|
||||
}
|
||||
|
||||
FlowDirection.OUTPUT -> {
|
||||
if (it.maxOutput != null) {
|
||||
tooltips.add(
|
||||
TranslatableComponent("otm.item.power.throughput_mono", it.maxOutput!!.formatPower()).withStyle(
|
||||
ChatFormatting.GRAY
|
||||
))
|
||||
} else {
|
||||
tooltips.add(
|
||||
TranslatableComponent(
|
||||
"otm.item.power.throughput_mono",
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY)
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
}
|
||||
}
|
||||
|
||||
FlowDirection.BI_DIRECTIONAL -> {
|
||||
val maxInput = it.maxInput
|
||||
val maxOutput = it.maxOutput
|
||||
|
||||
if (maxInput != null && maxOutput != null) {
|
||||
tooltips.add(
|
||||
TranslatableComponent(
|
||||
"otm.item.power.throughput",
|
||||
maxInput.formatPower(),
|
||||
maxOutput.formatPower()
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
} else if (maxInput != null) {
|
||||
tooltips.add(
|
||||
TranslatableComponent(
|
||||
"otm.item.power.throughput",
|
||||
maxInput.formatPower(),
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY)
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
} else if (maxOutput != null) {
|
||||
tooltips.add(
|
||||
TranslatableComponent(
|
||||
"otm.item.power.throughput",
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY),
|
||||
maxOutput.formatPower(),
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
} else {
|
||||
tooltips.add(
|
||||
TranslatableComponent(
|
||||
"otm.item.power.throughput",
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY),
|
||||
TranslatableComponent("otm.item.power.infinity").withStyle(ChatFormatting.GRAY),
|
||||
).withStyle(ChatFormatting.GRAY))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package ru.dbotthepony.mc.otm.capability
|
||||
package ru.dbotthepony.mc.otm.capability.energy
|
||||
|
||||
import net.minecraftforge.energy.IEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
@ -0,0 +1,175 @@
|
||||
package ru.dbotthepony.mc.otm.capability.energy
|
||||
|
||||
import net.minecraft.core.Direction
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.TooltipFlag
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraftforge.common.capabilities.Capability
|
||||
import net.minecraftforge.common.capabilities.ForgeCapabilities
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.capability.FlowDirection
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.energy
|
||||
import ru.dbotthepony.mc.otm.capability.isMekanismLoaded
|
||||
import ru.dbotthepony.mc.otm.compat.mekanism.Mattery2MekanismEnergyWrapper
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
import ru.dbotthepony.mc.otm.core.map
|
||||
import ru.dbotthepony.mc.otm.core.set
|
||||
import ru.dbotthepony.mc.otm.core.tagNotNull
|
||||
|
||||
sealed class ItemEnergyStorageImpl(
|
||||
final override val direction: FlowDirection,
|
||||
protected val itemStack: ItemStack,
|
||||
maxBatteryLevel: Decimal,
|
||||
maxInput: Decimal?,
|
||||
maxOutput: Decimal?,
|
||||
val initialBatteryLevel: Decimal = Decimal.ZERO
|
||||
) : IMatteryEnergyStorage, ICapabilityProvider, IEnergyStorageImpl {
|
||||
final override var maxInput: Decimal? = maxInput
|
||||
protected set
|
||||
|
||||
final override var maxOutput: Decimal? = maxOutput
|
||||
protected set
|
||||
|
||||
private val resolver = LazyOptional.of { this }
|
||||
private val resolverMekanism = if (isMekanismLoaded) LazyOptional.of { Mattery2MekanismEnergyWrapper(this) } else null
|
||||
|
||||
override fun <T : Any> getCapability(cap: Capability<T>, side: Direction?): LazyOptional<T> {
|
||||
if (cap == ForgeCapabilities.ENERGY || cap == MatteryCapability.ENERGY) {
|
||||
return resolver.cast()
|
||||
} else if (cap == MatteryCapability.MEKANISM_ENERGY) {
|
||||
return resolverMekanism?.cast() ?: LazyOptional.empty()
|
||||
}
|
||||
|
||||
return LazyOptional.empty()
|
||||
}
|
||||
|
||||
override var maxBatteryLevel: Decimal = maxBatteryLevel
|
||||
protected set
|
||||
|
||||
override var batteryLevel: Decimal
|
||||
get() = itemStack.tag?.map(ENERGY_KEY, Decimal.Companion::deserializeNBT) ?: initialBatteryLevel
|
||||
set(value) {
|
||||
itemStack.tagNotNull[ENERGY_KEY] = value.serializeNBT()
|
||||
}
|
||||
|
||||
override fun extractEnergyOuter(howMuch: Decimal, simulate: Boolean): Decimal {
|
||||
if (direction == FlowDirection.INPUT)
|
||||
return Decimal.ZERO
|
||||
|
||||
return extractEnergyInner(howMuch, simulate)
|
||||
}
|
||||
|
||||
override fun receiveEnergyOuter(howMuch: Decimal, simulate: Boolean): Decimal {
|
||||
if (direction == FlowDirection.OUTPUT)
|
||||
return Decimal.ZERO
|
||||
|
||||
return receiveEnergyInner(howMuch, simulate)
|
||||
}
|
||||
|
||||
override fun extractEnergyInner(howMuch: Decimal, simulate: Boolean): Decimal {
|
||||
if (!howMuch.isPositive || itemStack.count != 1)
|
||||
return Decimal.ZERO
|
||||
|
||||
@Suppress("NAME_SHADOWING")
|
||||
var howMuch = howMuch
|
||||
val maxOutput = maxOutput
|
||||
|
||||
if (maxOutput != null) {
|
||||
howMuch = howMuch.coerceAtMost(maxOutput)
|
||||
}
|
||||
|
||||
val batteryLevel = batteryLevel
|
||||
|
||||
if (!batteryLevel.isPositive)
|
||||
return Decimal.ZERO
|
||||
|
||||
val newLevel = (batteryLevel - howMuch).moreThanZero()
|
||||
val diff = (batteryLevel - newLevel)
|
||||
|
||||
if (!simulate && batteryLevel != newLevel) {
|
||||
this.batteryLevel = newLevel
|
||||
}
|
||||
|
||||
return diff
|
||||
}
|
||||
|
||||
override fun receiveEnergyInner(howMuch: Decimal, simulate: Boolean): Decimal {
|
||||
if (!howMuch.isPositive || itemStack.count != 1)
|
||||
return Decimal.ZERO
|
||||
|
||||
@Suppress("NAME_SHADOWING")
|
||||
var howMuch = howMuch
|
||||
val maxInput = maxInput
|
||||
|
||||
if (maxInput != null) {
|
||||
howMuch = howMuch.coerceAtMost(maxInput)
|
||||
}
|
||||
|
||||
val batteryLevel = batteryLevel
|
||||
|
||||
if (batteryLevel >= maxBatteryLevel)
|
||||
return Decimal.ZERO
|
||||
|
||||
val newLevel = (batteryLevel + howMuch).coerceAtMost(maxBatteryLevel)
|
||||
val diff = (newLevel - batteryLevel)
|
||||
|
||||
if (!simulate && batteryLevel != newLevel) {
|
||||
this.batteryLevel = newLevel
|
||||
}
|
||||
|
||||
return diff
|
||||
}
|
||||
|
||||
override fun canExtract(): Boolean {
|
||||
return direction != FlowDirection.INPUT
|
||||
}
|
||||
|
||||
override fun canReceive(): Boolean {
|
||||
return direction != FlowDirection.OUTPUT
|
||||
}
|
||||
|
||||
companion object {
|
||||
const val ENERGY_KEY = "energy"
|
||||
|
||||
fun appendHoverText(itemStack: ItemStack, level: Level?, tooltips: MutableList<Component>, flag: TooltipFlag) {
|
||||
appendHoverText(itemStack, tooltips)
|
||||
}
|
||||
|
||||
fun appendHoverText(itemStack: ItemStack, tooltips: MutableList<Component>) {
|
||||
val energy = itemStack.energy ?: return
|
||||
|
||||
if (energy is IMatteryEnergyStorage) {
|
||||
batteryLevel(energy, tooltips)
|
||||
} else {
|
||||
batteryLevel(energy, tooltips)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
open class EnergyConsumerItem(
|
||||
stack: ItemStack,
|
||||
maxBatteryLevel: Decimal,
|
||||
maxInput: Decimal? = null,
|
||||
maxOutput: Decimal? = maxInput,
|
||||
initialBatteryLevel: Decimal = Decimal.ZERO
|
||||
) : ItemEnergyStorageImpl(FlowDirection.INPUT, stack, maxBatteryLevel, maxInput, maxOutput, initialBatteryLevel)
|
||||
|
||||
open class EnergyProducerItem(
|
||||
stack: ItemStack,
|
||||
maxBatteryLevel: Decimal,
|
||||
maxInput: Decimal? = null,
|
||||
maxOutput: Decimal? = maxInput,
|
||||
initialBatteryLevel: Decimal = Decimal.ZERO
|
||||
) : ItemEnergyStorageImpl(FlowDirection.OUTPUT, stack, maxBatteryLevel, maxInput, maxOutput, initialBatteryLevel)
|
||||
|
||||
open class EnergyCapacitorItem(
|
||||
stack: ItemStack,
|
||||
maxBatteryLevel: Decimal,
|
||||
maxInput: Decimal? = null,
|
||||
maxOutput: Decimal? = maxInput,
|
||||
initialBatteryLevel: Decimal = Decimal.ZERO
|
||||
) : ItemEnergyStorageImpl(FlowDirection.BI_DIRECTIONAL, stack, maxBatteryLevel, maxInput, maxOutput, initialBatteryLevel)
|
@ -10,7 +10,7 @@ import net.minecraftforge.common.capabilities.ICapabilityProvider
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import net.minecraftforge.energy.IEnergyStorage
|
||||
import org.apache.logging.log4j.LogManager
|
||||
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.isMekanismLoaded
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
@ -70,7 +70,8 @@ private val mtj2Mekanism by DoubleLazy lazy@{
|
||||
return@lazy lazyOf(Decimal.ONE)
|
||||
}
|
||||
|
||||
class Mekanism2MatteryEnergyWrapper(private val power: IStrictEnergyHandler, private val forgePower: IEnergyStorage? = null) : IMatteryEnergyStorage {
|
||||
class Mekanism2MatteryEnergyWrapper(private val power: IStrictEnergyHandler, private val forgePower: IEnergyStorage? = null) :
|
||||
IMatteryEnergyStorage {
|
||||
override fun extractEnergyOuter(howMuch: Decimal, simulate: Boolean): Decimal {
|
||||
val action = when (simulate) {
|
||||
true -> Action.SIMULATE
|
||||
|
@ -1,12 +1,10 @@
|
||||
package ru.dbotthepony.mc.otm.graph.storage
|
||||
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArraySet
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.graph.Graph6Node
|
||||
import ru.dbotthepony.mc.otm.storage.IStorage
|
||||
import ru.dbotthepony.mc.otm.storage.IStorageEventConsumer
|
||||
import ru.dbotthepony.mc.otm.storage.IStorageStack
|
||||
import ru.dbotthepony.mc.otm.storage.StorageStackType
|
||||
import java.util.*
|
||||
|
@ -6,7 +6,7 @@ import net.minecraft.server.level.ServerLevel
|
||||
import net.minecraft.world.level.Level
|
||||
import net.minecraft.world.level.block.entity.BlockEntity
|
||||
import ru.dbotthepony.mc.otm.addTickerPre
|
||||
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.graph.Abstract6Graph
|
||||
import ru.dbotthepony.mc.otm.graph.Graph6Node
|
||||
|
@ -1,7 +1,6 @@
|
||||
package ru.dbotthepony.mc.otm.item
|
||||
|
||||
import net.minecraft.ChatFormatting
|
||||
import net.minecraft.core.NonNullList
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.server.level.ServerPlayer
|
||||
@ -16,9 +15,12 @@ import net.minecraft.world.level.Level
|
||||
import net.minecraftforge.common.capabilities.ForgeCapabilities
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider
|
||||
import ru.dbotthepony.mc.otm.BatteryBalanceValues
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.capability.energy.EnergyCapacitorItem
|
||||
import ru.dbotthepony.mc.otm.capability.energy.ItemEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarColor
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarWidth
|
||||
import ru.dbotthepony.mc.otm.client.minecraft
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.registry.MRegistry
|
||||
|
@ -4,7 +4,6 @@ import com.google.common.collect.ImmutableMultimap
|
||||
import com.google.common.collect.Multimap
|
||||
import net.minecraft.ChatFormatting
|
||||
import net.minecraft.core.BlockPos
|
||||
import net.minecraft.core.NonNullList
|
||||
import net.minecraft.nbt.CompoundTag
|
||||
import net.minecraft.network.chat.Component
|
||||
import net.minecraft.world.entity.EquipmentSlot
|
||||
@ -13,7 +12,6 @@ import net.minecraft.world.entity.ai.attributes.Attribute
|
||||
import net.minecraft.world.entity.ai.attributes.AttributeModifier
|
||||
import net.minecraft.world.entity.ai.attributes.Attributes
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.CreativeModeTab
|
||||
import net.minecraft.world.item.Item
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.Rarity
|
||||
@ -29,13 +27,12 @@ import net.minecraftforge.common.ForgeConfigSpec
|
||||
import net.minecraftforge.common.ToolAction
|
||||
import net.minecraftforge.common.ToolActions
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.capability.EnergyConsumerItem
|
||||
import ru.dbotthepony.mc.otm.capability.ItemEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.EnergyConsumerItem
|
||||
import ru.dbotthepony.mc.otm.capability.energy.ItemEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.MatteryCapability
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.getBarColor
|
||||
import ru.dbotthepony.mc.otm.capability.getBarWidth
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarColor
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarWidth
|
||||
import ru.dbotthepony.mc.otm.capability.matteryEnergy
|
||||
import ru.dbotthepony.mc.otm.capability.matteryPlayer
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
|
@ -1,9 +1,7 @@
|
||||
package ru.dbotthepony.mc.otm.item
|
||||
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectFunction
|
||||
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
|
||||
import it.unimi.dsi.fastutil.ints.IntAVLTreeSet
|
||||
import it.unimi.dsi.fastutil.ints.IntOpenHashSet
|
||||
import net.minecraft.ChatFormatting
|
||||
import net.minecraft.core.Direction
|
||||
@ -26,6 +24,9 @@ import net.minecraftforge.registries.ForgeRegistries
|
||||
import net.minecraftforge.registries.ForgeRegistry
|
||||
import ru.dbotthepony.mc.otm.*
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarColor
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarWidth
|
||||
import ru.dbotthepony.mc.otm.compat.mekanism.Mattery2MekanismEnergyWrapper
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.network.GenericNetworkChannel
|
||||
|
@ -13,6 +13,10 @@ import ru.dbotthepony.mc.otm.ConciseBalanceValues
|
||||
import ru.dbotthepony.mc.otm.OverdriveThatMatters
|
||||
import ru.dbotthepony.mc.otm.ServerConfig
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.capability.energy.EnergyProducerItem
|
||||
import ru.dbotthepony.mc.otm.capability.energy.ItemEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarColor
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarWidth
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
|
||||
open class SingleUseBatteryItem(
|
||||
|
@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.item.weapon
|
||||
import net.minecraft.sounds.SoundSource
|
||||
import net.minecraft.world.entity.player.Player
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import ru.dbotthepony.mc.otm.capability.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.capability.energy.extractEnergyInnerExact
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.core.Vector
|
||||
import ru.dbotthepony.mc.otm.entity.PlasmaProjectile
|
||||
|
@ -17,6 +17,9 @@ import net.minecraftforge.common.util.INBTSerializable
|
||||
import net.minecraftforge.common.util.LazyOptional
|
||||
import ru.dbotthepony.mc.otm.*
|
||||
import ru.dbotthepony.mc.otm.capability.*
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarColor
|
||||
import ru.dbotthepony.mc.otm.capability.energy.getBarWidth
|
||||
import ru.dbotthepony.mc.otm.core.*
|
||||
import ru.dbotthepony.mc.otm.registry.MSoundEvents
|
||||
import kotlin.reflect.KClass
|
||||
|
@ -1,6 +1,6 @@
|
||||
package ru.dbotthepony.mc.otm.menu.widget
|
||||
|
||||
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler
|
||||
import ru.dbotthepony.mc.otm.capability.matter.IPatternStorage
|
||||
import ru.dbotthepony.mc.otm.core.Decimal
|
||||
|
@ -6,20 +6,15 @@ import net.minecraft.network.FriendlyByteBuf
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.world.inventory.CraftingContainer
|
||||
import net.minecraft.world.item.ItemStack
|
||||
import net.minecraft.world.item.crafting.CookingBookCategory
|
||||
import net.minecraft.world.item.crafting.CraftingBookCategory
|
||||
import net.minecraft.world.item.crafting.CraftingRecipe
|
||||
import net.minecraft.world.item.crafting.Ingredient
|
||||
import net.minecraft.world.item.crafting.RecipeSerializer
|
||||
import net.minecraft.world.item.crafting.ShapedRecipe
|
||||
import net.minecraft.world.level.Level
|
||||
import ru.dbotthepony.mc.otm.capability.ItemEnergyStorageImpl
|
||||
import ru.dbotthepony.mc.otm.capability.matteryEnergy
|
||||
import ru.dbotthepony.mc.otm.container.iterator
|
||||
import ru.dbotthepony.mc.otm.container.stream
|
||||
import ru.dbotthepony.mc.otm.core.filterNotNull
|
||||
import ru.dbotthepony.mc.otm.core.set
|
||||
import ru.dbotthepony.mc.otm.core.tagNotNull
|
||||
|
||||
class EnergyContainerRecipe(
|
||||
p_44153_: ResourceLocation,
|
||||
|
@ -1,8 +1,7 @@
|
||||
package ru.dbotthepony.mc.otm.storage
|
||||
|
||||
import it.unimi.dsi.fastutil.longs.Long2ObjectAVLTreeMap
|
||||
import it.unimi.dsi.fastutil.objects.ObjectArraySet
|
||||
import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.capability.energy.IMatteryEnergyStorage
|
||||
import ru.dbotthepony.mc.otm.core.isPositive
|
||||
import ru.dbotthepony.mc.otm.core.isZero
|
||||
import java.math.BigInteger
|
||||
|
Loading…
Reference in New Issue
Block a user