From c24c8a9a80fa789401865ab37ba40160e83bc32a Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Wed, 8 Jun 2022 15:43:45 +0700 Subject: [PATCH] Move block classes to subpackages --- .../ru/dbotthepony/mc/otm/datagen/DataGen.kt | 4 +++- .../block/entity/PatternStorageBlockEntity.kt | 2 +- .../{ => matter}/MatterBottlerBlockEntity.kt | 5 +++-- .../MatterCapacitorBankBlockEntity.kt | 3 ++- .../MatterDecomposerBlockEntity.kt | 2 +- .../{ => matter}/MatterPanelBlockEntity.kt | 3 ++- .../{ => matter}/MatterRecyclerBlockEntity.kt | 2 +- .../MatterReplicatorBlockEntity.kt | 2 +- .../{ => matter}/MatterScannerBlockEntity.kt | 2 +- .../{ => storage}/DriveRackBlockEntity.kt | 3 ++- .../{ => storage}/DriveViewerBlockEntity.kt | 5 +++-- .../{ => storage}/ItemMonitorBlockEntity.kt | 3 ++- .../{ => storage}/StorageBusBlockEntity.kt | 4 ++-- .../entity/{ => storage}/StorageInterfaces.kt | 11 +++++----- .../StoragePowerSupplierBlockEntity.kt | 3 ++- .../block/{ => matter}/MatterBottlerBlock.kt | 5 +++-- .../{ => matter}/MatterCapacitorBankBlock.kt | 6 ++++-- .../{ => matter}/MatterDecomposerBlock.kt | 5 +++-- .../block/{ => matter}/MatterPanelBlock.kt | 5 +++-- .../block/{ => matter}/MatterRecyclerBlock.kt | 5 +++-- .../{ => matter}/MatterReplicatorBlock.kt | 5 +++-- .../block/{ => matter}/MatterScannerBlock.kt | 5 +++-- .../block/{ => matter}/PatternStorageBlock.kt | 3 ++- .../otm/block/{ => storage}/DriveRackBlock.kt | 5 +++-- .../block/{ => storage}/DriveViewerBlock.kt | 5 +++-- .../block/{ => storage}/ItemMonitorBlock.kt | 5 +++-- .../block/{ => storage}/StorageBusBlock.kt | 21 ++++++++++++------- .../block/{ => storage}/StorageInterfaces.kt | 21 ++++++++++++------- .../StoragePowerSupplierBlock.kt | 5 +++-- .../dbotthepony/mc/otm/menu/DriveRackMenu.kt | 2 +- .../mc/otm/menu/DriveViewerMenu.kt | 2 +- .../mc/otm/menu/ItemMonitorMenu.kt | 2 +- .../mc/otm/menu/MatterBottlerMenu.kt | 2 +- .../mc/otm/menu/MatterCapacitorBankMenu.kt | 3 +-- .../mc/otm/menu/MatterDecomposerMenu.kt | 2 +- .../mc/otm/menu/MatterPanelMenu.kt | 2 +- .../mc/otm/menu/MatterRecyclerMenu.kt | 2 +- .../mc/otm/menu/MatterReplicatorMenu.kt | 2 +- .../mc/otm/menu/MatterScannerMenu.kt | 2 +- .../dbotthepony/mc/otm/menu/StorageBusMenu.kt | 2 +- .../mc/otm/menu/StorageExporterMenu.kt | 3 +-- .../mc/otm/menu/StorageImporterMenu.kt | 4 +--- .../mc/otm/menu/StoragePowerSupplierMenu.kt | 4 +--- .../mc/otm/registry/MBlockEntities.kt | 2 ++ .../ru/dbotthepony/mc/otm/registry/MBlocks.kt | 2 ++ .../ru/dbotthepony/mc/otm/storage/API.kt | 3 ++- 46 files changed, 114 insertions(+), 82 deletions(-) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => matter}/MatterBottlerBlockEntity.kt (98%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => matter}/MatterCapacitorBankBlockEntity.kt (98%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => matter}/MatterDecomposerBlockEntity.kt (99%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => matter}/MatterPanelBlockEntity.kt (98%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => matter}/MatterRecyclerBlockEntity.kt (99%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => matter}/MatterReplicatorBlockEntity.kt (99%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => matter}/MatterScannerBlockEntity.kt (99%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => storage}/DriveRackBlockEntity.kt (96%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => storage}/DriveViewerBlockEntity.kt (94%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => storage}/ItemMonitorBlockEntity.kt (94%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => storage}/StorageBusBlockEntity.kt (99%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => storage}/StorageInterfaces.kt (97%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/{ => storage}/StoragePowerSupplierBlockEntity.kt (97%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => matter}/MatterBottlerBlock.kt (94%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => matter}/MatterCapacitorBankBlock.kt (88%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => matter}/MatterDecomposerBlock.kt (92%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => matter}/MatterPanelBlock.kt (93%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => matter}/MatterRecyclerBlock.kt (92%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => matter}/MatterReplicatorBlock.kt (92%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => matter}/MatterScannerBlock.kt (92%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => matter}/PatternStorageBlock.kt (96%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => storage}/DriveRackBlock.kt (91%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => storage}/DriveViewerBlock.kt (93%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => storage}/ItemMonitorBlock.kt (91%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => storage}/StorageBusBlock.kt (87%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => storage}/StorageInterfaces.kt (92%) rename src/main/kotlin/ru/dbotthepony/mc/otm/block/{ => storage}/StoragePowerSupplierBlock.kt (91%) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt index 8f9da3198..4db9cab52 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/DataGen.kt @@ -4,7 +4,6 @@ import net.minecraft.core.Direction import net.minecraft.data.recipes.ShapedRecipeBuilder import net.minecraft.data.recipes.ShapelessRecipeBuilder import net.minecraft.resources.ResourceLocation -import net.minecraft.world.item.DyeColor import net.minecraft.world.item.ItemStack import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.level.block.Block @@ -19,6 +18,9 @@ import net.minecraftforge.forge.event.lifecycle.GatherDataEvent import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.block.* import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState +import ru.dbotthepony.mc.otm.block.matter.MatterBottlerBlock +import ru.dbotthepony.mc.otm.block.matter.PatternStorageBlock +import ru.dbotthepony.mc.otm.block.storage.DriveViewerBlock import ru.dbotthepony.mc.otm.data.LootTableBasicAppender import ru.dbotthepony.mc.otm.datagen.blocks.BatteryBankProvider import ru.dbotthepony.mc.otm.datagen.blocks.MatterBankProvider diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt index 09958bba5..249098520 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/PatternStorageBlockEntity.kt @@ -6,7 +6,7 @@ import net.minecraft.world.level.block.state.BlockState import ru.dbotthepony.mc.otm.container.MatteryContainer import net.minecraft.world.item.ItemStack import ru.dbotthepony.mc.otm.capability.MatteryCapability -import ru.dbotthepony.mc.otm.block.PatternStorageBlock +import ru.dbotthepony.mc.otm.block.matter.PatternStorageBlock import net.minecraft.nbt.CompoundTag import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt similarity index 98% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt index 7a496ab2b..ff6586ee9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterBottlerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterBottlerBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -16,7 +16,8 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.block.MatterBottlerBlock +import ru.dbotthepony.mc.otm.block.matter.MatterBottlerBlock +import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterCapacitorBankBlockEntity.kt similarity index 98% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterCapacitorBankBlockEntity.kt index b6b888b76..28386db29 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterCapacitorBankBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterCapacitorBankBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.matter import net.minecraft.MethodsReturnNonnullByDefault import net.minecraft.core.BlockPos @@ -17,6 +17,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import ru.dbotthepony.mc.otm.block.BatteryBankBlock +import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler import ru.dbotthepony.mc.otm.capability.matter.MatterDirection diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterDecomposerBlockEntity.kt similarity index 99% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterDecomposerBlockEntity.kt index a4b28fe88..49680d66f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterDecomposerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterDecomposerBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterPanelBlockEntity.kt similarity index 98% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterPanelBlockEntity.kt index d30a6ca39..7903bc206 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterPanelBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterPanelBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -24,6 +24,7 @@ import net.minecraft.network.chat.TranslatableComponent import net.minecraft.server.level.ServerLevel import net.minecraft.world.level.Level import net.minecraftforge.common.capabilities.Capability +import ru.dbotthepony.mc.otm.block.entity.MatteryBlockEntity import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterRecyclerBlockEntity.kt similarity index 99% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterRecyclerBlockEntity.kt index 5daca68a6..a46bf89db 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterRecyclerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterRecyclerBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt similarity index 99% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt index e72a98cab..b65866f14 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterReplicatorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterReplicatorBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt similarity index 99% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt index eac41d222..25781f836 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/MatterScannerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/matter/MatterScannerBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveRackBlockEntity.kt similarity index 96% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveRackBlockEntity.kt index e4c363718..8bdf0a313 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveRackBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveRackBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.storage import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -14,6 +14,7 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional +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 diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveViewerBlockEntity.kt similarity index 94% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveViewerBlockEntity.kt index 6f81dc6b1..dadda42d9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/DriveViewerBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/DriveViewerBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.storage import net.minecraft.MethodsReturnNonnullByDefault import net.minecraft.core.BlockPos @@ -12,7 +12,8 @@ import net.minecraft.world.item.ItemStack import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.BlockState import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.block.DriveViewerBlock +import ru.dbotthepony.mc.otm.block.entity.MatteryPoweredBlockEntity +import ru.dbotthepony.mc.otm.block.storage.DriveViewerBlock import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/ItemMonitorBlockEntity.kt similarity index 94% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/ItemMonitorBlockEntity.kt index fa5120509..baabdf6cd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/ItemMonitorBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/ItemMonitorBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.storage import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -12,6 +12,7 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional +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.graph.storage.BasicStorageGraphNode diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageBusBlockEntity.kt similarity index 99% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageBusBlockEntity.kt index f23e52ca6..2450f8e6f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageBusBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageBusBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.storage import it.unimi.dsi.fastutil.ints.Int2ObjectAVLTreeMap import it.unimi.dsi.fastutil.longs.Long2ObjectAVLTreeMap @@ -22,6 +22,7 @@ import net.minecraftforge.items.IItemHandler import ru.dbotthepony.mc.otm.* 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.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage import ru.dbotthepony.mc.otm.container.ItemFilter @@ -38,7 +39,6 @@ import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.storage.* import java.lang.ref.WeakReference import java.math.BigInteger -import java.util.* import java.util.stream.Stream import kotlin.collections.ArrayList import kotlin.collections.HashMap diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageInterfaces.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt similarity index 97% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageInterfaces.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt index 4d4aa435e..99ca61a76 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StorageInterfaces.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StorageInterfaces.kt @@ -1,6 +1,5 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.storage -import it.unimi.dsi.fastutil.longs.LongAVLTreeSet import it.unimi.dsi.fastutil.longs.LongArraySet import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -23,11 +22,11 @@ import net.minecraftforge.items.IItemHandler import ru.dbotthepony.mc.otm.* 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.container.ItemFilter import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.core.plus -import ru.dbotthepony.mc.otm.core.toImpreciseFraction import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.GraphNodeListener import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode @@ -38,9 +37,7 @@ import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.storage.* import java.math.BigInteger -import java.util.* import java.util.stream.Stream -import kotlin.collections.HashSet abstract class AbstractStorageImportExport( blockType: BlockEntityType<*>, @@ -361,7 +358,9 @@ class StorageExporterBlockEntity(blockPos: BlockPos, blockState: BlockState) : continue } - val exportAmountA = items.extractStack(stack.first, stack.second.count.coerceAtMost(MAX_MOVE_PER_OPERATION), true).count + val exportAmountA = items.extractStack(stack.first, stack.second.count.coerceAtMost( + MAX_MOVE_PER_OPERATION + ), true).count if (exportAmountA == BigInteger.ZERO) { continue diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StoragePowerSupplierBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StoragePowerSupplierBlockEntity.kt similarity index 97% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StoragePowerSupplierBlockEntity.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StoragePowerSupplierBlockEntity.kt index 48992118b..0fc105718 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/StoragePowerSupplierBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/storage/StoragePowerSupplierBlockEntity.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block.entity +package ru.dbotthepony.mc.otm.block.entity.storage import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -14,6 +14,7 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import ru.dbotthepony.mc.otm.OverdriveThatMatters +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 diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt similarity index 94% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt index 75f280ae8..3ce941a6b 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterBottlerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterBottlerBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.matter import net.minecraft.MethodsReturnNonnullByDefault import javax.annotation.ParametersAreNonnullByDefault @@ -11,13 +11,14 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.entity.BlockEntity -import ru.dbotthepony.mc.otm.block.entity.MatterBottlerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterBottlerBlockEntity import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.entity.BlockEntityTicker import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BooleanProperty import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt similarity index 88% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt index 091694c5f..68b2aa499 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterCapacitorBankBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterCapacitorBankBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -11,7 +11,9 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.MatterCapacitorBankBlockEntity +import ru.dbotthepony.mc.otm.block.BatteryBankBlock +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.entity.matter.MatterCapacitorBankBlockEntity import ru.dbotthepony.mc.otm.shapes.BlockShapes class MatterCapacitorBankBlock : RotatableMatteryBlock(), EntityBlock { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt similarity index 92% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt index 6184ab7dd..992109b78 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterDecomposerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterDecomposerBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.matter import net.minecraft.MethodsReturnNonnullByDefault import javax.annotation.ParametersAreNonnullByDefault @@ -7,7 +7,7 @@ import net.minecraft.core.BlockPos import net.minecraft.core.Direction import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.entity.BlockEntity -import ru.dbotthepony.mc.otm.block.entity.MatterDecomposerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterDecomposerBlockEntity import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.entity.BlockEntityTicker import net.minecraft.world.level.block.state.StateDefinition @@ -16,6 +16,7 @@ import net.minecraft.world.level.Level import net.minecraft.world.level.block.Block import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterPanelBlock.kt similarity index 93% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterPanelBlock.kt index 2c3e2a6e0..22c6d373f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterPanelBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterPanelBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.matter import com.google.common.collect.ImmutableMap import net.minecraft.world.level.block.EntityBlock @@ -6,7 +6,7 @@ import net.minecraft.core.BlockPos import net.minecraft.core.Direction import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.entity.BlockEntity -import ru.dbotthepony.mc.otm.block.entity.MatterPanelBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterPanelBlockEntity import net.minecraft.world.phys.shapes.VoxelShape import net.minecraft.world.phys.shapes.Shapes import net.minecraft.world.level.BlockGetter @@ -15,6 +15,7 @@ import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.state.properties.EnumProperty +import ru.dbotthepony.mc.otm.block.MatteryBlock class MatterPanelBlock : MatteryBlock(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt similarity index 92% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt index 9ca69884e..276657139 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterRecyclerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterRecyclerBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -13,7 +13,8 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.MatterRecyclerBlockEntity +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.entity.matter.MatterRecyclerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt similarity index 92% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt index dee4c6514..9d3fed1d3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterReplicatorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterReplicatorBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -13,7 +13,8 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.MatterReplicatorBlockEntity +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.entity.matter.MatterReplicatorBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt similarity index 92% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt index 71632ccf5..f58763a77 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/MatterScannerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/MatterScannerBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -13,7 +13,8 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.MatterScannerBlockEntity +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.entity.matter.MatterScannerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt similarity index 96% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt index 592b27344..7df2879e5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/PatternStorageBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/matter/PatternStorageBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.matter import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -12,6 +12,7 @@ import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BooleanProperty import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.entity.PatternStorageBlockEntity import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt similarity index 91% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt index 7488c4cd3..67f38278d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveRackBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveRackBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.storage import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -11,7 +11,8 @@ import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.DriveRackBlockEntity +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.entity.storage.DriveRackBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt similarity index 93% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt index 06150edce..a3a815d1c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/DriveViewerBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/DriveViewerBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.storage import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -15,7 +15,8 @@ import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BooleanProperty import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.DriveViewerBlockEntity +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.entity.storage.DriveViewerBlockEntity import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt similarity index 91% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt index 9fc48db85..549941bef 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/ItemMonitorBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/ItemMonitorBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.storage import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -11,7 +11,8 @@ import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.ItemMonitorBlockEntity +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.entity.storage.ItemMonitorBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/StorageBusBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt similarity index 87% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/StorageBusBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt index 81a09eb67..f9fae0cf3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/StorageBusBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageBusBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.storage import net.minecraft.core.BlockPos import net.minecraft.world.item.context.BlockPlaceContext @@ -16,7 +16,10 @@ import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.Shapes import net.minecraft.world.phys.shapes.VoxelShape import ru.dbotthepony.mc.otm.addPreWorldTickerOnce -import ru.dbotthepony.mc.otm.block.entity.StorageBusBlockEntity +import ru.dbotthepony.mc.otm.block.CableBlock +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.StorageCableBlock +import ru.dbotthepony.mc.otm.block.entity.storage.StorageBusBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes import ru.dbotthepony.mc.otm.unaryMinus @@ -45,12 +48,14 @@ class StorageBusBlock : RotatableMatteryBlock(), EntityBlock { override fun createBlockStateDefinition(builder: StateDefinition.Builder) { super.createBlockStateDefinition(builder) - builder.add(CableBlock.CONNECTION_SOUTH, - CableBlock.CONNECTION_WEST, - CableBlock.CONNECTION_EAST, - CableBlock.CONNECTION_NORTH, - CableBlock.CONNECTION_UP, - CableBlock.CONNECTION_DOWN) + builder.add( + CableBlock.CONNECTION_SOUTH, + CableBlock.CONNECTION_WEST, + CableBlock.CONNECTION_EAST, + CableBlock.CONNECTION_NORTH, + CableBlock.CONNECTION_UP, + CableBlock.CONNECTION_DOWN + ) } override fun getTicker( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/StorageInterfaces.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt similarity index 92% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/StorageInterfaces.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt index d1c636bae..62196cf8b 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/StorageInterfaces.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StorageInterfaces.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.storage import net.minecraft.core.BlockPos import net.minecraft.world.item.context.BlockPlaceContext @@ -16,8 +16,11 @@ import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.Shapes import net.minecraft.world.phys.shapes.VoxelShape import ru.dbotthepony.mc.otm.addPreWorldTickerOnce -import ru.dbotthepony.mc.otm.block.entity.StorageExporterBlockEntity -import ru.dbotthepony.mc.otm.block.entity.StorageImporterBlockEntity +import ru.dbotthepony.mc.otm.block.CableBlock +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.StorageCableBlock +import ru.dbotthepony.mc.otm.block.entity.storage.StorageExporterBlockEntity +import ru.dbotthepony.mc.otm.block.entity.storage.StorageImporterBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes import ru.dbotthepony.mc.otm.unaryMinus @@ -42,12 +45,14 @@ class StorageImporterBlock : RotatableMatteryBlock(), EntityBlock { override fun createBlockStateDefinition(builder: StateDefinition.Builder) { super.createBlockStateDefinition(builder) - builder.add(CableBlock.CONNECTION_SOUTH, + builder.add( + CableBlock.CONNECTION_SOUTH, CableBlock.CONNECTION_WEST, CableBlock.CONNECTION_EAST, CableBlock.CONNECTION_NORTH, CableBlock.CONNECTION_UP, - CableBlock.CONNECTION_DOWN) + CableBlock.CONNECTION_DOWN + ) } override fun getTicker( @@ -131,12 +136,14 @@ class StorageExporterBlock : RotatableMatteryBlock(), EntityBlock { override fun createBlockStateDefinition(builder: StateDefinition.Builder) { super.createBlockStateDefinition(builder) - builder.add(CableBlock.CONNECTION_SOUTH, + builder.add( + CableBlock.CONNECTION_SOUTH, CableBlock.CONNECTION_WEST, CableBlock.CONNECTION_EAST, CableBlock.CONNECTION_NORTH, CableBlock.CONNECTION_UP, - CableBlock.CONNECTION_DOWN) + CableBlock.CONNECTION_DOWN + ) } override fun getTicker( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/StoragePowerSupplierBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt similarity index 91% rename from src/main/kotlin/ru/dbotthepony/mc/otm/block/StoragePowerSupplierBlock.kt rename to src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt index ce6135c66..6efe3d5ae 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/StoragePowerSupplierBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/storage/StoragePowerSupplierBlock.kt @@ -1,4 +1,4 @@ -package ru.dbotthepony.mc.otm.block +package ru.dbotthepony.mc.otm.block.storage import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -11,7 +11,8 @@ import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.block.entity.StoragePowerSupplierBlockEntity +import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock +import ru.dbotthepony.mc.otm.block.entity.storage.StoragePowerSupplierBlockEntity import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveRackMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveRackMenu.kt index 1fe552b3c..bcdf4d403 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveRackMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveRackMenu.kt @@ -2,7 +2,7 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.DriveRackBlockEntity +import ru.dbotthepony.mc.otm.block.entity.storage.DriveRackBlockEntity import ru.dbotthepony.mc.otm.registry.MMenus class DriveRackMenu @JvmOverloads constructor( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveViewerMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveViewerMenu.kt index 1724d5423..37c2fc5e7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveViewerMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/DriveViewerMenu.kt @@ -5,7 +5,7 @@ import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.item.ItemStack import net.minecraftforge.energy.CapabilityEnergy -import ru.dbotthepony.mc.otm.block.entity.DriveViewerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.storage.DriveViewerBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive import ru.dbotthepony.mc.otm.container.ItemFilter diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ItemMonitorMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ItemMonitorMenu.kt index f2b69dc0c..d73facdc2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ItemMonitorMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/ItemMonitorMenu.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.item.ItemStack -import ru.dbotthepony.mc.otm.block.entity.ItemMonitorBlockEntity +import ru.dbotthepony.mc.otm.block.entity.storage.ItemMonitorBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.menu.data.INetworkedItemViewSupplier import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterBottlerMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterBottlerMenu.kt index 19a2c9089..6b7a987fd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterBottlerMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterBottlerMenu.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory import net.minecraft.world.item.ItemStack -import ru.dbotthepony.mc.otm.block.entity.MatterBottlerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterBottlerBlockEntity import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.menu.widget.BooleanPlayerInputWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterCapacitorBankMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterCapacitorBankMenu.kt index 8850047d3..048b0c7ab 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterCapacitorBankMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterCapacitorBankMenu.kt @@ -2,9 +2,8 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.MatterCapacitorBankBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterCapacitorBankBlockEntity import ru.dbotthepony.mc.otm.core.ImpreciseFraction -import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.registry.MMenus diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterDecomposerMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterDecomposerMenu.kt index 3736f60d7..8eec21425 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterDecomposerMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterDecomposerMenu.kt @@ -2,7 +2,7 @@ package ru.dbotthepony.mc.otm.menu import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.MatterDecomposerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterDecomposerBlockEntity import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import net.minecraft.world.SimpleContainer diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterPanelMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterPanelMenu.kt index e766a5c75..ee70bd828 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterPanelMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterPanelMenu.kt @@ -5,7 +5,7 @@ import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraftforge.network.PacketDistributor import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.block.entity.MatterPanelBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterPanelBlockEntity import ru.dbotthepony.mc.otm.capability.matter.MatterTask import ru.dbotthepony.mc.otm.capability.matter.PatternState import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphListener diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterRecyclerMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterRecyclerMenu.kt index 49694664a..2e6bd82be 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterRecyclerMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterRecyclerMenu.kt @@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory import net.minecraft.world.item.ItemStack -import ru.dbotthepony.mc.otm.block.entity.MatterRecyclerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterRecyclerBlockEntity import ru.dbotthepony.mc.otm.item.MatterDustItem import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterReplicatorMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterReplicatorMenu.kt index 982b6bbe7..99db2e270 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterReplicatorMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterReplicatorMenu.kt @@ -2,7 +2,7 @@ package ru.dbotthepony.mc.otm.menu import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.MatterReplicatorBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterReplicatorBlockEntity import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import net.minecraft.world.SimpleContainer diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterScannerMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterScannerMenu.kt index 27c86665a..59e28edc9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterScannerMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MatterScannerMenu.kt @@ -2,7 +2,7 @@ package ru.dbotthepony.mc.otm.menu import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.MatterScannerBlockEntity +import ru.dbotthepony.mc.otm.block.entity.matter.MatterScannerBlockEntity import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import net.minecraft.world.SimpleContainer diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageBusMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageBusMenu.kt index 3dfa84d90..becc821a8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageBusMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageBusMenu.kt @@ -1,7 +1,7 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.StorageBusBlockEntity +import ru.dbotthepony.mc.otm.block.entity.storage.StorageBusBlockEntity import ru.dbotthepony.mc.otm.container.ItemFilterNetworkSlot import ru.dbotthepony.mc.otm.menu.widget.BooleanPlayerInputWidget import ru.dbotthepony.mc.otm.registry.MMenus diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageExporterMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageExporterMenu.kt index ad66bec08..31bdcd9e9 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageExporterMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageExporterMenu.kt @@ -1,8 +1,7 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.StorageBusBlockEntity -import ru.dbotthepony.mc.otm.block.entity.StorageExporterBlockEntity +import ru.dbotthepony.mc.otm.block.entity.storage.StorageExporterBlockEntity import ru.dbotthepony.mc.otm.container.ItemFilterNetworkSlot import ru.dbotthepony.mc.otm.menu.widget.BooleanPlayerInputWidget import ru.dbotthepony.mc.otm.registry.MMenus diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageImporterMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageImporterMenu.kt index f0263f334..eb4645055 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageImporterMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StorageImporterMenu.kt @@ -1,9 +1,7 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.StorageBusBlockEntity -import ru.dbotthepony.mc.otm.block.entity.StorageExporterBlockEntity -import ru.dbotthepony.mc.otm.block.entity.StorageImporterBlockEntity +import ru.dbotthepony.mc.otm.block.entity.storage.StorageImporterBlockEntity import ru.dbotthepony.mc.otm.container.ItemFilterNetworkSlot import ru.dbotthepony.mc.otm.menu.widget.BooleanPlayerInputWidget import ru.dbotthepony.mc.otm.registry.MMenus diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StoragePowerSupplierMenu.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StoragePowerSupplierMenu.kt index 753ced438..b4b16c9d3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StoragePowerSupplierMenu.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/StoragePowerSupplierMenu.kt @@ -1,10 +1,8 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.block.entity.StorageImporterBlockEntity -import ru.dbotthepony.mc.otm.block.entity.StoragePowerSupplierBlockEntity +import ru.dbotthepony.mc.otm.block.entity.storage.StoragePowerSupplierBlockEntity import ru.dbotthepony.mc.otm.menu.data.ImpreciseFractionDataContainer -import ru.dbotthepony.mc.otm.menu.widget.BooleanPlayerInputWidget import ru.dbotthepony.mc.otm.registry.MMenus class StoragePowerSupplierMenu @JvmOverloads constructor( diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlockEntities.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlockEntities.kt index ce0e0cea3..bc6c1b354 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlockEntities.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlockEntities.kt @@ -11,6 +11,8 @@ import ru.dbotthepony.mc.otm.block.entity.* import ru.dbotthepony.mc.otm.block.entity.blackhole.BlackHoleBlockEntity import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityExplosionDebugger import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntitySphereDebugger +import ru.dbotthepony.mc.otm.block.entity.matter.* +import ru.dbotthepony.mc.otm.block.entity.storage.* import ru.dbotthepony.mc.otm.client.render.BlackHoleRenderer import ru.dbotthepony.mc.otm.client.render.EnergyCounterRenderer import ru.dbotthepony.mc.otm.client.render.GravitationStabilizerRenderer diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt index 983dd24ea..93c53cf7e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt @@ -17,6 +17,8 @@ import net.minecraftforge.registries.DeferredRegister import net.minecraftforge.registries.ForgeRegistries import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.block.* +import ru.dbotthepony.mc.otm.block.matter.* +import ru.dbotthepony.mc.otm.block.storage.* object MBlocks { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/storage/API.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/storage/API.kt index 0e0055ce0..d051cdbfb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/storage/API.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/storage/API.kt @@ -49,7 +49,8 @@ interface IStorageStack { } } -inline fun T.key(): T { +@Suppress("UNCHECKED_CAST") +fun T.key(): T { return copy().also { it.count = BigInteger.ONE } as T }