From bb606f3c8db75b5677e742e93aa8c16b9c918d98 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 30 Jan 2022 19:59:27 +0700 Subject: [PATCH] Split registry file into multiple files --- .../ru/dbotthepony/mc/otm/datagen/DataGen.kt | 178 +- .../mc/otm/datagen/blocks/Banks.kt | 6 +- .../mc/otm/OverdriveThatMatters.java | 19 +- .../java/ru/dbotthepony/mc/otm/Registry.java | 1426 ----------------- .../otm/android/AndroidResearchBuilder.java | 2 +- .../mc/otm/android/AndroidResearchType.java | 2 +- .../android/feature/AndroidExtendedReach.java | 6 +- .../feature/AndroidLimbOverclocking.java | 5 +- .../android/feature/AndroidNanobotsArmor.java | 12 +- .../feature/AndroidNanobotsRegeneration.java | 12 +- .../mc/otm/client/EventHandler.java | 4 +- .../model/GravitationStabilizerModel.java | 4 +- .../network/android/AndroidFeaturePacket.java | 2 +- .../android/AndroidResearchPacket.java | 2 +- .../android/AndroidResearchRequestPacket.java | 2 +- .../mc/otm/registry/AndroidFeatures.java | 36 + .../mc/otm/registry/AndroidResearch.java | 247 +++ .../mc/otm/registry/MBlockEntities.java | 105 ++ .../dbotthepony/mc/otm/registry/MBlocks.java | 190 +++ .../dbotthepony/mc/otm/registry/MItems.java | 407 +++++ .../dbotthepony/mc/otm/registry/MMenus.java | 97 ++ .../dbotthepony/mc/otm/registry/MNames.java | 173 ++ .../dbotthepony/mc/otm/registry/MRecipes.java | 44 + .../dbotthepony/mc/otm/registry/MStats.java | 19 + .../ru/dbotthepony/mc/otm/registry/MTags.java | 15 + .../dbotthepony/mc/otm/registry/Registry.java | 207 +++ .../mc/otm/block/BlockAndroidStation.kt | 5 +- .../mc/otm/block/BlockBatteryBank.kt | 6 +- .../mc/otm/block/BlockBlackHole.kt | 5 +- .../mc/otm/block/BlockChemicalGenerator.kt | 4 +- .../mc/otm/block/BlockDriveRack.kt | 4 +- .../mc/otm/block/BlockDriveViewer.kt | 4 +- .../mc/otm/block/BlockEnergyCounter.kt | 4 +- .../mc/otm/block/BlockExplosionDebugger.kt | 6 +- .../otm/block/BlockGravitationStabilizer.kt | 7 +- .../mc/otm/block/BlockItemMonitor.kt | 5 +- .../mc/otm/block/BlockMatterBottler.kt | 5 +- .../mc/otm/block/BlockMatterDecomposer.kt | 6 +- .../mc/otm/block/BlockMatterRecycler.kt | 4 +- .../mc/otm/block/BlockMatterReplicator.kt | 4 +- .../mc/otm/block/BlockMatterScanner.kt | 4 +- .../mc/otm/block/BlockPlatePress.kt | 4 +- .../block/entity/BlockEntityAndroidStation.kt | 4 +- .../block/entity/BlockEntityBatteryBank.kt | 5 +- .../otm/block/entity/BlockEntityCargoCrate.kt | 4 +- .../entity/BlockEntityChemicalGenerator.kt | 4 +- .../otm/block/entity/BlockEntityDriveRack.kt | 4 +- .../block/entity/BlockEntityDriveViewer.kt | 5 +- .../block/entity/BlockEntityEnergyCounter.kt | 4 +- .../BlockEntityGravitationStabilizer.kt | 7 +- .../block/entity/BlockEntityItemMonitor.kt | 5 +- .../block/entity/BlockEntityMatterBottler.kt | 4 +- .../block/entity/BlockEntityMatterCable.kt | 4 +- .../entity/BlockEntityMatterCapacitorBank.kt | 4 +- .../entity/BlockEntityMatterDecomposer.kt | 7 +- .../block/entity/BlockEntityMatterPanel.kt | 6 +- .../block/entity/BlockEntityMatterRecycler.kt | 4 +- .../entity/BlockEntityMatterReplicator.kt | 7 +- .../block/entity/BlockEntityMatterScanner.kt | 4 +- .../block/entity/BlockEntityPatternStorage.kt | 4 +- .../otm/block/entity/BlockEntityPlatePress.kt | 7 +- .../entity/blackhole/BlockEntityBlackHole.kt | 8 +- .../blackhole/BlockEntityExplosionDebugger.kt | 6 +- .../otm/block/entity/blackhole/Explosions.kt | 2 +- .../capability/android/AndroidCapability.kt | 8 +- .../android/AndroidCapabilityPlayer.kt | 9 +- .../mc/otm/client/render/BlackHoleRenderer.kt | 6 +- .../otm/client/screen/ScreenAndroidStation.kt | 2 +- .../mc/otm/compat/jei/JEIPlugin.kt | 4 +- .../mc/otm/item/ItemTritaniumArmor.kt | 9 +- .../dbotthepony/mc/otm/matter/MatterData.kt | 7 +- .../mc/otm/menu/MenuAndroidStation.kt | 4 +- .../mc/otm/menu/MenuBatteryBank.kt | 4 +- .../dbotthepony/mc/otm/menu/MenuCargoCrate.kt | 4 +- .../mc/otm/menu/MenuChemicalGenerator.kt | 4 +- .../dbotthepony/mc/otm/menu/MenuDriveRack.kt | 4 +- .../mc/otm/menu/MenuDriveViewer.kt | 4 +- .../mc/otm/menu/MenuEnergyCounter.kt | 5 +- .../mc/otm/menu/MenuItemMonitor.kt | 4 +- .../mc/otm/menu/MenuMatterBottler.kt | 4 +- .../mc/otm/menu/MenuMatterCapacitor.kt | 5 +- .../mc/otm/menu/MenuMatterDecomposer.kt | 4 +- .../mc/otm/menu/MenuMatterPanel.kt | 4 +- .../mc/otm/menu/MenuMatterRecycler.kt | 4 +- .../mc/otm/menu/MenuMatterReplicator.kt | 4 +- .../mc/otm/menu/MenuMatterScanner.kt | 4 +- .../mc/otm/menu/MenuPatternStorage.kt | 5 +- .../dbotthepony/mc/otm/menu/MenuPlatePress.kt | 4 +- .../mc/otm/recipe/PlatePressRecipe.kt | 7 +- 89 files changed, 1809 insertions(+), 1722 deletions(-) delete mode 100644 src/main/java/ru/dbotthepony/mc/otm/Registry.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/AndroidFeatures.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/AndroidResearch.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/MBlockEntities.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/MBlocks.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/MItems.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/MMenus.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/MNames.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/MRecipes.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/MStats.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/MTags.java create mode 100644 src/main/java/ru/dbotthepony/mc/otm/registry/Registry.java 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 d2bfae73a..e33850f7a 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.tags.ItemTags import net.minecraft.tags.Tag import net.minecraft.world.item.Item import net.minecraft.world.level.block.Block @@ -15,9 +14,9 @@ import net.minecraftforge.eventbus.api.SubscribeEvent import net.minecraftforge.fml.common.Mod import net.minecraftforge.forge.event.lifecycle.GatherDataEvent import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.Registry -import ru.dbotthepony.mc.otm.Registry.Blocks -import ru.dbotthepony.mc.otm.Registry.Items +import ru.dbotthepony.mc.otm.registry.Registry +import ru.dbotthepony.mc.otm.registry.MBlocks +import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.block.BlockDriveViewer import ru.dbotthepony.mc.otm.block.BlockEnergyCounter import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable @@ -32,6 +31,7 @@ import ru.dbotthepony.mc.otm.datagen.loot.TileNbtCopy import ru.dbotthepony.mc.otm.datagen.models.BlockMatteryModelProvider import ru.dbotthepony.mc.otm.datagen.recipes.MatteryRecipeProvider import ru.dbotthepony.mc.otm.datagen.recipes.has +import ru.dbotthepony.mc.otm.registry.MTags @Mod.EventBusSubscriber(modid = DataGen.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) object DataGen { @@ -119,19 +119,19 @@ object DataGen { event.generator.addProvider(BatteryBankProvider(event)) event.generator.addProvider(lootTableProvider) - decorativeCubeAll(*Blocks.CRATES) - decorativeCubeAll(Blocks.CARBON_FIBRE_BLOCK) - decorativeCubeAll(Blocks.TRITANIUM_BLOCK) + decorativeCubeAll(*MBlocks.CRATES) + decorativeCubeAll(MBlocks.CARBON_FIBRE_BLOCK) + decorativeCubeAll(MBlocks.TRITANIUM_BLOCK) for (glass in Registry.INDUSTRIAL_GLASS_LIST) { decorativeCubeAll(glass.block) } - blockModelProvider.resourceCubeAll(Blocks.TRITANIUM_ORE) - blockModelProvider.resourceCubeAll(Blocks.TRITANIUM_RAW_BLOCK) - blockModelProvider.resourceCubeAll(Blocks.DEEPSLATE_TRITANIUM_ORE) + blockModelProvider.resourceCubeAll(MBlocks.TRITANIUM_ORE) + blockModelProvider.resourceCubeAll(MBlocks.TRITANIUM_RAW_BLOCK) + blockModelProvider.resourceCubeAll(MBlocks.DEEPSLATE_TRITANIUM_ORE) - decorativeColumn(Blocks.TRITANIUM_STRIPED_BLOCK, "tritanium_striped_block", "tritanium_block") + decorativeColumn(MBlocks.TRITANIUM_STRIPED_BLOCK, "tritanium_striped_block", "tritanium_block") for (glass in Registry.INDUSTRIAL_GLASS_LIST) { val name = glass.block.registryName?.path ?: throw IllegalStateException("Invalid state of glass block ${glass.block}") @@ -168,80 +168,80 @@ object DataGen { } with(blockStateProvider) { - block(Blocks.BLACK_HOLE) - block(Blocks.ANDROID_STATION) + block(MBlocks.BLACK_HOLE) + block(MBlocks.ANDROID_STATION) - ore(Blocks.DEEPSLATE_TRITANIUM_ORE) - ore(Blocks.TRITANIUM_ORE) - ore(Blocks.TRITANIUM_RAW_BLOCK) + ore(MBlocks.DEEPSLATE_TRITANIUM_ORE) + ore(MBlocks.TRITANIUM_ORE) + ore(MBlocks.TRITANIUM_RAW_BLOCK) - block(Blocks.CHEMICAL_GENERATOR) - block(Blocks.MATTER_SCANNER) - block(Blocks.ITEM_MONITOR) - block(Blocks.MATTER_BOTTLER) - block(Blocks.MATTER_DECOMPOSER) - block(Blocks.MATTER_REPLICATOR) - block(Blocks.PLATE_PRESS) - block(Blocks.GRAVITATION_STABILIZER) - block(Blocks.GRAVITATION_STABILIZER_LENS) + block(MBlocks.CHEMICAL_GENERATOR) + block(MBlocks.MATTER_SCANNER) + block(MBlocks.ITEM_MONITOR) + block(MBlocks.MATTER_BOTTLER) + block(MBlocks.MATTER_DECOMPOSER) + block(MBlocks.MATTER_REPLICATOR) + block(MBlocks.PLATE_PRESS) + block(MBlocks.GRAVITATION_STABILIZER) + block(MBlocks.GRAVITATION_STABILIZER_LENS) } with(itemModelProvider) { - block(Items.ANDROID_STATION) - block(Items.BATTERY_BANK) - block(Items.MATTER_CAPACITOR_BANK) - block(Items.PATTERN_STORAGE) - block(Items.BLACK_HOLE) - block(Items.CARBON_FIBRE_BLOCK) - block(Items.DEEPSLATE_TRITANIUM_ORE) - block(Items.TRITANIUM_ORE) - block(Items.TRITANIUM_STRIPED_BLOCK) - block(Items.TRITANIUM_RAW_BLOCK) - block(Items.ITEM_MONITOR) - block(Items.TRITANIUM_BLOCK) + block(MItems.ANDROID_STATION) + block(MItems.BATTERY_BANK) + block(MItems.MATTER_CAPACITOR_BANK) + block(MItems.PATTERN_STORAGE) + block(MItems.BLACK_HOLE) + block(MItems.CARBON_FIBRE_BLOCK) + block(MItems.DEEPSLATE_TRITANIUM_ORE) + block(MItems.TRITANIUM_ORE) + block(MItems.TRITANIUM_STRIPED_BLOCK) + block(MItems.TRITANIUM_RAW_BLOCK) + block(MItems.ITEM_MONITOR) + block(MItems.TRITANIUM_BLOCK) for (glass in Registry.INDUSTRIAL_GLASS_LIST) { block(glass.item) generated(glass.paneItem, ResourceLocation(MOD_ID, "block/decorative/${glass.item.registryName!!.path}")) } - blocks(*Items.CRATES) + blocks(*MItems.CRATES) - components(*Items.DATAGEN_COMPONENTS) + components(*MItems.DATAGEN_COMPONENTS) - generated(Items.PILL_ANDROID) - generated(Items.PILL_HUMANE) - generated(Items.PILL_OBLIVION) - generated(Items.PILL_HEAL) - generated(Items.NUTRIENT_PASTE) - component(Items.TRITANIUM_INGOT) - resource(Items.TRITANIUM_ORE_CLUMP) + generated(MItems.PILL_ANDROID) + generated(MItems.PILL_HUMANE) + generated(MItems.PILL_OBLIVION) + generated(MItems.PILL_HEAL) + generated(MItems.NUTRIENT_PASTE) + component(MItems.TRITANIUM_INGOT) + resource(MItems.TRITANIUM_ORE_CLUMP) - handheld(*Items.TRITANIUM_TOOLS) - generated(*Items.TRITANIUM_ARMOR) + handheld(*MItems.TRITANIUM_TOOLS) + generated(*MItems.TRITANIUM_ARMOR) - generatedTiered(Items.BATTERIES, "battery_tier") - generated(Items.BATTERY_CREATIVE) + generatedTiered(MItems.BATTERIES, "battery_tier") + generated(MItems.BATTERY_CREATIVE) - generated(Items.MATTER_CAPACITOR_BASIC, ResourceLocation(MOD_ID, "item/matter_capacitor_tier1")) - generated(Items.MATTER_CAPACITOR_NORMAL, ResourceLocation(MOD_ID, "item/matter_capacitor_tier2")) - generated(Items.MATTER_CAPACITOR_DENSE, ResourceLocation(MOD_ID, "item/matter_capacitor_tier3")) - generated(Items.MATTER_CAPACITOR_CREATIVE) + generated(MItems.MATTER_CAPACITOR_BASIC, ResourceLocation(MOD_ID, "item/matter_capacitor_tier1")) + generated(MItems.MATTER_CAPACITOR_NORMAL, ResourceLocation(MOD_ID, "item/matter_capacitor_tier2")) + generated(MItems.MATTER_CAPACITOR_DENSE, ResourceLocation(MOD_ID, "item/matter_capacitor_tier3")) + generated(MItems.MATTER_CAPACITOR_CREATIVE) - generated(Items.PATTERN_DRIVE_CREATIVE) + generated(MItems.PATTERN_DRIVE_CREATIVE) - block(Items.CARGO_CRATE, "cargo_crate_closed") - block(Items.CHEMICAL_GENERATOR, "chemical_generator_working") - block(Items.ENERGY_COUNTER, "energy_counter_down") - block(Items.MATTER_BOTTLER, "matter_bottler_working") - block(Items.MATTER_CABLE, "matter_cable_core") - block(Items.MATTER_DECOMPOSER, "matter_decomposer_working") + block(MItems.CARGO_CRATE, "cargo_crate_closed") + block(MItems.CHEMICAL_GENERATOR, "chemical_generator_working") + block(MItems.ENERGY_COUNTER, "energy_counter_down") + block(MItems.MATTER_BOTTLER, "matter_bottler_working") + block(MItems.MATTER_CABLE, "matter_cable_core") + block(MItems.MATTER_DECOMPOSER, "matter_decomposer_working") - block(Items.PLATE_PRESS, "plate_press_idle") + block(MItems.PLATE_PRESS, "plate_press_idle") } blockStateProvider.lambda { provider -> - with(provider.getMultipartBuilder(Blocks.DRIVE_VIEWER)) { + with(provider.getMultipartBuilder(MBlocks.DRIVE_VIEWER)) { for (facing in BlockMatteryRotatable.FACING.possibleValues) { part() .modelFile(provider.models().getExistingFile(ResourceLocation(MOD_ID, "block/drive_viewer_drive_part"))) @@ -261,7 +261,7 @@ object DataGen { } } - with(provider.getMultipartBuilder(Blocks.PATTERN_STORAGE)) { + with(provider.getMultipartBuilder(MBlocks.PATTERN_STORAGE)) { for (facing in BlockMatteryRotatable.FACING.possibleValues) { for (i in 0 .. 7) { part() @@ -280,7 +280,7 @@ object DataGen { } } - with(provider.getMultipartBuilder(Blocks.ENERGY_COUNTER)) { + with(provider.getMultipartBuilder(MBlocks.ENERGY_COUNTER)) { // даваааййй val up = provider.models().getExistingFile(ResourceLocation(MOD_ID, "block/energy_counter_up")) val down = provider.models().getExistingFile(ResourceLocation(MOD_ID, "block/energy_counter_down")) @@ -332,32 +332,32 @@ object DataGen { ) with(lootTableProvider) { - simpleBlocks(*Blocks.CRATES) - simpleBlock(Blocks.CARGO_CRATE) - simpleBlock(Blocks.CARBON_FIBRE_BLOCK) - simpleBlock(Blocks.TRITANIUM_RAW_BLOCK) - simpleBlock(Blocks.TRITANIUM_BLOCK) - simpleBlock(Blocks.TRITANIUM_STRIPED_BLOCK) - simpleBlock(Blocks.MATTER_CABLE) - simpleBlock(Blocks.GRAVITATION_STABILIZER) + simpleBlocks(*MBlocks.CRATES) + simpleBlock(MBlocks.CARGO_CRATE) + simpleBlock(MBlocks.CARBON_FIBRE_BLOCK) + simpleBlock(MBlocks.TRITANIUM_RAW_BLOCK) + simpleBlock(MBlocks.TRITANIUM_BLOCK) + simpleBlock(MBlocks.TRITANIUM_STRIPED_BLOCK) + simpleBlock(MBlocks.MATTER_CABLE) + simpleBlock(MBlocks.GRAVITATION_STABILIZER) - tile(Blocks.ENERGY_COUNTER, TileNbtCopy("passed"), TileNbtCopy("history"), TileNbtCopy("history_tick")) - tile(Blocks.CHEMICAL_GENERATOR, TileNbtCopy("energy"), TileNbtCopy("container"), TileNbtCopy("working_ticks"), TileNbtCopy("working_ticks_total")) + tile(MBlocks.ENERGY_COUNTER, TileNbtCopy("passed"), TileNbtCopy("history"), TileNbtCopy("history_tick")) + tile(MBlocks.CHEMICAL_GENERATOR, TileNbtCopy("energy"), TileNbtCopy("container"), TileNbtCopy("working_ticks"), TileNbtCopy("working_ticks_total")) - tile(Blocks.ANDROID_STATION, TileNbtCopy("energy"), TileNbtCopy("battery_container")) - tile(Blocks.BATTERY_BANK, TileNbtCopy("container")) - tile(Blocks.DRIVE_VIEWER, TileNbtCopy("energy"), TileNbtCopy("container"), TileNbtCopy("battery_container")) + tile(MBlocks.ANDROID_STATION, TileNbtCopy("energy"), TileNbtCopy("battery_container")) + tile(MBlocks.BATTERY_BANK, TileNbtCopy("container")) + tile(MBlocks.DRIVE_VIEWER, TileNbtCopy("energy"), TileNbtCopy("container"), TileNbtCopy("battery_container")) - tile(Blocks.MATTER_DECOMPOSER, TileNbtCopy("container"), TileNbtCopy("matter"), *workerTags) - tile(Blocks.MATTER_REPLICATOR, TileNbtCopy("container"), TileNbtCopy("matter"), *workerTags) - tile(Blocks.MATTER_RECYCLER, TileNbtCopy("container"), TileNbtCopy("matter"), *workerTags) - tile(Blocks.MATTER_SCANNER, TileNbtCopy("container"), *workerTags) - tile(Blocks.PLATE_PRESS, TileNbtCopy("container"), *workerTags) + tile(MBlocks.MATTER_DECOMPOSER, TileNbtCopy("container"), TileNbtCopy("matter"), *workerTags) + tile(MBlocks.MATTER_REPLICATOR, TileNbtCopy("container"), TileNbtCopy("matter"), *workerTags) + tile(MBlocks.MATTER_RECYCLER, TileNbtCopy("container"), TileNbtCopy("matter"), *workerTags) + tile(MBlocks.MATTER_SCANNER, TileNbtCopy("container"), *workerTags) + tile(MBlocks.PLATE_PRESS, TileNbtCopy("container"), *workerTags) - tile(Blocks.MATTER_PANEL, TileNbtCopy("tasks")) - tile(Blocks.PATTERN_STORAGE, TileNbtCopy("patterns")) - tile(Blocks.MATTER_CAPACITOR_BANK, TileNbtCopy("container")) - tile(Blocks.MATTER_BOTTLER, TileNbtCopy("energy"), TileNbtCopy("battery_container"), TileNbtCopy("work_slots"), TileNbtCopy("work_flow"), TileNbtCopy("matter")) + tile(MBlocks.MATTER_PANEL, TileNbtCopy("tasks")) + tile(MBlocks.PATTERN_STORAGE, TileNbtCopy("patterns")) + tile(MBlocks.MATTER_CAPACITOR_BANK, TileNbtCopy("container")) + tile(MBlocks.MATTER_BOTTLER, TileNbtCopy("energy"), TileNbtCopy("battery_container"), TileNbtCopy("work_slots"), TileNbtCopy("work_flow"), TileNbtCopy("matter")) } with(recipeProvider) { @@ -380,8 +380,8 @@ object DataGen { lambda { _, consumer -> ShapelessRecipeBuilder(Registry.INDUSTRIAL_GLASS.item, 8) .requires(net.minecraft.world.item.Items.GLASS, 8) - .requires(Registry.Tags.Items.PLATE_TRITANIUM) - .unlockedBy("has_plate", has(Registry.Tags.Items.PLATE_TRITANIUM)) + .requires(MTags.Items.PLATE_TRITANIUM) + .unlockedBy("has_plate", has(MTags.Items.PLATE_TRITANIUM)) .unlockedBy("has_glass", has(net.minecraft.world.item.Items.GLASS)) .save(consumer) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt index dcb8c0340..146eb84f5 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/Banks.kt @@ -4,11 +4,11 @@ import net.minecraft.resources.ResourceLocation import net.minecraft.world.level.block.Block import net.minecraftforge.client.model.generators.BlockStateProvider import net.minecraftforge.forge.event.lifecycle.GatherDataEvent -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.BlockBatteryBank import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import ru.dbotthepony.mc.otm.datagen.DataGen import ru.dbotthepony.mc.otm.datagen.toYRotBlockstate +import ru.dbotthepony.mc.otm.registry.MBlocks private fun nothingOrNumber(input: Int): String { if (input == 0) @@ -20,7 +20,7 @@ private fun nothingOrNumber(input: Int): String { open class BatteryBankProvider(event: GatherDataEvent) : BlockStateProvider(event.generator, DataGen.MOD_ID, event.existingFileHelper) { protected var block = "battery_bank" protected var batteryPath = "block/battery/battery" - protected var registry: Block = Registry.Blocks.BATTERY_BANK + protected var registry: Block = MBlocks.BATTERY_BANK override fun registerStatesAndModels() { with(getMultipartBuilder(registry)) { @@ -46,6 +46,6 @@ class MatterBankProvider(event: GatherDataEvent) : BatteryBankProvider(event) { init { block = "matter_capacitor_bank" batteryPath = "block/battery/matter_capacitor" - registry = Registry.Blocks.MATTER_CAPACITOR_BANK + registry = MBlocks.MATTER_CAPACITOR_BANK } } diff --git a/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java b/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java index 6e27e0c54..d7c61fd9f 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java +++ b/src/main/java/ru/dbotthepony/mc/otm/OverdriveThatMatters.java @@ -31,6 +31,7 @@ import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive; import ru.dbotthepony.mc.otm.matter.MatterDataKt; import ru.dbotthepony.mc.otm.matter.MatterRegistryKt; import ru.dbotthepony.mc.otm.network.MatteryNetworking; +import ru.dbotthepony.mc.otm.registry.*; import ru.dbotthepony.mc.otm.storage.ItemStackWrapper; import ru.dbotthepony.mc.otm.storage.StorageObjectRegistry; import ru.dbotthepony.mc.otm.storage.StorageObjectTuple; @@ -123,7 +124,7 @@ public class OverdriveThatMatters { CREATIVE_TAB = new CreativeModeTab("otm") { @Override public ItemStack makeIcon() { - return new ItemStack(Registry.Items.BATTERY_CREATIVE, 1); + return new ItemStack(MItems.BATTERY_CREATIVE, 1); } }; @@ -141,14 +142,14 @@ public class OverdriveThatMatters { FMLJavaModLoadingContext.get().getModEventBus().register(MatteryCapability.class); - FMLJavaModLoadingContext.get().getModEventBus().register(Registry.Items.class); - FMLJavaModLoadingContext.get().getModEventBus().register(Registry.Blocks.class); - FMLJavaModLoadingContext.get().getModEventBus().register(Registry.BlockEntities.class); - FMLJavaModLoadingContext.get().getModEventBus().register(Registry.Menus.class); - FMLJavaModLoadingContext.get().getModEventBus().register(Registry.AndroidFeatures.class); - FMLJavaModLoadingContext.get().getModEventBus().register(Registry.AndroidResearch.class); - FMLJavaModLoadingContext.get().getModEventBus().register(Registry.Stats.class); - FMLJavaModLoadingContext.get().getModEventBus().register(Registry.Recipes.class); + FMLJavaModLoadingContext.get().getModEventBus().register(MItems.class); + FMLJavaModLoadingContext.get().getModEventBus().register(MBlocks.class); + FMLJavaModLoadingContext.get().getModEventBus().register(MBlockEntities.class); + FMLJavaModLoadingContext.get().getModEventBus().register(MMenus.class); + FMLJavaModLoadingContext.get().getModEventBus().register(AndroidFeatures.class); + FMLJavaModLoadingContext.get().getModEventBus().register(AndroidResearch.class); + FMLJavaModLoadingContext.get().getModEventBus().register(MStats.class); + FMLJavaModLoadingContext.get().getModEventBus().register(MRecipes.class); MinecraftForge.EVENT_BUS.register(DrivePool.INSTANCE); MinecraftForge.EVENT_BUS.register(ItemPortableCondensationDrive.Companion); diff --git a/src/main/java/ru/dbotthepony/mc/otm/Registry.java b/src/main/java/ru/dbotthepony/mc/otm/Registry.java deleted file mode 100644 index d9dbec09a..000000000 --- a/src/main/java/ru/dbotthepony/mc/otm/Registry.java +++ /dev/null @@ -1,1426 +0,0 @@ -package ru.dbotthepony.mc.otm; - -import net.minecraft.ChatFormatting; -import net.minecraft.client.gui.screens.MenuScreens; -import net.minecraft.client.renderer.ItemBlockRenderTypes; -import net.minecraft.client.renderer.RenderType; -import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; -import net.minecraft.network.chat.Component; -import net.minecraft.network.chat.TextComponent; -import net.minecraft.network.chat.TranslatableComponent; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.stats.StatFormatter; -import net.minecraft.tags.BlockTags; -import net.minecraft.tags.ItemTags; -import net.minecraft.util.valueproviders.UniformInt; -import net.minecraft.world.damagesource.DamageSource; -import net.minecraft.world.entity.EquipmentSlot; -import net.minecraft.world.food.FoodProperties; -import net.minecraft.world.inventory.MenuType; -import net.minecraft.world.item.*; -import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.item.crafting.Recipe; -import net.minecraft.world.item.crafting.RecipeSerializer; -import net.minecraft.world.item.crafting.RecipeType; -import net.minecraft.world.level.Level; -import net.minecraft.world.level.block.*; -import net.minecraft.world.level.block.entity.BlockEntityType; -import net.minecraft.world.level.block.state.BlockBehaviour; -import net.minecraft.world.level.material.Material; -import net.minecraft.world.level.material.MaterialColor; -import net.minecraftforge.common.ForgeTier; -import net.minecraftforge.event.RegistryEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; -import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; -import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; -import net.minecraftforge.registries.ForgeRegistry; -import net.minecraftforge.registries.RegistryBuilder; -import org.jetbrains.annotations.Nullable; -import ru.dbotthepony.mc.otm.android.AndroidFeature; -import ru.dbotthepony.mc.otm.android.AndroidResearchBuilder; -import ru.dbotthepony.mc.otm.android.AndroidResearchType; -import ru.dbotthepony.mc.otm.android.feature.AndroidExtendedReach; -import ru.dbotthepony.mc.otm.android.feature.AndroidLimbOverclocking; -import ru.dbotthepony.mc.otm.android.feature.AndroidNanobotsArmor; -import ru.dbotthepony.mc.otm.android.feature.AndroidNanobotsRegeneration; -import ru.dbotthepony.mc.otm.block.*; -import ru.dbotthepony.mc.otm.block.entity.*; -import ru.dbotthepony.mc.otm.android.AndroidFeatureType; -import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole; -import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityExplosionDebugger; -import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntitySphereDebugger; -import ru.dbotthepony.mc.otm.client.render.BlackHoleRenderer; -import ru.dbotthepony.mc.otm.client.render.EnergyCounterRenderer; -import ru.dbotthepony.mc.otm.client.render.GravitationStabilizerRenderer; -import ru.dbotthepony.mc.otm.client.render.SkinElement; -import ru.dbotthepony.mc.otm.core.ImpreciseFraction; -import ru.dbotthepony.mc.otm.item.*; -import ru.dbotthepony.mc.otm.menu.*; -import ru.dbotthepony.mc.otm.client.screen.*; -import ru.dbotthepony.mc.otm.recipe.PlatePressRecipe; -import ru.dbotthepony.mc.otm.recipe.PlatePressRecipeFactory; - -import net.minecraftforge.common.Tags.IOptionalNamedTag; - -import javax.annotation.Nonnull; -import java.util.ConcurrentModificationException; -import java.util.List; -import java.util.Set; - -public class Registry { - static { - if (OverdriveThatMatters.CREATIVE_TAB == null) { - throw new ConcurrentModificationException("Accessing Registry before OverdriveThatMatters class is initialized. This is not supported! If no other mods are installed this is a bug."); - } - } - - public static final DamageSource DAMAGE_BECOME_ANDROID = new DamageSource("otm_become_android"); - public static final DamageSource DAMAGE_BECOME_HUMANE = new DamageSource("otm_become_humane"); - public static final DamageSource DAMAGE_EVENT_HORIZON = new DamageSource("otm_event_horizon"); - public static final DamageSource DAMAGE_HAWKING_RADIATION = new DamageSource("otm_hawking_radiation"); - - static { - DAMAGE_BECOME_ANDROID.bypassArmor().bypassInvul().bypassMagic(); - DAMAGE_BECOME_HUMANE.bypassArmor().bypassInvul().bypassMagic(); - DAMAGE_EVENT_HORIZON.bypassMagic().bypassArmor(); - // DAMAGE_HAWKING_RADIATION.bypassMagic().bypassArmor(); - } - - public static final ForgeRegistry> ANDROID_FEATURES; - public static final ForgeRegistry> ANDROID_RESEARCH; - - static { - var builder = new RegistryBuilder>(); - builder.setName(new ResourceLocation(OverdriveThatMatters.MOD_ID, "android_features")); - - // make it shut up - builder.setType(c(AndroidFeatureType.class)); - ANDROID_FEATURES = (ForgeRegistry>) builder.create(); - - var builder2 = new RegistryBuilder>(); - builder2.setName(new ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research")); - - // make it shut up - builder2.setType(c(AndroidResearchType.class)); - ANDROID_RESEARCH = (ForgeRegistry>) builder2.create(); - } - - public static void dummy() {} - - @SuppressWarnings("unchecked") - private static Class c(Class cls) { return (Class) cls; } - - record CrateProps(MaterialColor color, ResourceLocation name) { - public CrateProps(MaterialColor color, String name) { - this(color, new ResourceLocation(OverdriveThatMatters.MOD_ID, "crate_" + name)); - } - } - - public static final CrateProps[] CRATES = new CrateProps[] { - new CrateProps(MaterialColor.COLOR_RED, "red"), - new CrateProps(MaterialColor.COLOR_BLUE, "blue"), - new CrateProps(MaterialColor.COLOR_YELLOW, "yellow"), - new CrateProps(MaterialColor.COLOR_GREEN, "green"), - new CrateProps(MaterialColor.COLOR_BLACK, "black"), - new CrateProps(MaterialColor.COLOR_PINK, "pink"), - new CrateProps(MaterialColor.COLOR_PURPLE, "purple"), - }; - - public record IndustrialGlassProps(@Nullable DyeColor color, ResourceLocation name, ResourceLocation namePane, Block block, Block pane, BlockItem item, BlockItem paneItem) { - public IndustrialGlassProps(@Nullable DyeColor color, ResourceLocation name, ResourceLocation namePane, Block block, Block pane, BlockItem item, BlockItem paneItem) { - this.color = color; - this.name = name; - this.namePane = namePane; - this.block = block; - this.pane = pane; - this.item = item; - this.paneItem = paneItem; - - this.block.setRegistryName(this.name); - this.pane.setRegistryName(this.namePane); - this.item.setRegistryName(this.name); - this.paneItem.setRegistryName(this.namePane); - } - - IndustrialGlassProps(@Nullable DyeColor color, ResourceLocation name, ResourceLocation namePane, Block block, Block pane) { - this(color, name, namePane, block, pane, - new BlockItem(block, new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB).stacksTo(64)), - new BlockItem(pane, new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB).stacksTo(64))); - } - - IndustrialGlassProps(@Nullable DyeColor color, ResourceLocation name, ResourceLocation namePane) { - this(color, name, namePane, - glass(color, BlockBehaviour.Properties.of(Material.GLASS, color != null ? color.getMaterialColor() : MaterialColor.NONE) - .strength(1.5F, 5.0F) - .requiresCorrectToolForDrops() - .sound(SoundType.GLASS) - .noOcclusion() - .isValidSpawn((_a, _b, _c, _d) -> false) - .isRedstoneConductor((_a, _b, _c) -> false) - .isSuffocating((_a, _b, _c) -> false) - .isViewBlocking((_a, _b, _c) -> false)), - pane(color, BlockBehaviour.Properties.of(Material.GLASS, color != null ? color.getMaterialColor() : MaterialColor.NONE) - .strength(1.25F, 5.0F) - .requiresCorrectToolForDrops() - .sound(SoundType.GLASS) - .noOcclusion()) - ); - } - - private static Block glass(@Nullable DyeColor color, BlockBehaviour.Properties props) { - if (color == null) { - return new GlassBlock(props); - } - - return new StainedGlassBlock(color, props); - } - - private static Block pane(@Nullable DyeColor color, BlockBehaviour.Properties props) { - if (color == null) { - return new IronBarsBlock(props); - } - - return new StainedGlassPaneBlock(color, props); - } - - IndustrialGlassProps(@Nullable DyeColor color) { - this(color, - new ResourceLocation(OverdriveThatMatters.MOD_ID, color != null ? "industrial_glass_" + color.getName() : "industrial_glass"), - new ResourceLocation(OverdriveThatMatters.MOD_ID, color != null ? "industrial_glass_pane_" + color.getName() : "industrial_glass_pane") - ); - } - } - - public static final IndustrialGlassProps INDUSTRIAL_GLASS = new IndustrialGlassProps(null); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_WHITE = new IndustrialGlassProps(DyeColor.WHITE); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_ORANGE = new IndustrialGlassProps(DyeColor.ORANGE); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_MAGENTA = new IndustrialGlassProps(DyeColor.MAGENTA); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_LIGHT_BLUE = new IndustrialGlassProps(DyeColor.LIGHT_BLUE); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_YELLOW = new IndustrialGlassProps(DyeColor.YELLOW); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_LIME = new IndustrialGlassProps(DyeColor.LIME); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_PINK = new IndustrialGlassProps(DyeColor.PINK); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_GRAY = new IndustrialGlassProps(DyeColor.GRAY); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_LIGHT_GRAY = new IndustrialGlassProps(DyeColor.LIGHT_GRAY); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_CYAN = new IndustrialGlassProps(DyeColor.CYAN); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_PURPLE = new IndustrialGlassProps(DyeColor.PURPLE); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_BLUE = new IndustrialGlassProps(DyeColor.BLUE); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_BROWN = new IndustrialGlassProps(DyeColor.BROWN); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_GREEN = new IndustrialGlassProps(DyeColor.GREEN); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_RED = new IndustrialGlassProps(DyeColor.RED); - public static final IndustrialGlassProps INDUSTRIAL_GLASS_BLACK = new IndustrialGlassProps(DyeColor.BLACK); - - public static final IndustrialGlassProps[] INDUSTRIAL_GLASS_LIST = new IndustrialGlassProps[] { - INDUSTRIAL_GLASS, - INDUSTRIAL_GLASS_WHITE, - INDUSTRIAL_GLASS_ORANGE, - INDUSTRIAL_GLASS_MAGENTA, - INDUSTRIAL_GLASS_LIGHT_BLUE, - INDUSTRIAL_GLASS_YELLOW, - INDUSTRIAL_GLASS_LIME, - INDUSTRIAL_GLASS_PINK, - INDUSTRIAL_GLASS_GRAY, - INDUSTRIAL_GLASS_LIGHT_GRAY, - INDUSTRIAL_GLASS_CYAN, - INDUSTRIAL_GLASS_PURPLE, - INDUSTRIAL_GLASS_BLUE, - INDUSTRIAL_GLASS_BROWN, - INDUSTRIAL_GLASS_GREEN, - INDUSTRIAL_GLASS_RED, - INDUSTRIAL_GLASS_BLACK, - }; - - public static class Names { - private static ResourceLocation loc(String path) { - return new ResourceLocation(OverdriveThatMatters.MOD_ID, path); - } - - // blocks - public static final ResourceLocation ANDROID_STATION = loc("android_station"); // без рецепта - public static final ResourceLocation BATTERY_BANK = loc("battery_bank"); // нужен рецепт - public static final ResourceLocation MATTER_DECOMPOSER = loc("matter_decomposer"); // есть рецепт - public static final ResourceLocation MATTER_CAPACITOR_BANK = loc("matter_capacitor_bank"); // есть рецепт - public static final ResourceLocation MATTER_CABLE = loc("matter_cable"); // есть рецепт - public static final ResourceLocation PATTERN_STORAGE = loc("pattern_storage"); // есть рецепт - public static final ResourceLocation MATTER_SCANNER = loc("matter_scanner"); // есть рецепт - public static final ResourceLocation MATTER_PANEL = loc("matter_panel"); // есть рецепт - public static final ResourceLocation MATTER_REPLICATOR = loc("matter_replicator"); // есть рецепт - public static final ResourceLocation MATTER_BOTTLER = loc("matter_bottler"); // есть рецепт - public static final ResourceLocation DRIVE_VIEWER = loc("drive_viewer"); // есть рецепт - public static final ResourceLocation DRIVE_RACK = loc("drive_rack"); // нужен рецепт (после улучшений) - public static final ResourceLocation ITEM_MONITOR = loc("item_monitor"); // нужен рецепт (после улучшений) - public static final ResourceLocation ENERGY_COUNTER = loc("energy_counter"); // есть рецепт - public static final ResourceLocation CHEMICAL_GENERATOR = loc("chemical_generator"); // есть рецепт - public static final ResourceLocation PLATE_PRESS = loc("plate_press"); // есть рецепт - public static final ResourceLocation MATTER_RECYCLER = loc("matter_recycler"); // нужен рецепт - - public static final ResourceLocation DEBUG_EXPLOSION_SMALL = loc("debug_explosion_small"); - public static final ResourceLocation DEBUG_SPHERE_POINTS = loc("debug_sphere_points"); - - public static final ResourceLocation BLACK_HOLE = loc("black_hole"); - public static final ResourceLocation GRAVITATION_STABILIZER = loc("gravitation_stabilizer"); // нужен рецепт - public static final ResourceLocation GRAVITATION_STABILIZER_LENS = loc("gravitation_stabilizer_lens"); - public static final ResourceLocation CARGO_CRATE = loc("cargo_crate"); // нужен рецепт? - - // building blocks - public static final ResourceLocation TRITANIUM_BLOCK = loc("tritanium_block"); - public static final ResourceLocation TRITANIUM_STRIPED_BLOCK = loc("tritanium_striped_block"); - - public static final ResourceLocation CARBON_FIBRE_BLOCK = loc("carbon_fibre_block"); - - // capabilities - public static final ResourceLocation ANDROID_CAPABILITY = loc("android_capability"); - - // items - public static final ResourceLocation GRAVITATIONAL_DISRUPTOR = loc("gravitational_disruptor"); - public static final ResourceLocation MATTER_DUST = loc("matter_dust"); - - public static final ResourceLocation PILL_ANDROID = loc("pill_android"); - public static final ResourceLocation PILL_HUMANE = loc("pill_humane"); - public static final ResourceLocation PILL_OBLIVION = loc("pill_oblivion"); - public static final ResourceLocation PILL_HEAL = loc("pill_heal"); - - public static final ResourceLocation BATTERY_CRUDE = loc("battery_crude"); - public static final ResourceLocation BATTERY_BASIC = loc("battery_basic"); - public static final ResourceLocation BATTERY_NORMAL = loc("battery_normal"); - public static final ResourceLocation BATTERY_DENSE = loc("battery_dense"); - public static final ResourceLocation BATTERY_CAPACITOR = loc("battery_capacitor"); - public static final ResourceLocation BATTERY_CREATIVE = loc("battery_creative"); - - public static final ResourceLocation MATTER_CAPACITOR_PARTS = loc("matter_capacitor_parts"); - public static final ResourceLocation MATTER_CAPACITOR_BASIC = loc("matter_capacitor_basic"); - public static final ResourceLocation MATTER_CAPACITOR_NORMAL = loc("matter_capacitor_normal"); - public static final ResourceLocation MATTER_CAPACITOR_DENSE = loc("matter_capacitor_dense"); - public static final ResourceLocation MATTER_CAPACITOR_CREATIVE = loc("matter_capacitor_creative"); - - public static final ResourceLocation PATTERN_DRIVE_NORMAL = loc("pattern_drive_normal"); - public static final ResourceLocation PATTERN_DRIVE_CREATIVE = loc("pattern_drive_creative"); - - public static final ResourceLocation NUTRIENT_PASTE = loc("nutrient_paste"); - - public static final ResourceLocation PORTABLE_CONDENSATION_DRIVE = loc("portable_condensation_drive"); - public static final ResourceLocation PORTABLE_DENSE_CONDENSATION_DRIVE = loc("portable_dense_condensation_drive"); - - public static final ResourceLocation BLACK_HOLE_SCANNER = loc("black_hole_scanner"); - public static final ResourceLocation GRAVITATION_FIELD_LIMITER = loc("gravitation_field_limiter"); - public static final ResourceLocation GRAVITATION_FIELD_SENSOR = loc("graivtation_field_sensor"); - public static final ResourceLocation PORTABLE_GRAVITATION_STABILIZER = loc("portable_gravitation_stabilizer"); - - // armor - public static final ResourceLocation TRITANIUM_HELMET = loc("tritanium_helmet"); - public static final ResourceLocation TRITANIUM_CHESTPLATE = loc("tritanium_chestplate"); - public static final ResourceLocation TRITANIUM_PANTS = loc("tritanium_pants"); - public static final ResourceLocation TRITANIUM_BOOTS = loc("tritanium_boots"); - - // tools - public static final ResourceLocation TRITANIUM_SWORD = loc("tritanium_sword"); - public static final ResourceLocation TRITANIUM_AXE = loc("tritanium_axe"); - public static final ResourceLocation TRITANIUM_PICKAXE = loc("tritanium_pickaxe"); - public static final ResourceLocation TRITANIUM_SHOVEL = loc("tritanium_shovel"); - public static final ResourceLocation TRITANIUM_HOE = loc("tritanium_hoe"); - - // items: crafting components - public static final ResourceLocation TRITANIUM_INGOT = loc("tritanium_ingot"); - - public static final ResourceLocation MATTER_IO_PORT = loc("matter_io_port"); - public static final ResourceLocation MATTER_TRANSFORM_MATRIX = loc("matter_transform_matrix"); - - public static final ResourceLocation ENERGY_BUS = loc("energy_bus"); - public static final ResourceLocation ELECTRIC_PARTS = loc("electric_parts"); - - public static final ResourceLocation MACHINE_FRAME = loc("machine_frame"); - public static final ResourceLocation TRITANIUM_PLATE = loc("tritanium_plate"); - public static final ResourceLocation IRON_PLATE = loc("iron_plate"); - public static final ResourceLocation COPPER_WIRING = loc("copper_wiring"); - public static final ResourceLocation GOLD_WIRING = loc("gold_wiring"); - - public static final ResourceLocation PORTABLE_CONDENSATION_DRIVE_CASING = loc("portable_condensation_drive_casing"); - public static final ResourceLocation PORTABLE_DENSE_CONDENSATION_DRIVE_CASING = loc("portable_dense_condensation_drive_casing"); - - public static final ResourceLocation CIRCUIT_PLATING = loc("circuit_plating"); - public static final ResourceLocation BASIC_CONTROL_CIRCUIT = loc("basic_control_circuit"); - public static final ResourceLocation ADVANCED_CONTROL_CIRCUIT = loc("advanced_control_circuit"); - - public static final ResourceLocation TRITANIUM_ORE = loc("tritanium_ore"); - public static final ResourceLocation DEEPSLATE_TRITANIUM_ORE = loc("deepslate_tritanium_ore"); - public static final ResourceLocation TRITANIUM_RAW_BLOCK = loc("tritanium_raw_block"); - public static final ResourceLocation TRITANIUM_ORE_CLUMP = loc("tritanium_ore_clump"); - - // android features and research - public static final ResourceLocation AIR_BAGS = loc("air_bags"); - - public static final ResourceLocation LIMB_OVERCLOCKING = loc("limb_overclocking"); - public static final ResourceLocation LIMB_OVERCLOCKING_1 = loc("limb_overclocking_1"); - public static final ResourceLocation LIMB_OVERCLOCKING_2 = loc("limb_overclocking_2"); - public static final ResourceLocation LIMB_OVERCLOCKING_3 = loc("limb_overclocking_3"); - public static final ResourceLocation LIMB_OVERCLOCKING_4 = loc("limb_overclocking_4"); - - public static final ResourceLocation[] LIMB_OVERCLOCKING_LIST = new ResourceLocation[] { LIMB_OVERCLOCKING_1, LIMB_OVERCLOCKING_2, LIMB_OVERCLOCKING_3, LIMB_OVERCLOCKING_4 }; - - public static final ResourceLocation NANOBOTS = loc("nanobots"); - public static final ResourceLocation NANOBOTS_REGENERATION = loc("nanobots_regeneration"); - public static final ResourceLocation NANOBOTS_REGENERATION_1 = loc("nanobots_regeneration_1"); - public static final ResourceLocation NANOBOTS_REGENERATION_2 = loc("nanobots_regeneration_2"); - public static final ResourceLocation NANOBOTS_REGENERATION_3 = loc("nanobots_regeneration_3"); - public static final ResourceLocation NANOBOTS_REGENERATION_4 = loc("nanobots_regeneration_4"); - - public static final ResourceLocation[] NANOBOTS_REGENERATION_LIST = new ResourceLocation[] { NANOBOTS_REGENERATION_1, NANOBOTS_REGENERATION_2, NANOBOTS_REGENERATION_3, NANOBOTS_REGENERATION_4 }; - - public static final ResourceLocation NANOBOTS_ARMOR = loc("nanobots_armor"); - - public static final ResourceLocation NANOBOTS_ARMOR_STRENGTH_1 = loc("nanobots_armor_strength_1"); - public static final ResourceLocation NANOBOTS_ARMOR_STRENGTH_2 = loc("nanobots_armor_strength_2"); - public static final ResourceLocation NANOBOTS_ARMOR_STRENGTH_3 = loc("nanobots_armor_strength_3"); - public static final ResourceLocation[] NANOBOTS_ARMOR_STRENGTH_LIST = new ResourceLocation[] { - NANOBOTS_ARMOR_STRENGTH_1, - NANOBOTS_ARMOR_STRENGTH_2, - NANOBOTS_ARMOR_STRENGTH_3, - }; - - public static final ResourceLocation NANOBOTS_ARMOR_SPEED_1 = loc("nanobots_armor_speed_1"); - public static final ResourceLocation NANOBOTS_ARMOR_SPEED_2 = loc("nanobots_armor_speed_2"); - public static final ResourceLocation NANOBOTS_ARMOR_SPEED_3 = loc("nanobots_armor_speed_3"); - public static final ResourceLocation[] NANOBOTS_ARMOR_SPEED_LIST = new ResourceLocation[] { - NANOBOTS_ARMOR_SPEED_1, - NANOBOTS_ARMOR_SPEED_2, - NANOBOTS_ARMOR_SPEED_3, - }; - - public static final ResourceLocation HYDRAULICS_OVERLOAD = loc("hydraulics_overload"); - public static final ResourceLocation HYDRAULICS_OVERLOAD_1 = loc("hydraulics_overload_1"); - public static final ResourceLocation HYDRAULICS_OVERLOAD_2 = loc("hydraulics_overload_2"); - public static final ResourceLocation HYDRAULICS_OVERLOAD_3 = loc("hydraulics_overload_3"); - - public static final ResourceLocation EXTENDED_REACH = loc("extended_reach"); - - // stats - public static final ResourceLocation DAMAGE_ABSORBED = loc("damage_absorbed"); - public static final ResourceLocation HEALTH_REGENERATED = loc("health_regenerated"); - public static final ResourceLocation POWER_CONSUMED = loc("power_consumed"); - } - - public static class Blocks { - public static final BlockAndroidStation ANDROID_STATION = new BlockAndroidStation(); - public static final BlockBatteryBank BATTERY_BANK = new BlockBatteryBank(); - public static final BlockMatterDecomposer MATTER_DECOMPOSER = new BlockMatterDecomposer(); - public static final BlockMatterCapacitorBank MATTER_CAPACITOR_BANK = new BlockMatterCapacitorBank(); - public static final BlockMatterCable MATTER_CABLE = new BlockMatterCable(); - public static final BlockPatternStorage PATTERN_STORAGE = new BlockPatternStorage(); - public static final BlockMatterScanner MATTER_SCANNER = new BlockMatterScanner(); - public static final BlockMatterPanel MATTER_PANEL = new BlockMatterPanel(); - public static final BlockMatterReplicator MATTER_REPLICATOR = new BlockMatterReplicator(); - public static final BlockMatterBottler MATTER_BOTTLER = new BlockMatterBottler(); - public static final BlockDriveViewer DRIVE_VIEWER = new BlockDriveViewer(); - public static final BlockCargoCrate CARGO_CRATE = new BlockCargoCrate(); - public static final BlockDriveRack DRIVE_RACK = new BlockDriveRack(); - public static final BlockItemMonitor ITEM_MONITOR = new BlockItemMonitor(); - public static final BlockEnergyCounter ENERGY_COUNTER = new BlockEnergyCounter(); - public static final BlockChemicalGenerator CHEMICAL_GENERATOR = new BlockChemicalGenerator(); - public static final BlockPlatePress PLATE_PRESS = new BlockPlatePress(); - public static final BlockMatterRecycler MATTER_RECYCLER = new BlockMatterRecycler(); - - public static final BlockExplosionDebugger DEBUG_EXPLOSION_SMALL = new BlockExplosionDebugger(); - public static final BlockSphereDebugger DEBUG_SPHERE_POINTS = new BlockSphereDebugger(); - - public static final BlockBlackHole BLACK_HOLE = new BlockBlackHole(); - public static final BlockGravitationStabilizer GRAVITATION_STABILIZER = new BlockGravitationStabilizer(); - public static final BlockGravitationStabilizerLens GRAVITATION_STABILIZER_LENS = new BlockGravitationStabilizerLens(); - - public static final Block TRITANIUM_ORE = new OreBlock( - BlockBehaviour.Properties.of(Material.STONE) - .strength(3.25F, 6.0F) - .requiresCorrectToolForDrops(), - UniformInt.of(0, 3) - ); - - public static final Block DEEPSLATE_TRITANIUM_ORE = new OreBlock( - BlockBehaviour.Properties.of(Material.STONE) - .strength(4.75F, 6.5F) - .requiresCorrectToolForDrops(), - UniformInt.of(0, 3) - ); - - public static final Block TRITANIUM_RAW_BLOCK = new Block( - BlockBehaviour.Properties.of(Material.STONE) - .strength(8.0F, 10F) - .requiresCorrectToolForDrops() - ); - - public static final Block[] CRATES = new Block[Registry.CRATES.length]; - - public static final Block TRITANIUM_BLOCK = new Block( - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) - .sound(SoundType.BASALT) - .requiresCorrectToolForDrops() - .explosionResistance(80) - .strength(4) - ); - - public static final Block TRITANIUM_STRIPED_BLOCK = new Block( - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) - .sound(SoundType.BASALT) - .requiresCorrectToolForDrops() - .explosionResistance(80) - .strength(4) - ); - - public static final Block CARBON_FIBRE_BLOCK = new Block( - BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) - .sound(SoundType.BASALT) - .requiresCorrectToolForDrops() - .explosionResistance(40) - .strength(3) - ); - - static { - for (int i = 0; i < Registry.CRATES.length; i++) { - CRATES[i] = new Block(BlockBehaviour.Properties.of(Material.METAL, Registry.CRATES[i].color) - .sound(SoundType.METAL) - .requiresCorrectToolForDrops() - .strength(5.0F, 6.0F)); - - CRATES[i].setRegistryName(Registry.CRATES[i].name); - } - - TRITANIUM_ORE.setRegistryName(Names.TRITANIUM_ORE); - DEEPSLATE_TRITANIUM_ORE.setRegistryName(Names.DEEPSLATE_TRITANIUM_ORE); - TRITANIUM_RAW_BLOCK.setRegistryName(Names.TRITANIUM_RAW_BLOCK); - ANDROID_STATION.setRegistryName(Names.ANDROID_STATION); - BATTERY_BANK.setRegistryName(Names.BATTERY_BANK); - MATTER_DECOMPOSER.setRegistryName(Names.MATTER_DECOMPOSER); - MATTER_CAPACITOR_BANK.setRegistryName(Names.MATTER_CAPACITOR_BANK); - MATTER_CABLE.setRegistryName(Names.MATTER_CABLE); - PATTERN_STORAGE.setRegistryName(Names.PATTERN_STORAGE); - MATTER_SCANNER.setRegistryName(Names.MATTER_SCANNER); - MATTER_PANEL.setRegistryName(Names.MATTER_PANEL); - MATTER_REPLICATOR.setRegistryName(Names.MATTER_REPLICATOR); - MATTER_BOTTLER.setRegistryName(Names.MATTER_BOTTLER); - DRIVE_VIEWER.setRegistryName(Names.DRIVE_VIEWER); - BLACK_HOLE.setRegistryName(Names.BLACK_HOLE); - CARGO_CRATE.setRegistryName(Names.CARGO_CRATE); - DRIVE_RACK.setRegistryName(Names.DRIVE_RACK); - ITEM_MONITOR.setRegistryName(Names.ITEM_MONITOR); - ENERGY_COUNTER.setRegistryName(Names.ENERGY_COUNTER); - CHEMICAL_GENERATOR.setRegistryName(Names.CHEMICAL_GENERATOR); - PLATE_PRESS.setRegistryName(Names.PLATE_PRESS); - MATTER_RECYCLER.setRegistryName(Names.MATTER_RECYCLER); - - GRAVITATION_STABILIZER.setRegistryName(Names.GRAVITATION_STABILIZER); - GRAVITATION_STABILIZER_LENS.setRegistryName(Names.GRAVITATION_STABILIZER_LENS); - - DEBUG_EXPLOSION_SMALL.setRegistryName(Names.DEBUG_EXPLOSION_SMALL); - DEBUG_SPHERE_POINTS.setRegistryName(Names.DEBUG_SPHERE_POINTS); - - TRITANIUM_BLOCK.setRegistryName(Names.TRITANIUM_BLOCK); - TRITANIUM_STRIPED_BLOCK.setRegistryName(Names.TRITANIUM_STRIPED_BLOCK); - CARBON_FIBRE_BLOCK.setRegistryName(Names.CARBON_FIBRE_BLOCK); - } - - @SubscribeEvent - @SuppressWarnings("unused") - public static void register(final RegistryEvent.Register event) { - event.getRegistry().register(ANDROID_STATION); - event.getRegistry().register(BATTERY_BANK); - event.getRegistry().register(MATTER_DECOMPOSER); - event.getRegistry().register(MATTER_CAPACITOR_BANK); - event.getRegistry().register(MATTER_CABLE); - event.getRegistry().register(PATTERN_STORAGE); - event.getRegistry().register(MATTER_SCANNER); - event.getRegistry().register(MATTER_PANEL); - event.getRegistry().register(MATTER_REPLICATOR); - event.getRegistry().register(MATTER_BOTTLER); - event.getRegistry().register(DRIVE_VIEWER); - event.getRegistry().register(TRITANIUM_BLOCK); - event.getRegistry().register(TRITANIUM_STRIPED_BLOCK); - event.getRegistry().register(CARBON_FIBRE_BLOCK); - event.getRegistry().register(BLACK_HOLE); - event.getRegistry().register(CARGO_CRATE); - event.getRegistry().register(TRITANIUM_ORE); - event.getRegistry().register(DEEPSLATE_TRITANIUM_ORE); - event.getRegistry().register(TRITANIUM_RAW_BLOCK); - event.getRegistry().register(DRIVE_RACK); - event.getRegistry().register(ITEM_MONITOR); - event.getRegistry().register(ENERGY_COUNTER); - event.getRegistry().register(CHEMICAL_GENERATOR); - event.getRegistry().register(PLATE_PRESS); - event.getRegistry().register(GRAVITATION_STABILIZER); - event.getRegistry().register(GRAVITATION_STABILIZER_LENS); - event.getRegistry().register(MATTER_RECYCLER); - - event.getRegistry().register(DEBUG_EXPLOSION_SMALL); - event.getRegistry().register(DEBUG_SPHERE_POINTS); - - for (var crate : CRATES) { - event.getRegistry().register(crate); - } - - for (var glass : INDUSTRIAL_GLASS_LIST) { - event.getRegistry().register(glass.block); - event.getRegistry().register(glass.pane); - } - - // OverdriveThatMatters.LOGGER.info("Registered blocks"); - } - - @SubscribeEvent - @SuppressWarnings("unused") - public static void registerClient(final FMLClientSetupEvent event) { - final var translucent = RenderType.translucent(); - - for (var glass : INDUSTRIAL_GLASS_LIST) { - ItemBlockRenderTypes.setRenderLayer(glass.block, translucent); - ItemBlockRenderTypes.setRenderLayer(glass.pane, translucent); - } - } - } - - public static class Items { - public static final BlockItem ANDROID_STATION = new BlockItem(Blocks.ANDROID_STATION, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem BATTERY_BANK = new BlockItem(Blocks.BATTERY_BANK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem MATTER_DECOMPOSER = new BlockItem(Blocks.MATTER_DECOMPOSER, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem MATTER_CAPACITOR_BANK = new BlockItem(Blocks.MATTER_CAPACITOR_BANK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem MATTER_CABLE = new BlockItem(Blocks.MATTER_CABLE, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem PATTERN_STORAGE = new BlockItem(Blocks.PATTERN_STORAGE, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem MATTER_SCANNER = new BlockItem(Blocks.MATTER_SCANNER, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem MATTER_PANEL = new BlockItem(Blocks.MATTER_PANEL, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem MATTER_REPLICATOR = new BlockItem(Blocks.MATTER_REPLICATOR, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem MATTER_BOTTLER = new BlockItem(Blocks.MATTER_BOTTLER, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem DRIVE_VIEWER = new BlockItem(Blocks.DRIVE_VIEWER, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem CARGO_CRATE = new BlockItem(Blocks.CARGO_CRATE, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem TRITANIUM_ORE = new BlockItem(Blocks.TRITANIUM_ORE, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem DEEPSLATE_TRITANIUM_ORE = new BlockItem(Blocks.DEEPSLATE_TRITANIUM_ORE, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem TRITANIUM_RAW_BLOCK = new BlockItem(Blocks.TRITANIUM_RAW_BLOCK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem DRIVE_RACK = new BlockItem(Blocks.DRIVE_RACK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem ITEM_MONITOR = new BlockItem(Blocks.ITEM_MONITOR, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem ENERGY_COUNTER = new BlockItem(Blocks.ENERGY_COUNTER, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem CHEMICAL_GENERATOR = new BlockItem(Blocks.CHEMICAL_GENERATOR, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem PLATE_PRESS = new BlockItem(Blocks.PLATE_PRESS, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem MATTER_RECYCLER = new BlockItem(Blocks.MATTER_RECYCLER, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem GRAVITATION_STABILIZER = new BlockItem(Blocks.GRAVITATION_STABILIZER, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)) { - @Override - public void appendHoverText(@Nonnull ItemStack p_40572_, @Nullable Level p_40573_, @Nonnull List p_40574_, @Nonnull TooltipFlag p_40575_) { - super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_); - - p_40574_.add(new TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer.desc").withStyle(ChatFormatting.GRAY)); - p_40574_.add(new TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer.desc2").withStyle(ChatFormatting.DARK_GRAY)); - p_40574_.add(new TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer.desc3").withStyle(ChatFormatting.DARK_GRAY)); - p_40574_.add(new TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer.desc4").withStyle(ChatFormatting.DARK_GRAY)); - } - }; - - public static final BlockItem DEBUG_EXPLOSION_SMALL = new BlockItem(Blocks.DEBUG_EXPLOSION_SMALL, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final BlockItem DEBUG_SPHERE_POINTS = new BlockItem(Blocks.DEBUG_SPHERE_POINTS, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - - public static final ItemMatterDust MATTER_DUST = new ItemMatterDust(); - - public static final Item TRITANIUM_ORE_CLUMP = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item TRITANIUM_INGOT = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - - public static final ForgeTier TRITANIUM_COMPONENT; - - static { - final var component = Ingredient.of(TRITANIUM_INGOT); - - TRITANIUM_COMPONENT = new ForgeTier( - Tiers.IRON.getLevel(), - 3072, - Tiers.IRON.getSpeed() * 1.1f, - 3.5f, - 16, - BlockTags.NEEDS_IRON_TOOL, - () -> component - ); - } - - public static final SwordItem TRITANIUM_SWORD = new SwordItem(TRITANIUM_COMPONENT, 4, -2.7f, new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final ShovelItem TRITANIUM_SHOVEL = new ShovelItem(TRITANIUM_COMPONENT, 1.5f, -2.4f, new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final AxeItem TRITANIUM_AXE = new AxeItem(TRITANIUM_COMPONENT, 8.5f, -3.4f, new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final PickaxeItem TRITANIUM_PICKAXE = new PickaxeItem(TRITANIUM_COMPONENT, 2, -2.8f, new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final HoeItem TRITANIUM_HOE = new HoeItem(TRITANIUM_COMPONENT, 0, -3.4f, new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB)); - - public static final Item[] TRITANIUM_TOOLS = new Item[] { - TRITANIUM_SWORD, - TRITANIUM_SHOVEL, - TRITANIUM_AXE, - TRITANIUM_PICKAXE, - TRITANIUM_HOE - }; - - public static final ItemTritaniumArmor TRITANIUM_HELMET = new ItemTritaniumArmor(EquipmentSlot.HEAD); - public static final ItemTritaniumArmor TRITANIUM_CHESTPLATE = new ItemTritaniumArmor(EquipmentSlot.CHEST); - public static final ItemTritaniumArmor TRITANIUM_PANTS = new ItemTritaniumArmor(EquipmentSlot.LEGS); - public static final ItemTritaniumArmor TRITANIUM_BOOTS = new ItemTritaniumArmor(EquipmentSlot.FEET); - - public static final Item[] TRITANIUM_ARMOR = new Item[] { - TRITANIUM_HELMET, - TRITANIUM_CHESTPLATE, - TRITANIUM_PANTS, - TRITANIUM_BOOTS - }; - - public static final Item MATTER_IO_PORT = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item MATTER_TRANSFORM_MATRIX = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item ENERGY_BUS = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item ELECTRIC_PARTS = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item MACHINE_FRAME = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item TRITANIUM_PLATE = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item IRON_PLATE = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item COPPER_WIRING = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item GOLD_WIRING = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item PORTABLE_CONDENSATION_DRIVE_CASING = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item PORTABLE_DENSE_CONDENSATION_DRIVE_CASING = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item CIRCUIT_PLATING = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item BASIC_CONTROL_CIRCUIT = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item ADVANCED_CONTROL_CIRCUIT = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - - public static final Item BLACK_HOLE_SCANNER = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)) { - @Override - public void appendHoverText(@Nonnull ItemStack p_40572_, @Nullable Level p_40573_, @Nonnull List p_40574_, @Nonnull TooltipFlag p_40575_) { - super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_); - - p_40574_.add(new TranslatableComponent("item.overdrive_that_matters.black_hole_scanner.desc").withStyle(ChatFormatting.GRAY)); - p_40574_.add(new TranslatableComponent("item.overdrive_that_matters.black_hole_scanner.desc2").withStyle(ChatFormatting.DARK_GRAY)); - } - }; - public static final Item GRAVITATION_FIELD_LIMITER = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item GRAVITATION_FIELD_SENSOR = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final ItemPortableGravitationStabilizer PORTABLE_GRAVITATION_STABILIZER = new ItemPortableGravitationStabilizer(); - - public static final BlockItem BLACK_HOLE = new BlockItem(Blocks.BLACK_HOLE, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - - public static final ItemGravitationalDisruptor GRAVITATIONAL_DISRUPTOR = new ItemGravitationalDisruptor(); - - public static final ItemPill PILL_ANDROID = new ItemPill(PillType.BECOME_ANDROID); - public static final ItemPill PILL_HUMANE = new ItemPill(PillType.BECOME_HUMANE); - public static final ItemPill PILL_OBLIVION = new ItemPill(PillType.OBLIVION); - public static final ItemPillHeal PILL_HEAL = new ItemPillHeal(); - - public static final ItemBattery BATTERY_CRUDE = new ItemBattery(new ImpreciseFraction(30_000), new ImpreciseFraction(150), new ImpreciseFraction(150)); - public static final ItemBattery BATTERY_BASIC = new ItemBattery(new ImpreciseFraction(60_000), new ImpreciseFraction(300), new ImpreciseFraction(300)); - public static final ItemBattery BATTERY_NORMAL = new ItemBattery(new ImpreciseFraction(250_000), new ImpreciseFraction(1000), new ImpreciseFraction(1000)); - public static final ItemBattery BATTERY_DENSE = new ItemBattery(new ImpreciseFraction(1_000_000), new ImpreciseFraction(2000), new ImpreciseFraction(2000)); - public static final ItemBattery BATTERY_CAPACITOR = new ItemBattery(new ImpreciseFraction(150_000), new ImpreciseFraction(15000), new ImpreciseFraction(15000)); - public static final ItemBattery BATTERY_CREATIVE = new ItemBattery(); - - public static final ItemBattery[] BATTERIES = { - BATTERY_CRUDE, - BATTERY_BASIC, - BATTERY_NORMAL, - BATTERY_DENSE, - BATTERY_CAPACITOR, - }; - - public static final Item MATTER_CAPACITOR_PARTS = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - - public static final Item[] DATAGEN_COMPONENTS = { - ENERGY_BUS, - ELECTRIC_PARTS, - TRITANIUM_PLATE, - IRON_PLATE, - COPPER_WIRING, - GOLD_WIRING, - CIRCUIT_PLATING, - BASIC_CONTROL_CIRCUIT, - ADVANCED_CONTROL_CIRCUIT, - MATTER_CAPACITOR_PARTS, - MATTER_IO_PORT, - MATTER_TRANSFORM_MATRIX, - }; - - public static final ItemMatterCapacitor MATTER_CAPACITOR_BASIC = new ItemMatterCapacitor(new ImpreciseFraction("4")); - public static final ItemMatterCapacitor MATTER_CAPACITOR_NORMAL = new ItemMatterCapacitor(new ImpreciseFraction("10")); - public static final ItemMatterCapacitor MATTER_CAPACITOR_DENSE = new ItemMatterCapacitor(new ImpreciseFraction("40")); - public static final ItemMatterCapacitor MATTER_CAPACITOR_CREATIVE = new ItemMatterCapacitor(); - - public static final ItemPatternStorage PATTERN_DRIVE_NORMAL = new ItemPatternStorage(4); - public static final ItemPatternStorage PATTERN_DRIVE_CREATIVE = new ItemPatternStorage(); - - public static final ItemPortableCondensationDrive PORTABLE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(4000); - public static final ItemPortableCondensationDrive PORTABLE_DENSE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(25000); - - public static final Item NUTRIENT_PASTE = new Item(new Item.Properties().stacksTo(64).food(new FoodProperties.Builder().meat().nutrition(8).saturationMod(0.9F).build()).tab(OverdriveThatMatters.CREATIVE_TAB)); - - public static final Item[] CRATES = new Item[Registry.CRATES.length]; - - public static final Item TRITANIUM_BLOCK = new BlockItem(Blocks.TRITANIUM_BLOCK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item TRITANIUM_STRIPED_BLOCK = new BlockItem(Blocks.TRITANIUM_STRIPED_BLOCK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - public static final Item CARBON_FIBRE_BLOCK = new BlockItem(Blocks.CARBON_FIBRE_BLOCK, new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - - static { - for (int i = 0; i < Registry.CRATES.length; i++) { - CRATES[i] = new BlockItem(Blocks.CRATES[i], new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); - CRATES[i].setRegistryName(Registry.CRATES[i].name); - } - - ANDROID_STATION.setRegistryName(Names.ANDROID_STATION); - BATTERY_BANK.setRegistryName(Names.BATTERY_BANK); - MATTER_DECOMPOSER.setRegistryName(Names.MATTER_DECOMPOSER); - MATTER_CAPACITOR_BANK.setRegistryName(Names.MATTER_CAPACITOR_BANK); - MATTER_CABLE.setRegistryName(Names.MATTER_CABLE); - PATTERN_STORAGE.setRegistryName(Names.PATTERN_STORAGE); - MATTER_SCANNER.setRegistryName(Names.MATTER_SCANNER); - MATTER_PANEL.setRegistryName(Names.MATTER_PANEL); - MATTER_REPLICATOR.setRegistryName(Names.MATTER_REPLICATOR); - MATTER_BOTTLER.setRegistryName(Names.MATTER_BOTTLER); - DRIVE_VIEWER.setRegistryName(Names.DRIVE_VIEWER); - BLACK_HOLE.setRegistryName(Names.BLACK_HOLE); - CARGO_CRATE.setRegistryName(Names.CARGO_CRATE); - DRIVE_RACK.setRegistryName(Names.DRIVE_RACK); - ITEM_MONITOR.setRegistryName(Names.ITEM_MONITOR); - ENERGY_COUNTER.setRegistryName(Names.ENERGY_COUNTER); - CHEMICAL_GENERATOR.setRegistryName(Names.CHEMICAL_GENERATOR); - PLATE_PRESS.setRegistryName(Names.PLATE_PRESS); - GRAVITATION_STABILIZER.setRegistryName(Names.GRAVITATION_STABILIZER); - MATTER_RECYCLER.setRegistryName(Names.MATTER_RECYCLER); - MATTER_DUST.setRegistryName(Names.MATTER_DUST); - - DEBUG_EXPLOSION_SMALL.setRegistryName(Names.DEBUG_EXPLOSION_SMALL); - DEBUG_SPHERE_POINTS.setRegistryName(Names.DEBUG_SPHERE_POINTS); - - TRITANIUM_ORE.setRegistryName(Names.TRITANIUM_ORE); - DEEPSLATE_TRITANIUM_ORE.setRegistryName(Names.DEEPSLATE_TRITANIUM_ORE); - TRITANIUM_RAW_BLOCK.setRegistryName(Names.TRITANIUM_RAW_BLOCK); - TRITANIUM_ORE_CLUMP.setRegistryName(Names.TRITANIUM_ORE_CLUMP); - TRITANIUM_INGOT.setRegistryName(Names.TRITANIUM_INGOT); - MATTER_IO_PORT.setRegistryName(Names.MATTER_IO_PORT); - MATTER_TRANSFORM_MATRIX.setRegistryName(Names.MATTER_TRANSFORM_MATRIX); - ENERGY_BUS.setRegistryName(Names.ENERGY_BUS); - ELECTRIC_PARTS.setRegistryName(Names.ELECTRIC_PARTS); - MACHINE_FRAME.setRegistryName(Names.MACHINE_FRAME); - TRITANIUM_PLATE.setRegistryName(Names.TRITANIUM_PLATE); - IRON_PLATE.setRegistryName(Names.IRON_PLATE); - COPPER_WIRING.setRegistryName(Names.COPPER_WIRING); - GOLD_WIRING.setRegistryName(Names.GOLD_WIRING); - PORTABLE_CONDENSATION_DRIVE_CASING.setRegistryName(Names.PORTABLE_CONDENSATION_DRIVE_CASING); - PORTABLE_DENSE_CONDENSATION_DRIVE_CASING.setRegistryName(Names.PORTABLE_DENSE_CONDENSATION_DRIVE_CASING); - CIRCUIT_PLATING.setRegistryName(Names.CIRCUIT_PLATING); - BASIC_CONTROL_CIRCUIT.setRegistryName(Names.BASIC_CONTROL_CIRCUIT); - ADVANCED_CONTROL_CIRCUIT.setRegistryName(Names.ADVANCED_CONTROL_CIRCUIT); - - BLACK_HOLE_SCANNER.setRegistryName(Names.BLACK_HOLE_SCANNER); - GRAVITATION_FIELD_LIMITER.setRegistryName(Names.GRAVITATION_FIELD_LIMITER); - GRAVITATION_FIELD_SENSOR.setRegistryName(Names.GRAVITATION_FIELD_SENSOR); - PORTABLE_GRAVITATION_STABILIZER.setRegistryName(Names.PORTABLE_GRAVITATION_STABILIZER); - - GRAVITATIONAL_DISRUPTOR.setRegistryName(Names.GRAVITATIONAL_DISRUPTOR); - PILL_ANDROID.setRegistryName(Names.PILL_ANDROID); - PILL_HUMANE.setRegistryName(Names.PILL_HUMANE); - PILL_OBLIVION.setRegistryName(Names.PILL_OBLIVION); - PILL_HEAL.setRegistryName(Names.PILL_HEAL); - BATTERY_CRUDE.setRegistryName(Names.BATTERY_CRUDE); - BATTERY_BASIC.setRegistryName(Names.BATTERY_BASIC); - BATTERY_NORMAL.setRegistryName(Names.BATTERY_NORMAL); - BATTERY_DENSE.setRegistryName(Names.BATTERY_DENSE); - BATTERY_CAPACITOR.setRegistryName(Names.BATTERY_CAPACITOR); - BATTERY_CREATIVE.setRegistryName(Names.BATTERY_CREATIVE); - - MATTER_CAPACITOR_PARTS.setRegistryName(Names.MATTER_CAPACITOR_PARTS); - MATTER_CAPACITOR_BASIC.setRegistryName(Names.MATTER_CAPACITOR_BASIC); - MATTER_CAPACITOR_NORMAL.setRegistryName(Names.MATTER_CAPACITOR_NORMAL); - MATTER_CAPACITOR_DENSE.setRegistryName(Names.MATTER_CAPACITOR_DENSE); - MATTER_CAPACITOR_CREATIVE.setRegistryName(Names.MATTER_CAPACITOR_CREATIVE); - - PATTERN_DRIVE_NORMAL.setRegistryName(Names.PATTERN_DRIVE_NORMAL); - PATTERN_DRIVE_CREATIVE.setRegistryName(Names.PATTERN_DRIVE_CREATIVE); - PORTABLE_CONDENSATION_DRIVE.setRegistryName(Names.PORTABLE_CONDENSATION_DRIVE); - PORTABLE_DENSE_CONDENSATION_DRIVE.setRegistryName(Names.PORTABLE_DENSE_CONDENSATION_DRIVE); - - NUTRIENT_PASTE.setRegistryName(Names.NUTRIENT_PASTE); - - TRITANIUM_BLOCK.setRegistryName(Names.TRITANIUM_BLOCK); - TRITANIUM_STRIPED_BLOCK.setRegistryName(Names.TRITANIUM_STRIPED_BLOCK); - CARBON_FIBRE_BLOCK.setRegistryName(Names.CARBON_FIBRE_BLOCK); - - TRITANIUM_SWORD.setRegistryName(Names.TRITANIUM_SWORD); - TRITANIUM_PICKAXE.setRegistryName(Names.TRITANIUM_PICKAXE); - TRITANIUM_SHOVEL.setRegistryName(Names.TRITANIUM_SHOVEL); - TRITANIUM_AXE.setRegistryName(Names.TRITANIUM_AXE); - TRITANIUM_HOE.setRegistryName(Names.TRITANIUM_HOE); - - TRITANIUM_HELMET.setRegistryName(Names.TRITANIUM_HELMET); - TRITANIUM_CHESTPLATE.setRegistryName(Names.TRITANIUM_CHESTPLATE); - TRITANIUM_PANTS.setRegistryName(Names.TRITANIUM_PANTS); - TRITANIUM_BOOTS.setRegistryName(Names.TRITANIUM_BOOTS); - } - - @SubscribeEvent - @SuppressWarnings("unused") - public static void register(final RegistryEvent.Register event) { - event.getRegistry().register(ANDROID_STATION); - event.getRegistry().register(BATTERY_BANK); - event.getRegistry().register(MATTER_DECOMPOSER); - event.getRegistry().register(MATTER_CAPACITOR_BANK); - event.getRegistry().register(MATTER_CABLE); - event.getRegistry().register(PATTERN_STORAGE); - event.getRegistry().register(MATTER_SCANNER); - event.getRegistry().register(MATTER_PANEL); - event.getRegistry().register(MATTER_REPLICATOR); - event.getRegistry().register(MATTER_BOTTLER); - event.getRegistry().register(DRIVE_VIEWER); - event.getRegistry().register(BLACK_HOLE); - event.getRegistry().register(CARGO_CRATE); - event.getRegistry().register(DRIVE_RACK); - event.getRegistry().register(ITEM_MONITOR); - event.getRegistry().register(ENERGY_COUNTER); - event.getRegistry().register(CHEMICAL_GENERATOR); - event.getRegistry().register(PLATE_PRESS); - event.getRegistry().register(GRAVITATION_STABILIZER); - event.getRegistry().register(MATTER_DUST); - event.getRegistry().register(MATTER_RECYCLER); - - event.getRegistry().register(DEBUG_EXPLOSION_SMALL); - event.getRegistry().register(DEBUG_SPHERE_POINTS); - - event.getRegistry().register(TRITANIUM_ORE); - event.getRegistry().register(DEEPSLATE_TRITANIUM_ORE); - event.getRegistry().register(TRITANIUM_RAW_BLOCK); - - event.getRegistry().register(TRITANIUM_ORE_CLUMP); - event.getRegistry().register(TRITANIUM_INGOT); - event.getRegistry().register(MATTER_IO_PORT); - event.getRegistry().register(MATTER_TRANSFORM_MATRIX); - event.getRegistry().register(ENERGY_BUS); - event.getRegistry().register(ELECTRIC_PARTS); - event.getRegistry().register(MACHINE_FRAME); - event.getRegistry().register(TRITANIUM_PLATE); - event.getRegistry().register(IRON_PLATE); - event.getRegistry().register(COPPER_WIRING); - event.getRegistry().register(GOLD_WIRING); - event.getRegistry().register(PORTABLE_CONDENSATION_DRIVE_CASING); - event.getRegistry().register(PORTABLE_DENSE_CONDENSATION_DRIVE_CASING); - event.getRegistry().register(CIRCUIT_PLATING); - event.getRegistry().register(BASIC_CONTROL_CIRCUIT); - event.getRegistry().register(ADVANCED_CONTROL_CIRCUIT); - - event.getRegistry().register(BLACK_HOLE_SCANNER); - event.getRegistry().register(GRAVITATION_FIELD_LIMITER); - event.getRegistry().register(GRAVITATION_FIELD_SENSOR); - event.getRegistry().register(PORTABLE_GRAVITATION_STABILIZER); - - event.getRegistry().register(GRAVITATIONAL_DISRUPTOR); - event.getRegistry().register(PILL_ANDROID); - event.getRegistry().register(PILL_HUMANE); - event.getRegistry().register(PILL_OBLIVION); - event.getRegistry().register(PILL_HEAL); - event.getRegistry().register(BATTERY_CRUDE); - event.getRegistry().register(BATTERY_BASIC); - event.getRegistry().register(BATTERY_NORMAL); - event.getRegistry().register(BATTERY_DENSE); - event.getRegistry().register(BATTERY_CAPACITOR); - event.getRegistry().register(BATTERY_CREATIVE); - - event.getRegistry().register(MATTER_CAPACITOR_PARTS); - event.getRegistry().register(MATTER_CAPACITOR_BASIC); - event.getRegistry().register(MATTER_CAPACITOR_NORMAL); - event.getRegistry().register(MATTER_CAPACITOR_DENSE); - event.getRegistry().register(MATTER_CAPACITOR_CREATIVE); - - event.getRegistry().register(PATTERN_DRIVE_NORMAL); - event.getRegistry().register(PATTERN_DRIVE_CREATIVE); - event.getRegistry().register(PORTABLE_CONDENSATION_DRIVE); - event.getRegistry().register(PORTABLE_DENSE_CONDENSATION_DRIVE); - - event.getRegistry().register(NUTRIENT_PASTE); - - event.getRegistry().register(TRITANIUM_BLOCK); - event.getRegistry().register(TRITANIUM_STRIPED_BLOCK); - event.getRegistry().register(CARBON_FIBRE_BLOCK); - - for (var crate : CRATES) { - event.getRegistry().register(crate); - } - - for (var glass : INDUSTRIAL_GLASS_LIST) { - event.getRegistry().register(glass.item); - event.getRegistry().register(glass.paneItem); - } - - event.getRegistry().register(TRITANIUM_SWORD); - event.getRegistry().register(TRITANIUM_SHOVEL); - event.getRegistry().register(TRITANIUM_AXE); - event.getRegistry().register(TRITANIUM_PICKAXE); - event.getRegistry().register(TRITANIUM_HOE); - - event.getRegistry().register(TRITANIUM_HELMET); - event.getRegistry().register(TRITANIUM_CHESTPLATE); - event.getRegistry().register(TRITANIUM_PANTS); - event.getRegistry().register(TRITANIUM_BOOTS); - - // OverdriveThatMatters.LOGGER.info("Registered items"); - } - } - - public static class BlockEntities { - public static final BlockEntityType ANDROID_STATION = BlockEntityType.Builder.of(BlockEntityAndroidStation::new, Blocks.ANDROID_STATION).build(null); - public static final BlockEntityType BATTERY_BANK = BlockEntityType.Builder.of(BlockEntityBatteryBank::new, Blocks.BATTERY_BANK).build(null); - public static final BlockEntityType MATTER_DECOMPOSER = BlockEntityType.Builder.of(BlockEntityMatterDecomposer::new, Blocks.MATTER_DECOMPOSER).build(null); - public static final BlockEntityType MATTER_CAPACITOR_BANK = BlockEntityType.Builder.of(BlockEntityMatterCapacitorBank::new, Blocks.MATTER_CAPACITOR_BANK).build(null); - public static final BlockEntityType MATTER_CABLE = BlockEntityType.Builder.of(BlockEntityMatterCable::new, Blocks.MATTER_CABLE).build(null); - public static final BlockEntityType PATTERN_STORAGE = BlockEntityType.Builder.of(BlockEntityPatternStorage::new, Blocks.PATTERN_STORAGE).build(null); - public static final BlockEntityType MATTER_SCANNER = BlockEntityType.Builder.of(BlockEntityMatterScanner::new, Blocks.MATTER_SCANNER).build(null); - public static final BlockEntityType MATTER_PANEL = BlockEntityType.Builder.of(BlockEntityMatterPanel::new, Blocks.MATTER_PANEL).build(null); - public static final BlockEntityType MATTER_REPLICATOR = BlockEntityType.Builder.of(BlockEntityMatterReplicator::new, Blocks.MATTER_REPLICATOR).build(null); - public static final BlockEntityType MATTER_BOTTLER = BlockEntityType.Builder.of(BlockEntityMatterBottler::new, Blocks.MATTER_BOTTLER).build(null); - public static final BlockEntityType DRIVE_VIEWER = BlockEntityType.Builder.of(BlockEntityDriveViewer::new, Blocks.DRIVE_VIEWER).build(null); - public static final BlockEntityType BLACK_HOLE = BlockEntityType.Builder.of(BlockEntityBlackHole::new, Blocks.BLACK_HOLE).build(null); - public static final BlockEntityType CARGO_CRATE = BlockEntityType.Builder.of(BlockEntityCargoCrate::new, Blocks.CARGO_CRATE).build(null); - public static final BlockEntityType DRIVE_RACK = BlockEntityType.Builder.of(BlockEntityDriveRack::new, Blocks.DRIVE_RACK).build(null); - public static final BlockEntityType ITEM_MONITOR = BlockEntityType.Builder.of(BlockEntityItemMonitor::new, Blocks.ITEM_MONITOR).build(null); - public static final BlockEntityType ENERGY_COUNTER = BlockEntityType.Builder.of(BlockEntityEnergyCounter::new, Blocks.ENERGY_COUNTER).build(null); - public static final BlockEntityType CHEMICAL_GENERATOR = BlockEntityType.Builder.of(BlockEntityChemicalGenerator::new, Blocks.CHEMICAL_GENERATOR).build(null); - public static final BlockEntityType PLATE_PRESS = BlockEntityType.Builder.of(BlockEntityPlatePress::new, Blocks.PLATE_PRESS).build(null); - public static final BlockEntityType GRAVITATION_STABILIZER = BlockEntityType.Builder.of(BlockEntityGravitationStabilizer::new, Blocks.GRAVITATION_STABILIZER).build(null); - public static final BlockEntityType MATTER_RECYCLER = BlockEntityType.Builder.of(BlockEntityMatterRecycler::new, Blocks.MATTER_RECYCLER).build(null); - - public static final BlockEntityType DEBUG_EXPLOSION_SMALL = BlockEntityType.Builder.of(BlockEntityExplosionDebugger::new, Blocks.DEBUG_EXPLOSION_SMALL).build(null); - public static final BlockEntityType DEBUG_SPHERE_POINTS = BlockEntityType.Builder.of(BlockEntitySphereDebugger::new, Blocks.DEBUG_SPHERE_POINTS).build(null); - - static { - ANDROID_STATION.setRegistryName(Names.ANDROID_STATION); - BATTERY_BANK.setRegistryName(Names.BATTERY_BANK); - MATTER_DECOMPOSER.setRegistryName(Names.MATTER_DECOMPOSER); - MATTER_CAPACITOR_BANK.setRegistryName(Names.MATTER_CAPACITOR_BANK); - MATTER_CABLE.setRegistryName(Names.MATTER_CABLE); - PATTERN_STORAGE.setRegistryName(Names.PATTERN_STORAGE); - MATTER_SCANNER.setRegistryName(Names.MATTER_SCANNER); - MATTER_PANEL.setRegistryName(Names.MATTER_PANEL); - MATTER_REPLICATOR.setRegistryName(Names.MATTER_REPLICATOR); - MATTER_BOTTLER.setRegistryName(Names.MATTER_BOTTLER); - DRIVE_VIEWER.setRegistryName(Names.DRIVE_VIEWER); - BLACK_HOLE.setRegistryName(Names.BLACK_HOLE); - CARGO_CRATE.setRegistryName(Names.CARGO_CRATE); - DRIVE_RACK.setRegistryName(Names.DRIVE_RACK); - ITEM_MONITOR.setRegistryName(Names.ITEM_MONITOR); - ENERGY_COUNTER.setRegistryName(Names.ENERGY_COUNTER); - CHEMICAL_GENERATOR.setRegistryName(Names.CHEMICAL_GENERATOR); - PLATE_PRESS.setRegistryName(Names.PLATE_PRESS); - GRAVITATION_STABILIZER.setRegistryName(Names.GRAVITATION_STABILIZER); - MATTER_RECYCLER.setRegistryName(Names.MATTER_RECYCLER); - - DEBUG_EXPLOSION_SMALL.setRegistryName(Names.DEBUG_EXPLOSION_SMALL); - DEBUG_SPHERE_POINTS.setRegistryName(Names.DEBUG_SPHERE_POINTS); - } - - @SubscribeEvent - @SuppressWarnings("unused") - public static void register(final RegistryEvent.Register> event) { - event.getRegistry().register(ANDROID_STATION); - event.getRegistry().register(BATTERY_BANK); - event.getRegistry().register(MATTER_DECOMPOSER); - event.getRegistry().register(MATTER_CAPACITOR_BANK); - event.getRegistry().register(MATTER_CABLE); - event.getRegistry().register(PATTERN_STORAGE); - event.getRegistry().register(MATTER_SCANNER); - event.getRegistry().register(MATTER_PANEL); - event.getRegistry().register(MATTER_REPLICATOR); - event.getRegistry().register(MATTER_BOTTLER); - event.getRegistry().register(DRIVE_VIEWER); - event.getRegistry().register(BLACK_HOLE); - event.getRegistry().register(CARGO_CRATE); - event.getRegistry().register(DRIVE_RACK); - event.getRegistry().register(ITEM_MONITOR); - event.getRegistry().register(ENERGY_COUNTER); - event.getRegistry().register(CHEMICAL_GENERATOR); - event.getRegistry().register(PLATE_PRESS); - event.getRegistry().register(GRAVITATION_STABILIZER); - event.getRegistry().register(MATTER_RECYCLER); - - event.getRegistry().register(DEBUG_EXPLOSION_SMALL); - event.getRegistry().register(DEBUG_SPHERE_POINTS); - - // OverdriveThatMatters.LOGGER.info("Registered block entities"); - } - - - @SubscribeEvent - @SuppressWarnings("unused") - public static void registerRenderers(final FMLClientSetupEvent event) { - BlockEntityRenderers.register(BLACK_HOLE, BlackHoleRenderer::new); - BlockEntityRenderers.register(GRAVITATION_STABILIZER, GravitationStabilizerRenderer::new); - BlockEntityRenderers.register(ENERGY_COUNTER, EnergyCounterRenderer::new); - } - } - - public static class AndroidFeatures { - public static final AndroidFeatureType AIR_BAGS = new AndroidFeatureType<>(AndroidFeature::new); - public static final AndroidFeatureType LIMB_OVERCLOCKING = new AndroidFeatureType<>(AndroidLimbOverclocking::new); - public static final AndroidFeatureType NANOBOTS_REGENERATION = new AndroidFeatureType<>(AndroidNanobotsRegeneration::new); - public static final AndroidFeatureType NANOBOTS_ARMOR = new AndroidFeatureType<>(AndroidNanobotsArmor::new); - public static final AndroidFeatureType EXTENDED_REACH = new AndroidFeatureType<>(AndroidExtendedReach::new); - - static { - AIR_BAGS.setRegistryName(Names.AIR_BAGS); - LIMB_OVERCLOCKING.setRegistryName(Names.LIMB_OVERCLOCKING); - NANOBOTS_REGENERATION.setRegistryName(Names.NANOBOTS_REGENERATION); - NANOBOTS_ARMOR.setRegistryName(Names.NANOBOTS_ARMOR); - EXTENDED_REACH.setRegistryName(Names.EXTENDED_REACH); - } - - @SubscribeEvent - @SuppressWarnings("unused") - public static void register(final RegistryEvent.Register> event) { - event.getRegistry().register(AIR_BAGS); - event.getRegistry().register(LIMB_OVERCLOCKING); - event.getRegistry().register(NANOBOTS_REGENERATION); - event.getRegistry().register(NANOBOTS_ARMOR); - event.getRegistry().register(EXTENDED_REACH); - } - } - - public static class AndroidResearch { - public static final ResourceLocation ICONS = new ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/android_upgrades.png"); - public static final SkinElement ICON_TRANSFER; - public static final SkinElement ICON_ATTACK_BOOST; - public static final SkinElement ICON_PLASMA_SHIELD_BOOST; - public static final SkinElement ICON_CLOAK; - public static final SkinElement ICON_GRAVITATIONAL_STABILIZER; - public static final SkinElement ICON_AIR_BAGS; - public static final SkinElement ICON_JUMP_BOOST; - - public static final SkinElement ICON_FEATHER_FALLING; - public static final SkinElement ICON_ARC; - public static final SkinElement ICON_ARROW; - public static final SkinElement ICON_ARMOR; - public static final SkinElement ICON_NANOBOTS; - public static final SkinElement ICON_NIGHT_VISION; - public static final SkinElement ICON_OXYGEN_SUPPLY; - - public static final SkinElement ICON_PLASMA_SHIELD; - public static final SkinElement ICON_SHOCKWAVE; - public static final SkinElement ICON_LIMB_OVERCLOCKING; - public static final SkinElement ICON_STEP_ASSIST; - public static final SkinElement ICON_ENDER_TELEPORT; - public static final SkinElement ICON_WIRELESS_CHARGING; - public static final SkinElement ICON_UNKNOWN; - - public static final SkinElement ICON_EXTENDED_REACH; - - static { - int x = 0; - int y = 0; - - ICON_TRANSFER = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_ATTACK_BOOST = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_PLASMA_SHIELD_BOOST = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_CLOAK = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_GRAVITATIONAL_STABILIZER = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_AIR_BAGS = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_JUMP_BOOST = new SkinElement(ICONS, x, y, 18, 18, 126, 126); - - y += 18; - x = 0; - - ICON_FEATHER_FALLING = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_ARC = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_ARROW = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_ARMOR = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_NANOBOTS = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_NIGHT_VISION = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_OXYGEN_SUPPLY = new SkinElement(ICONS, x, y, 18, 18, 126, 126); - - y += 18; - x = 0; - - ICON_PLASMA_SHIELD = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_SHOCKWAVE = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_LIMB_OVERCLOCKING = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_STEP_ASSIST = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_ENDER_TELEPORT = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_WIRELESS_CHARGING = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - ICON_UNKNOWN = new SkinElement(ICONS, x, y, 18, 18, 126, 126); - - y += 18; - x = 0; - - ICON_EXTENDED_REACH = new SkinElement(ICONS, x, y, 18, 18, 126, 126); x += 18; - } - - public static final AndroidResearchType AIR_BAGS = - new AndroidResearchBuilder() - .setExperienceCost(18) - .addFeatureResult(AndroidFeatures.AIR_BAGS) - .withDescription() - .withIcon(ICON_AIR_BAGS) - .build(); - - public static final AndroidResearchType EXTENDED_REACH = - new AndroidResearchBuilder() - .setExperienceCost(40) - .addFeatureResult(AndroidFeatures.EXTENDED_REACH) - .withDescription() - .withIcon(ICON_EXTENDED_REACH) - .build(); - - public static final AndroidResearchType[] LIMB_OVERCLOCKING = new AndroidResearchType[4]; - public static final AndroidResearchType[] NANOBOTS_REGENERATION = new AndroidResearchType[4]; - public static final AndroidResearchType[] NANOBOTS_ARMOR_STRENGTH = new AndroidResearchType[3]; - public static final AndroidResearchType[] NANOBOTS_ARMOR_SPEED = new AndroidResearchType[3]; - - public static final AndroidResearchType NANOBOTS = - new AndroidResearchBuilder() - .setExperienceCost(15) - .withDescription() - .withIcon(ICON_NANOBOTS) - .build(); - - public static final AndroidResearchType NANOBOTS_ARMOR = - new AndroidResearchBuilder() - .setExperienceCost(25) - .withDescription() - .addPrerequisite(Names.NANOBOTS) - .addFeatureResult(Names.NANOBOTS_ARMOR) - .withIcon(ICON_ARMOR) - .build(); - - static { - AIR_BAGS.setRegistryName(Names.AIR_BAGS); - NANOBOTS.setRegistryName(Names.NANOBOTS); - NANOBOTS_ARMOR.setRegistryName(Names.NANOBOTS_ARMOR); - EXTENDED_REACH.setRegistryName(Names.EXTENDED_REACH); - - for (int i = 0; i < 4; i++) { - var limbs = new AndroidResearchBuilder() - .setExperienceCost(18 + i * 8) - .withIconText(new TextComponent(String.valueOf(i + 1))) - .withIcon(ICON_LIMB_OVERCLOCKING) - .withName(new TranslatableComponent("android_research.overdrive_that_matters.limb_overclocking", i + 1)) - .withDescription(new TranslatableComponent("android_research.overdrive_that_matters.limb_overclocking.description", (i + 1) * 8, (i + 1) * 6)) - .addFeatureResult(Names.LIMB_OVERCLOCKING, i); - - var regeneration = new AndroidResearchBuilder() - .setExperienceCost(20 + i * 6) - .withIconText(new TextComponent(String.valueOf(i + 1))) - .withIcon(ICON_NANOBOTS) - .withName(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_regeneration", i + 1)) - .withDescription( - i > 0 ? new TranslatableComponent("android_research.overdrive_that_matters.nanobots_regeneration.description_improve") : new TranslatableComponent("android_research.overdrive_that_matters.nanobots_regeneration.description")) - .addFeatureResult(Names.NANOBOTS_REGENERATION, i); - - if (i > 0) { - limbs.addPrerequisite(Names.LIMB_OVERCLOCKING_LIST[i - 1]); - regeneration.addPrerequisite(Names.NANOBOTS_REGENERATION_LIST[i - 1]); - } else { - regeneration.addPrerequisite(Names.NANOBOTS); - } - - LIMB_OVERCLOCKING[i] = limbs.build(); - NANOBOTS_REGENERATION[i] = regeneration.build(); - } - - for (int i = 0; i < 3; i++) { - final int level = i + 1; - - NANOBOTS_ARMOR_STRENGTH[i] = new AndroidResearchBuilder() - .setExperienceCost(20 + i * 8) - .withIconText(new TextComponent(String.valueOf(i + 1))) - .withIcon(ICON_ARMOR) - .addPrerequisite(i > 0 ? Names.NANOBOTS_ARMOR_STRENGTH_LIST[i - 1] : Names.NANOBOTS_ARMOR) - .withName(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_armor_strength", i + 1)) - .withDescription(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_armor_strength.description", (i + 1) * 8, (i + 1) * 6)) - .addFeatureResult(Names.NANOBOTS_ARMOR, 0, (feature) -> { - if (((AndroidNanobotsArmor) feature).getStrength() < level) - ((AndroidNanobotsArmor) feature).setStrength(level); - }) - .build(); - - NANOBOTS_ARMOR_SPEED[i] = new AndroidResearchBuilder() - .setExperienceCost(20 + i * 8) - .withIconText(new TextComponent(String.valueOf(i + 1))) - .withIcon(ICON_ARMOR) - .addPrerequisite(i > 0 ? Names.NANOBOTS_ARMOR_SPEED_LIST[i - 1] : Names.NANOBOTS_ARMOR) - .withName(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_armor_speed", i + 1)) - .withDescription(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_armor_speed.description", (i + 1) * 8, (i + 1) * 6)) - .addFeatureResult(Names.NANOBOTS_ARMOR, 0, (feature) -> { - if (((AndroidNanobotsArmor) feature).getSpeed() < level) - ((AndroidNanobotsArmor) feature).setSpeed(level); - }) - .build(); - } - - LIMB_OVERCLOCKING[0].setRegistryName(Names.LIMB_OVERCLOCKING_1); - LIMB_OVERCLOCKING[1].setRegistryName(Names.LIMB_OVERCLOCKING_2); - LIMB_OVERCLOCKING[2].setRegistryName(Names.LIMB_OVERCLOCKING_3); - LIMB_OVERCLOCKING[3].setRegistryName(Names.LIMB_OVERCLOCKING_4); - - NANOBOTS_ARMOR_SPEED[0].setRegistryName(Names.NANOBOTS_ARMOR_SPEED_1); - NANOBOTS_ARMOR_SPEED[1].setRegistryName(Names.NANOBOTS_ARMOR_SPEED_2); - NANOBOTS_ARMOR_SPEED[2].setRegistryName(Names.NANOBOTS_ARMOR_SPEED_3); - - NANOBOTS_ARMOR_STRENGTH[0].setRegistryName(Names.NANOBOTS_ARMOR_STRENGTH_1); - NANOBOTS_ARMOR_STRENGTH[1].setRegistryName(Names.NANOBOTS_ARMOR_STRENGTH_2); - NANOBOTS_ARMOR_STRENGTH[2].setRegistryName(Names.NANOBOTS_ARMOR_STRENGTH_3); - - NANOBOTS_REGENERATION[0].setRegistryName(Names.NANOBOTS_REGENERATION_1); - NANOBOTS_REGENERATION[1].setRegistryName(Names.NANOBOTS_REGENERATION_2); - NANOBOTS_REGENERATION[2].setRegistryName(Names.NANOBOTS_REGENERATION_3); - NANOBOTS_REGENERATION[3].setRegistryName(Names.NANOBOTS_REGENERATION_4); - } - - @SubscribeEvent - @SuppressWarnings("unused") - public static void register(final RegistryEvent.Register> event) { - event.getRegistry().register(AIR_BAGS); - event.getRegistry().register(NANOBOTS); - event.getRegistry().register(NANOBOTS_ARMOR); - event.getRegistry().register(EXTENDED_REACH); - - event.getRegistry().register(LIMB_OVERCLOCKING[0]); - event.getRegistry().register(LIMB_OVERCLOCKING[1]); - event.getRegistry().register(LIMB_OVERCLOCKING[2]); - event.getRegistry().register(LIMB_OVERCLOCKING[3]); - - event.getRegistry().register(NANOBOTS_ARMOR_SPEED[0]); - event.getRegistry().register(NANOBOTS_ARMOR_SPEED[1]); - event.getRegistry().register(NANOBOTS_ARMOR_SPEED[2]); - event.getRegistry().register(NANOBOTS_ARMOR_STRENGTH[0]); - event.getRegistry().register(NANOBOTS_ARMOR_STRENGTH[1]); - event.getRegistry().register(NANOBOTS_ARMOR_STRENGTH[2]); - - event.getRegistry().register(NANOBOTS_REGENERATION[0]); - event.getRegistry().register(NANOBOTS_REGENERATION[1]); - event.getRegistry().register(NANOBOTS_REGENERATION[2]); - event.getRegistry().register(NANOBOTS_REGENERATION[3]); - } - } - - public static class Menus { - public static final MenuType ANDROID_STATION = new MenuType<>(AndroidStationMenu::new); - public static final MenuType BATTERY_BANK = new MenuType<>(MenuBatteryBank::new); - public static final MenuType MATTER_DECOMPOSER = new MenuType<>(MenuMatterDecomposer::new); - public static final MenuType MATTER_CAPACITOR_BANK = new MenuType<>(MenuMatterCapacitor::new); - public static final MenuType PATTERN_STORAGE = new MenuType<>(MenuPatternStorage::new); - public static final MenuType MATTER_SCANNER = new MenuType<>(MenuMatterScanner::new); - public static final MenuType MATTER_PANEL = new MenuType<>(MenuMatterPanel::new); - public static final MenuType MATTER_REPLICATOR = new MenuType<>(MenuMatterReplicator::new); - public static final MenuType MATTER_BOTTLER = new MenuType<>(MenuMatterBottler::new); - public static final MenuType DRIVE_VIEWER = new MenuType<>(MenuDriveViewer::new); - public static final MenuType CARGO_CRATE = new MenuType<>(MenuCargoCrate::new); - public static final MenuType DRIVE_RACK = new MenuType<>(MenuDriveRack::new); - public static final MenuType ITEM_MONITOR = new MenuType<>(MenuItemMonitor::new); - public static final MenuType ENERGY_COUNTER = new MenuType<>(MenuEnergyCounter::new); - public static final MenuType CHEMICAL_GENERATOR = new MenuType<>(MenuChemicalGenerator::new); - public static final MenuType PLATE_PRESS = new MenuType<>(MenuPlatePress::new); - public static final MenuType MATTER_RECYCLER = new MenuType<>(MenuMatterRecycler::new); - - static { - ANDROID_STATION.setRegistryName(Names.ANDROID_STATION); - BATTERY_BANK.setRegistryName(Names.BATTERY_BANK); - MATTER_DECOMPOSER.setRegistryName(Names.MATTER_DECOMPOSER); - MATTER_CAPACITOR_BANK.setRegistryName(Names.MATTER_CAPACITOR_BANK); - PATTERN_STORAGE.setRegistryName(Names.PATTERN_STORAGE); - MATTER_SCANNER.setRegistryName(Names.MATTER_SCANNER); - MATTER_PANEL.setRegistryName(Names.MATTER_PANEL); - MATTER_REPLICATOR.setRegistryName(Names.MATTER_REPLICATOR); - MATTER_BOTTLER.setRegistryName(Names.MATTER_BOTTLER); - DRIVE_VIEWER.setRegistryName(Names.DRIVE_VIEWER); - CARGO_CRATE.setRegistryName(Names.CARGO_CRATE); - DRIVE_RACK.setRegistryName(Names.DRIVE_RACK); - ITEM_MONITOR.setRegistryName(Names.ITEM_MONITOR); - ENERGY_COUNTER.setRegistryName(Names.ENERGY_COUNTER); - CHEMICAL_GENERATOR.setRegistryName(Names.CHEMICAL_GENERATOR); - PLATE_PRESS.setRegistryName(Names.PLATE_PRESS); - MATTER_RECYCLER.setRegistryName(Names.MATTER_RECYCLER); - } - - @SubscribeEvent - @SuppressWarnings("unused") - public static void register(final RegistryEvent.Register> event) { - event.getRegistry().register(ANDROID_STATION); - event.getRegistry().register(BATTERY_BANK); - event.getRegistry().register(MATTER_DECOMPOSER); - event.getRegistry().register(MATTER_CAPACITOR_BANK); - event.getRegistry().register(PATTERN_STORAGE); - event.getRegistry().register(MATTER_SCANNER); - event.getRegistry().register(MATTER_PANEL); - event.getRegistry().register(MATTER_REPLICATOR); - event.getRegistry().register(MATTER_BOTTLER); - event.getRegistry().register(DRIVE_VIEWER); - event.getRegistry().register(CARGO_CRATE); - event.getRegistry().register(DRIVE_RACK); - event.getRegistry().register(ITEM_MONITOR); - event.getRegistry().register(ENERGY_COUNTER); - event.getRegistry().register(CHEMICAL_GENERATOR); - event.getRegistry().register(PLATE_PRESS); - event.getRegistry().register(MATTER_RECYCLER); - - // OverdriveThatMatters.LOGGER.info("Registered menus"); - } - - @SubscribeEvent - @SuppressWarnings("unused") - public static void registerScreens(final FMLClientSetupEvent event) { - MenuScreens.register(ANDROID_STATION, ScreenAndroidStation::new); - MenuScreens.register(BATTERY_BANK, ScreenBatteryBank::new); - MenuScreens.register(MATTER_DECOMPOSER, ScreenMatterDecomposer::new); - MenuScreens.register(MATTER_CAPACITOR_BANK, ScreenMatterCapacitorBank::new); - MenuScreens.register(PATTERN_STORAGE, ScreenPatternStorage::new); - MenuScreens.register(MATTER_SCANNER, ScreenMatterScanner::new); - MenuScreens.register(MATTER_PANEL, MatterPanelScreen::new); - MenuScreens.register(MATTER_REPLICATOR, ScreenMatterReplicator::new); - MenuScreens.register(MATTER_BOTTLER, ScreenMatterBottler::new); - MenuScreens.register(DRIVE_VIEWER, ScreenDriveViewer::new); - MenuScreens.register(CARGO_CRATE, ScreenCargoCrate::new); - MenuScreens.register(DRIVE_RACK, ScreenDriveRack::new); - MenuScreens.register(ITEM_MONITOR, ScreenItemMonitor::new); - MenuScreens.register(ENERGY_COUNTER, ScreenEnergyCounter::new); - MenuScreens.register(CHEMICAL_GENERATOR, ScreenChemicalGenerator::new); - MenuScreens.register(PLATE_PRESS, ScreenPlatePress::new); - MenuScreens.register(MATTER_RECYCLER, ScreenMatterRecycler::new); - - // OverdriveThatMatters.LOGGER.info("Registered screens"); - } - } - - public static class Stats { - @SubscribeEvent - @SuppressWarnings("unused") - public static void registerVanilla(final FMLCommonSetupEvent event) { - net.minecraft.core.Registry.register(net.minecraft.core.Registry.CUSTOM_STAT, Names.DAMAGE_ABSORBED, Names.DAMAGE_ABSORBED); - net.minecraft.core.Registry.register(net.minecraft.core.Registry.CUSTOM_STAT, Names.HEALTH_REGENERATED, Names.HEALTH_REGENERATED); - net.minecraft.core.Registry.register(net.minecraft.core.Registry.CUSTOM_STAT, Names.POWER_CONSUMED, Names.POWER_CONSUMED); - - net.minecraft.stats.Stats.CUSTOM.get(Names.DAMAGE_ABSORBED, StatFormatter.DIVIDE_BY_TEN); - net.minecraft.stats.Stats.CUSTOM.get(Names.HEALTH_REGENERATED, StatFormatter.DIVIDE_BY_TEN); - net.minecraft.stats.Stats.CUSTOM.get(Names.POWER_CONSUMED, StatFormatter.DIVIDE_BY_TEN); - } - } - - public static class Recipes { - public static class MatteryRecipeType> implements RecipeType { - public final ResourceLocation name; - - private MatteryRecipeType(ResourceLocation name) { - this.name = name; - } - - private void register() { - net.minecraft.core.Registry.register(net.minecraft.core.Registry.RECIPE_TYPE, name, this); - } - - @Override - public String toString() { - return name.toString(); - } - } - - public static final MatteryRecipeType PLATE_PRESS = new MatteryRecipeType<>(Names.PLATE_PRESS); - - @SubscribeEvent - @SuppressWarnings("unused") - public static void register(final FMLCommonSetupEvent event) { - PLATE_PRESS.register(); - } - - @SubscribeEvent - @SuppressWarnings("unused") - public static void register(final RegistryEvent.Register> event) { - event.getRegistry().register(PlatePressRecipeFactory.INSTANCE); - } - } - - public static class Tags { - public static class Items { - public static final IOptionalNamedTag INGOT_TRITANIUM = ItemTags.createOptional(new ResourceLocation("forge", "ingots/tritanium"), Set.of(() -> Registry.Items.TRITANIUM_INGOT)); - public static final IOptionalNamedTag PLATE_TRITANIUM = ItemTags.createOptional(new ResourceLocation("forge", "plates/tritanium"), Set.of(() -> Registry.Items.TRITANIUM_PLATE)); - } - } -} diff --git a/src/main/java/ru/dbotthepony/mc/otm/android/AndroidResearchBuilder.java b/src/main/java/ru/dbotthepony/mc/otm/android/AndroidResearchBuilder.java index c93409ede..627cacb31 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/android/AndroidResearchBuilder.java +++ b/src/main/java/ru/dbotthepony/mc/otm/android/AndroidResearchBuilder.java @@ -8,7 +8,7 @@ import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraftforge.registries.RegistryManager; -import ru.dbotthepony.mc.otm.Registry; +import ru.dbotthepony.mc.otm.registry.Registry; import ru.dbotthepony.mc.otm.client.render.SkinElement; import javax.annotation.Nullable; diff --git a/src/main/java/ru/dbotthepony/mc/otm/android/AndroidResearchType.java b/src/main/java/ru/dbotthepony/mc/otm/android/AndroidResearchType.java index 570f90e12..d6d8554f1 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/android/AndroidResearchType.java +++ b/src/main/java/ru/dbotthepony/mc/otm/android/AndroidResearchType.java @@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.android; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TranslatableComponent; import net.minecraftforge.registries.ForgeRegistryEntry; -import ru.dbotthepony.mc.otm.Registry; +import ru.dbotthepony.mc.otm.registry.Registry; import ru.dbotthepony.mc.otm.capability.android.AndroidCapabilityPlayer; import java.util.ArrayList; diff --git a/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidExtendedReach.java b/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidExtendedReach.java index a6c6b5a3c..dc2a7addf 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidExtendedReach.java +++ b/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidExtendedReach.java @@ -1,12 +1,10 @@ package ru.dbotthepony.mc.otm.android.feature; import net.minecraft.world.entity.ai.attributes.AttributeModifier; -import net.minecraft.world.entity.ai.attributes.Attributes; import net.minecraftforge.common.ForgeMod; -import ru.dbotthepony.mc.otm.Registry; import ru.dbotthepony.mc.otm.android.AndroidFeature; -import ru.dbotthepony.mc.otm.android.AndroidFeatureType; import ru.dbotthepony.mc.otm.capability.android.IAndroidCapability; +import ru.dbotthepony.mc.otm.registry.AndroidFeatures; import java.util.UUID; @@ -14,7 +12,7 @@ public class AndroidExtendedReach extends AndroidFeature { public static final UUID MODIFIER_ID = UUID.fromString("4a3fae46-47a8-a03f-857d-f5c2b2c8f2f2"); public AndroidExtendedReach(IAndroidCapability capability) { - super(Registry.AndroidFeatures.EXTENDED_REACH, capability); + super(AndroidFeatures.EXTENDED_REACH, capability); } @Override diff --git a/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidLimbOverclocking.java b/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidLimbOverclocking.java index 0ec778156..a924eedc8 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidLimbOverclocking.java +++ b/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidLimbOverclocking.java @@ -2,10 +2,9 @@ package ru.dbotthepony.mc.otm.android.feature; import net.minecraft.world.entity.ai.attributes.AttributeModifier; import net.minecraft.world.entity.ai.attributes.Attributes; -import ru.dbotthepony.mc.otm.Registry; import ru.dbotthepony.mc.otm.android.AndroidFeature; -import ru.dbotthepony.mc.otm.android.AndroidFeatureType; import ru.dbotthepony.mc.otm.capability.android.IAndroidCapability; +import ru.dbotthepony.mc.otm.registry.AndroidFeatures; import java.util.UUID; @@ -13,7 +12,7 @@ public class AndroidLimbOverclocking extends AndroidFeature { public static final UUID MODIFIER_ID = UUID.fromString("4a3fae46-e57b-4e20-857d-f5c2b2c8f2f2"); public AndroidLimbOverclocking(IAndroidCapability capability) { - super(Registry.AndroidFeatures.LIMB_OVERCLOCKING, capability); + super(AndroidFeatures.LIMB_OVERCLOCKING, capability); } @Override diff --git a/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidNanobotsArmor.java b/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidNanobotsArmor.java index ab47835b8..51ffd422f 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidNanobotsArmor.java +++ b/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidNanobotsArmor.java @@ -3,19 +3,15 @@ package ru.dbotthepony.mc.otm.android.feature; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.event.entity.living.LivingHurtEvent; -import ru.dbotthepony.mc.otm.Registry; import ru.dbotthepony.mc.otm.android.AndroidFeature; -import ru.dbotthepony.mc.otm.android.AndroidFeatureType; import ru.dbotthepony.mc.otm.capability.android.IAndroidCapability; -import ru.dbotthepony.mc.otm.capability.MatteryCapability; -import ru.dbotthepony.mc.otm.core.Fraction; import ru.dbotthepony.mc.otm.core.ImpreciseFraction; - -import java.math.BigDecimal; +import ru.dbotthepony.mc.otm.registry.AndroidFeatures; +import ru.dbotthepony.mc.otm.registry.MNames; public class AndroidNanobotsArmor extends AndroidFeature { public AndroidNanobotsArmor(IAndroidCapability capability) { - super(Registry.AndroidFeatures.NANOBOTS_ARMOR, capability); + super(AndroidFeatures.NANOBOTS_ARMOR, capability); } public int getStrength() { @@ -85,7 +81,7 @@ public class AndroidNanobotsArmor extends AndroidFeature { event.setAmount(event.getAmount() - real_absorbed); if (capability.getEntity() instanceof ServerPlayer ply) { - ply.awardStat(Registry.Names.DAMAGE_ABSORBED, Math.round(real_absorbed * 10f)); + ply.awardStat(MNames.DAMAGE_ABSORBED, Math.round(real_absorbed * 10f)); } layers--; diff --git a/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidNanobotsRegeneration.java b/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidNanobotsRegeneration.java index 01ba93927..0defc1a71 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidNanobotsRegeneration.java +++ b/src/main/java/ru/dbotthepony/mc/otm/android/feature/AndroidNanobotsRegeneration.java @@ -3,19 +3,15 @@ package ru.dbotthepony.mc.otm.android.feature; import net.minecraft.nbt.CompoundTag; import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.event.entity.living.LivingHurtEvent; -import ru.dbotthepony.mc.otm.Registry; import ru.dbotthepony.mc.otm.android.AndroidFeature; -import ru.dbotthepony.mc.otm.android.AndroidFeatureType; import ru.dbotthepony.mc.otm.capability.android.IAndroidCapability; -import ru.dbotthepony.mc.otm.capability.MatteryCapability; -import ru.dbotthepony.mc.otm.core.Fraction; import ru.dbotthepony.mc.otm.core.ImpreciseFraction; - -import java.math.BigDecimal; +import ru.dbotthepony.mc.otm.registry.AndroidFeatures; +import ru.dbotthepony.mc.otm.registry.MNames; public class AndroidNanobotsRegeneration extends AndroidFeature { public AndroidNanobotsRegeneration(IAndroidCapability capability) { - super(Registry.AndroidFeatures.NANOBOTS_REGENERATION, capability); + super(AndroidFeatures.NANOBOTS_REGENERATION, capability); } protected int ticks_passed = 0; @@ -49,7 +45,7 @@ public class AndroidNanobotsRegeneration extends AndroidFeature { ent.heal(heal); if (capability.getEntity() instanceof ServerPlayer ply) { - ply.awardStat(Registry.Names.HEALTH_REGENERATED, Math.round(heal * 10f)); + ply.awardStat(MNames.HEALTH_REGENERATED, Math.round(heal * 10f)); } ticks_passed = 0; diff --git a/src/main/java/ru/dbotthepony/mc/otm/client/EventHandler.java b/src/main/java/ru/dbotthepony/mc/otm/client/EventHandler.java index 6e89bfd19..0c9e67219 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/client/EventHandler.java +++ b/src/main/java/ru/dbotthepony/mc/otm/client/EventHandler.java @@ -2,9 +2,9 @@ package ru.dbotthepony.mc.otm.client; import net.minecraftforge.client.event.MovementInputUpdateEvent; import net.minecraftforge.eventbus.api.SubscribeEvent; -import ru.dbotthepony.mc.otm.Registry; import ru.dbotthepony.mc.otm.capability.android.AndroidCapabilityPlayer; import ru.dbotthepony.mc.otm.capability.MatteryCapability; +import ru.dbotthepony.mc.otm.registry.AndroidFeatures; public class EventHandler { @SubscribeEvent @@ -16,7 +16,7 @@ public class EventHandler { if (!(_cap instanceof AndroidCapabilityPlayer cap)) return; - if (cap.hasFeature(Registry.AndroidFeatures.AIR_BAGS)) + if (cap.hasFeature(AndroidFeatures.AIR_BAGS)) return; if (ply.getAbilities().mayfly) { diff --git a/src/main/java/ru/dbotthepony/mc/otm/client/model/GravitationStabilizerModel.java b/src/main/java/ru/dbotthepony/mc/otm/client/model/GravitationStabilizerModel.java index a76d2bedb..57115b6b3 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/client/model/GravitationStabilizerModel.java +++ b/src/main/java/ru/dbotthepony/mc/otm/client/model/GravitationStabilizerModel.java @@ -5,10 +5,10 @@ import net.minecraft.client.model.geom.ModelLayerLocation; import net.minecraft.client.model.geom.PartPose; import net.minecraft.client.model.geom.builders.*; import net.minecraftforge.client.ForgeHooksClient; -import ru.dbotthepony.mc.otm.Registry; +import ru.dbotthepony.mc.otm.registry.MNames; public class GravitationStabilizerModel { - public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(Registry.Names.PORTABLE_GRAVITATION_STABILIZER, "main"); + public static final ModelLayerLocation LAYER_LOCATION = new ModelLayerLocation(MNames.PORTABLE_GRAVITATION_STABILIZER, "main"); private static HumanoidModel model; private static LayerDefinition def; diff --git a/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidFeaturePacket.java b/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidFeaturePacket.java index 35a0940b0..905c8b057 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidFeaturePacket.java +++ b/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidFeaturePacket.java @@ -5,7 +5,7 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.network.NetworkEvent; -import ru.dbotthepony.mc.otm.Registry; +import ru.dbotthepony.mc.otm.registry.Registry; import ru.dbotthepony.mc.otm.capability.MatteryCapability; import ru.dbotthepony.mc.otm.capability.android.AndroidCapabilityPlayer; import ru.dbotthepony.mc.otm.android.AndroidFeature; diff --git a/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidResearchPacket.java b/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidResearchPacket.java index e97e51ea0..1660e7cdb 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidResearchPacket.java +++ b/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidResearchPacket.java @@ -6,7 +6,7 @@ import net.minecraft.network.FriendlyByteBuf; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.fml.DistExecutor; import net.minecraftforge.network.NetworkEvent; -import ru.dbotthepony.mc.otm.Registry; +import ru.dbotthepony.mc.otm.registry.Registry; import ru.dbotthepony.mc.otm.android.AndroidResearch; import ru.dbotthepony.mc.otm.android.AndroidResearchType; import ru.dbotthepony.mc.otm.capability.android.AndroidCapabilityPlayer; diff --git a/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidResearchRequestPacket.java b/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidResearchRequestPacket.java index a8d84eb7e..b8e8ad1bd 100644 --- a/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidResearchRequestPacket.java +++ b/src/main/java/ru/dbotthepony/mc/otm/network/android/AndroidResearchRequestPacket.java @@ -3,7 +3,7 @@ package ru.dbotthepony.mc.otm.network.android; import net.minecraft.network.FriendlyByteBuf; import net.minecraft.server.level.ServerPlayer; import net.minecraftforge.network.NetworkEvent; -import ru.dbotthepony.mc.otm.Registry; +import ru.dbotthepony.mc.otm.registry.Registry; import ru.dbotthepony.mc.otm.android.AndroidResearch; import ru.dbotthepony.mc.otm.android.AndroidResearchType; import ru.dbotthepony.mc.otm.capability.MatteryCapability; diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/AndroidFeatures.java b/src/main/java/ru/dbotthepony/mc/otm/registry/AndroidFeatures.java new file mode 100644 index 000000000..b3f417361 --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/AndroidFeatures.java @@ -0,0 +1,36 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import ru.dbotthepony.mc.otm.android.AndroidFeature; +import ru.dbotthepony.mc.otm.android.AndroidFeatureType; +import ru.dbotthepony.mc.otm.android.feature.AndroidExtendedReach; +import ru.dbotthepony.mc.otm.android.feature.AndroidLimbOverclocking; +import ru.dbotthepony.mc.otm.android.feature.AndroidNanobotsArmor; +import ru.dbotthepony.mc.otm.android.feature.AndroidNanobotsRegeneration; + +public class AndroidFeatures { + public static final AndroidFeatureType AIR_BAGS = new AndroidFeatureType<>(AndroidFeature::new); + public static final AndroidFeatureType LIMB_OVERCLOCKING = new AndroidFeatureType<>(AndroidLimbOverclocking::new); + public static final AndroidFeatureType NANOBOTS_REGENERATION = new AndroidFeatureType<>(AndroidNanobotsRegeneration::new); + public static final AndroidFeatureType NANOBOTS_ARMOR = new AndroidFeatureType<>(AndroidNanobotsArmor::new); + public static final AndroidFeatureType EXTENDED_REACH = new AndroidFeatureType<>(AndroidExtendedReach::new); + + static { + AIR_BAGS.setRegistryName(MNames.AIR_BAGS); + LIMB_OVERCLOCKING.setRegistryName(MNames.LIMB_OVERCLOCKING); + NANOBOTS_REGENERATION.setRegistryName(MNames.NANOBOTS_REGENERATION); + NANOBOTS_ARMOR.setRegistryName(MNames.NANOBOTS_ARMOR); + EXTENDED_REACH.setRegistryName(MNames.EXTENDED_REACH); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public static void register(final RegistryEvent.Register> event) { + event.getRegistry().register(AIR_BAGS); + event.getRegistry().register(LIMB_OVERCLOCKING); + event.getRegistry().register(NANOBOTS_REGENERATION); + event.getRegistry().register(NANOBOTS_ARMOR); + event.getRegistry().register(EXTENDED_REACH); + } +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/AndroidResearch.java b/src/main/java/ru/dbotthepony/mc/otm/registry/AndroidResearch.java new file mode 100644 index 000000000..b20924159 --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/AndroidResearch.java @@ -0,0 +1,247 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.network.chat.TextComponent; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import ru.dbotthepony.mc.otm.OverdriveThatMatters; +import ru.dbotthepony.mc.otm.android.AndroidResearchBuilder; +import ru.dbotthepony.mc.otm.android.AndroidResearchType; +import ru.dbotthepony.mc.otm.android.feature.AndroidNanobotsArmor; +import ru.dbotthepony.mc.otm.client.render.SkinElement; + +public class AndroidResearch { + public static final ResourceLocation ICONS = new ResourceLocation(OverdriveThatMatters.MOD_ID, "textures/gui/android_upgrades.png"); + public static final SkinElement ICON_TRANSFER; + public static final SkinElement ICON_ATTACK_BOOST; + public static final SkinElement ICON_PLASMA_SHIELD_BOOST; + public static final SkinElement ICON_CLOAK; + public static final SkinElement ICON_GRAVITATIONAL_STABILIZER; + public static final SkinElement ICON_AIR_BAGS; + public static final SkinElement ICON_JUMP_BOOST; + + public static final SkinElement ICON_FEATHER_FALLING; + public static final SkinElement ICON_ARC; + public static final SkinElement ICON_ARROW; + public static final SkinElement ICON_ARMOR; + public static final SkinElement ICON_NANOBOTS; + public static final SkinElement ICON_NIGHT_VISION; + public static final SkinElement ICON_OXYGEN_SUPPLY; + + public static final SkinElement ICON_PLASMA_SHIELD; + public static final SkinElement ICON_SHOCKWAVE; + public static final SkinElement ICON_LIMB_OVERCLOCKING; + public static final SkinElement ICON_STEP_ASSIST; + public static final SkinElement ICON_ENDER_TELEPORT; + public static final SkinElement ICON_WIRELESS_CHARGING; + public static final SkinElement ICON_UNKNOWN; + + public static final SkinElement ICON_EXTENDED_REACH; + + static { + int x = 0; + int y = 0; + + ICON_TRANSFER = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_ATTACK_BOOST = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_PLASMA_SHIELD_BOOST = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_CLOAK = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_GRAVITATIONAL_STABILIZER = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_AIR_BAGS = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_JUMP_BOOST = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + + y += 18; + x = 0; + + ICON_FEATHER_FALLING = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_ARC = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_ARROW = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_ARMOR = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_NANOBOTS = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_NIGHT_VISION = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_OXYGEN_SUPPLY = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + + y += 18; + x = 0; + + ICON_PLASMA_SHIELD = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_SHOCKWAVE = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_LIMB_OVERCLOCKING = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_STEP_ASSIST = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_ENDER_TELEPORT = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_WIRELESS_CHARGING = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + ICON_UNKNOWN = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + + y += 18; + x = 0; + + ICON_EXTENDED_REACH = new SkinElement(ICONS, x, y, 18, 18, 126, 126); + x += 18; + } + + public static final AndroidResearchType AIR_BAGS = + new AndroidResearchBuilder() + .setExperienceCost(18) + .addFeatureResult(AndroidFeatures.AIR_BAGS) + .withDescription() + .withIcon(ICON_AIR_BAGS) + .build(); + + public static final AndroidResearchType EXTENDED_REACH = + new AndroidResearchBuilder() + .setExperienceCost(40) + .addFeatureResult(AndroidFeatures.EXTENDED_REACH) + .withDescription() + .withIcon(ICON_EXTENDED_REACH) + .build(); + + public static final AndroidResearchType[] LIMB_OVERCLOCKING = new AndroidResearchType[4]; + public static final AndroidResearchType[] NANOBOTS_REGENERATION = new AndroidResearchType[4]; + public static final AndroidResearchType[] NANOBOTS_ARMOR_STRENGTH = new AndroidResearchType[3]; + public static final AndroidResearchType[] NANOBOTS_ARMOR_SPEED = new AndroidResearchType[3]; + + public static final AndroidResearchType NANOBOTS = + new AndroidResearchBuilder() + .setExperienceCost(15) + .withDescription() + .withIcon(ICON_NANOBOTS) + .build(); + + public static final AndroidResearchType NANOBOTS_ARMOR = + new AndroidResearchBuilder() + .setExperienceCost(25) + .withDescription() + .addPrerequisite(MNames.NANOBOTS) + .addFeatureResult(MNames.NANOBOTS_ARMOR) + .withIcon(ICON_ARMOR) + .build(); + + static { + AIR_BAGS.setRegistryName(MNames.AIR_BAGS); + NANOBOTS.setRegistryName(MNames.NANOBOTS); + NANOBOTS_ARMOR.setRegistryName(MNames.NANOBOTS_ARMOR); + EXTENDED_REACH.setRegistryName(MNames.EXTENDED_REACH); + + for (int i = 0; i < 4; i++) { + var limbs = new AndroidResearchBuilder() + .setExperienceCost(18 + i * 8) + .withIconText(new TextComponent(String.valueOf(i + 1))) + .withIcon(ICON_LIMB_OVERCLOCKING) + .withName(new TranslatableComponent("android_research.overdrive_that_matters.limb_overclocking", i + 1)) + .withDescription(new TranslatableComponent("android_research.overdrive_that_matters.limb_overclocking.description", (i + 1) * 8, (i + 1) * 6)) + .addFeatureResult(MNames.LIMB_OVERCLOCKING, i); + + var regeneration = new AndroidResearchBuilder() + .setExperienceCost(20 + i * 6) + .withIconText(new TextComponent(String.valueOf(i + 1))) + .withIcon(ICON_NANOBOTS) + .withName(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_regeneration", i + 1)) + .withDescription( + i > 0 ? new TranslatableComponent("android_research.overdrive_that_matters.nanobots_regeneration.description_improve") : new TranslatableComponent("android_research.overdrive_that_matters.nanobots_regeneration.description")) + .addFeatureResult(MNames.NANOBOTS_REGENERATION, i); + + if (i > 0) { + limbs.addPrerequisite(MNames.LIMB_OVERCLOCKING_LIST[i - 1]); + regeneration.addPrerequisite(MNames.NANOBOTS_REGENERATION_LIST[i - 1]); + } else { + regeneration.addPrerequisite(MNames.NANOBOTS); + } + + LIMB_OVERCLOCKING[i] = limbs.build(); + NANOBOTS_REGENERATION[i] = regeneration.build(); + } + + for (int i = 0; i < 3; i++) { + final int level = i + 1; + + NANOBOTS_ARMOR_STRENGTH[i] = new AndroidResearchBuilder() + .setExperienceCost(20 + i * 8) + .withIconText(new TextComponent(String.valueOf(i + 1))) + .withIcon(ICON_ARMOR) + .addPrerequisite(i > 0 ? MNames.NANOBOTS_ARMOR_STRENGTH_LIST[i - 1] : MNames.NANOBOTS_ARMOR) + .withName(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_armor_strength", i + 1)) + .withDescription(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_armor_strength.description", (i + 1) * 8, (i + 1) * 6)) + .addFeatureResult(MNames.NANOBOTS_ARMOR, 0, (feature) -> { + if (((AndroidNanobotsArmor) feature).getStrength() < level) + ((AndroidNanobotsArmor) feature).setStrength(level); + }) + .build(); + + NANOBOTS_ARMOR_SPEED[i] = new AndroidResearchBuilder() + .setExperienceCost(20 + i * 8) + .withIconText(new TextComponent(String.valueOf(i + 1))) + .withIcon(ICON_ARMOR) + .addPrerequisite(i > 0 ? MNames.NANOBOTS_ARMOR_SPEED_LIST[i - 1] : MNames.NANOBOTS_ARMOR) + .withName(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_armor_speed", i + 1)) + .withDescription(new TranslatableComponent("android_research.overdrive_that_matters.nanobots_armor_speed.description", (i + 1) * 8, (i + 1) * 6)) + .addFeatureResult(MNames.NANOBOTS_ARMOR, 0, (feature) -> { + if (((AndroidNanobotsArmor) feature).getSpeed() < level) + ((AndroidNanobotsArmor) feature).setSpeed(level); + }) + .build(); + } + + LIMB_OVERCLOCKING[0].setRegistryName(MNames.LIMB_OVERCLOCKING_1); + LIMB_OVERCLOCKING[1].setRegistryName(MNames.LIMB_OVERCLOCKING_2); + LIMB_OVERCLOCKING[2].setRegistryName(MNames.LIMB_OVERCLOCKING_3); + LIMB_OVERCLOCKING[3].setRegistryName(MNames.LIMB_OVERCLOCKING_4); + + NANOBOTS_ARMOR_SPEED[0].setRegistryName(MNames.NANOBOTS_ARMOR_SPEED_1); + NANOBOTS_ARMOR_SPEED[1].setRegistryName(MNames.NANOBOTS_ARMOR_SPEED_2); + NANOBOTS_ARMOR_SPEED[2].setRegistryName(MNames.NANOBOTS_ARMOR_SPEED_3); + + NANOBOTS_ARMOR_STRENGTH[0].setRegistryName(MNames.NANOBOTS_ARMOR_STRENGTH_1); + NANOBOTS_ARMOR_STRENGTH[1].setRegistryName(MNames.NANOBOTS_ARMOR_STRENGTH_2); + NANOBOTS_ARMOR_STRENGTH[2].setRegistryName(MNames.NANOBOTS_ARMOR_STRENGTH_3); + + NANOBOTS_REGENERATION[0].setRegistryName(MNames.NANOBOTS_REGENERATION_1); + NANOBOTS_REGENERATION[1].setRegistryName(MNames.NANOBOTS_REGENERATION_2); + NANOBOTS_REGENERATION[2].setRegistryName(MNames.NANOBOTS_REGENERATION_3); + NANOBOTS_REGENERATION[3].setRegistryName(MNames.NANOBOTS_REGENERATION_4); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public static void register(final RegistryEvent.Register> event) { + event.getRegistry().register(AIR_BAGS); + event.getRegistry().register(NANOBOTS); + event.getRegistry().register(NANOBOTS_ARMOR); + event.getRegistry().register(EXTENDED_REACH); + + event.getRegistry().register(LIMB_OVERCLOCKING[0]); + event.getRegistry().register(LIMB_OVERCLOCKING[1]); + event.getRegistry().register(LIMB_OVERCLOCKING[2]); + event.getRegistry().register(LIMB_OVERCLOCKING[3]); + + event.getRegistry().register(NANOBOTS_ARMOR_SPEED[0]); + event.getRegistry().register(NANOBOTS_ARMOR_SPEED[1]); + event.getRegistry().register(NANOBOTS_ARMOR_SPEED[2]); + event.getRegistry().register(NANOBOTS_ARMOR_STRENGTH[0]); + event.getRegistry().register(NANOBOTS_ARMOR_STRENGTH[1]); + event.getRegistry().register(NANOBOTS_ARMOR_STRENGTH[2]); + + event.getRegistry().register(NANOBOTS_REGENERATION[0]); + event.getRegistry().register(NANOBOTS_REGENERATION[1]); + event.getRegistry().register(NANOBOTS_REGENERATION[2]); + event.getRegistry().register(NANOBOTS_REGENERATION[3]); + } +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MBlockEntities.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MBlockEntities.java new file mode 100644 index 000000000..865ce4927 --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MBlockEntities.java @@ -0,0 +1,105 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; +import net.minecraft.world.level.block.entity.BlockEntityType; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import ru.dbotthepony.mc.otm.block.entity.*; +import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole; +import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityExplosionDebugger; +import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntitySphereDebugger; +import ru.dbotthepony.mc.otm.client.render.BlackHoleRenderer; +import ru.dbotthepony.mc.otm.client.render.EnergyCounterRenderer; +import ru.dbotthepony.mc.otm.client.render.GravitationStabilizerRenderer; + +public class MBlockEntities { + public static final BlockEntityType ANDROID_STATION = BlockEntityType.Builder.of(BlockEntityAndroidStation::new, MBlocks.ANDROID_STATION).build(null); + public static final BlockEntityType BATTERY_BANK = BlockEntityType.Builder.of(BlockEntityBatteryBank::new, MBlocks.BATTERY_BANK).build(null); + public static final BlockEntityType MATTER_DECOMPOSER = BlockEntityType.Builder.of(BlockEntityMatterDecomposer::new, MBlocks.MATTER_DECOMPOSER).build(null); + public static final BlockEntityType MATTER_CAPACITOR_BANK = BlockEntityType.Builder.of(BlockEntityMatterCapacitorBank::new, MBlocks.MATTER_CAPACITOR_BANK).build(null); + public static final BlockEntityType MATTER_CABLE = BlockEntityType.Builder.of(BlockEntityMatterCable::new, MBlocks.MATTER_CABLE).build(null); + public static final BlockEntityType PATTERN_STORAGE = BlockEntityType.Builder.of(BlockEntityPatternStorage::new, MBlocks.PATTERN_STORAGE).build(null); + public static final BlockEntityType MATTER_SCANNER = BlockEntityType.Builder.of(BlockEntityMatterScanner::new, MBlocks.MATTER_SCANNER).build(null); + public static final BlockEntityType MATTER_PANEL = BlockEntityType.Builder.of(BlockEntityMatterPanel::new, MBlocks.MATTER_PANEL).build(null); + public static final BlockEntityType MATTER_REPLICATOR = BlockEntityType.Builder.of(BlockEntityMatterReplicator::new, MBlocks.MATTER_REPLICATOR).build(null); + public static final BlockEntityType MATTER_BOTTLER = BlockEntityType.Builder.of(BlockEntityMatterBottler::new, MBlocks.MATTER_BOTTLER).build(null); + public static final BlockEntityType DRIVE_VIEWER = BlockEntityType.Builder.of(BlockEntityDriveViewer::new, MBlocks.DRIVE_VIEWER).build(null); + public static final BlockEntityType BLACK_HOLE = BlockEntityType.Builder.of(BlockEntityBlackHole::new, MBlocks.BLACK_HOLE).build(null); + public static final BlockEntityType CARGO_CRATE = BlockEntityType.Builder.of(BlockEntityCargoCrate::new, MBlocks.CARGO_CRATE).build(null); + public static final BlockEntityType DRIVE_RACK = BlockEntityType.Builder.of(BlockEntityDriveRack::new, MBlocks.DRIVE_RACK).build(null); + public static final BlockEntityType ITEM_MONITOR = BlockEntityType.Builder.of(BlockEntityItemMonitor::new, MBlocks.ITEM_MONITOR).build(null); + public static final BlockEntityType ENERGY_COUNTER = BlockEntityType.Builder.of(BlockEntityEnergyCounter::new, MBlocks.ENERGY_COUNTER).build(null); + public static final BlockEntityType CHEMICAL_GENERATOR = BlockEntityType.Builder.of(BlockEntityChemicalGenerator::new, MBlocks.CHEMICAL_GENERATOR).build(null); + public static final BlockEntityType PLATE_PRESS = BlockEntityType.Builder.of(BlockEntityPlatePress::new, MBlocks.PLATE_PRESS).build(null); + public static final BlockEntityType GRAVITATION_STABILIZER = BlockEntityType.Builder.of(BlockEntityGravitationStabilizer::new, MBlocks.GRAVITATION_STABILIZER).build(null); + public static final BlockEntityType MATTER_RECYCLER = BlockEntityType.Builder.of(BlockEntityMatterRecycler::new, MBlocks.MATTER_RECYCLER).build(null); + + public static final BlockEntityType DEBUG_EXPLOSION_SMALL = BlockEntityType.Builder.of(BlockEntityExplosionDebugger::new, MBlocks.DEBUG_EXPLOSION_SMALL).build(null); + public static final BlockEntityType DEBUG_SPHERE_POINTS = BlockEntityType.Builder.of(BlockEntitySphereDebugger::new, MBlocks.DEBUG_SPHERE_POINTS).build(null); + + static { + ANDROID_STATION.setRegistryName(MNames.ANDROID_STATION); + BATTERY_BANK.setRegistryName(MNames.BATTERY_BANK); + MATTER_DECOMPOSER.setRegistryName(MNames.MATTER_DECOMPOSER); + MATTER_CAPACITOR_BANK.setRegistryName(MNames.MATTER_CAPACITOR_BANK); + MATTER_CABLE.setRegistryName(MNames.MATTER_CABLE); + PATTERN_STORAGE.setRegistryName(MNames.PATTERN_STORAGE); + MATTER_SCANNER.setRegistryName(MNames.MATTER_SCANNER); + MATTER_PANEL.setRegistryName(MNames.MATTER_PANEL); + MATTER_REPLICATOR.setRegistryName(MNames.MATTER_REPLICATOR); + MATTER_BOTTLER.setRegistryName(MNames.MATTER_BOTTLER); + DRIVE_VIEWER.setRegistryName(MNames.DRIVE_VIEWER); + BLACK_HOLE.setRegistryName(MNames.BLACK_HOLE); + CARGO_CRATE.setRegistryName(MNames.CARGO_CRATE); + DRIVE_RACK.setRegistryName(MNames.DRIVE_RACK); + ITEM_MONITOR.setRegistryName(MNames.ITEM_MONITOR); + ENERGY_COUNTER.setRegistryName(MNames.ENERGY_COUNTER); + CHEMICAL_GENERATOR.setRegistryName(MNames.CHEMICAL_GENERATOR); + PLATE_PRESS.setRegistryName(MNames.PLATE_PRESS); + GRAVITATION_STABILIZER.setRegistryName(MNames.GRAVITATION_STABILIZER); + MATTER_RECYCLER.setRegistryName(MNames.MATTER_RECYCLER); + + DEBUG_EXPLOSION_SMALL.setRegistryName(MNames.DEBUG_EXPLOSION_SMALL); + DEBUG_SPHERE_POINTS.setRegistryName(MNames.DEBUG_SPHERE_POINTS); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public static void register(final RegistryEvent.Register> event) { + event.getRegistry().register(ANDROID_STATION); + event.getRegistry().register(BATTERY_BANK); + event.getRegistry().register(MATTER_DECOMPOSER); + event.getRegistry().register(MATTER_CAPACITOR_BANK); + event.getRegistry().register(MATTER_CABLE); + event.getRegistry().register(PATTERN_STORAGE); + event.getRegistry().register(MATTER_SCANNER); + event.getRegistry().register(MATTER_PANEL); + event.getRegistry().register(MATTER_REPLICATOR); + event.getRegistry().register(MATTER_BOTTLER); + event.getRegistry().register(DRIVE_VIEWER); + event.getRegistry().register(BLACK_HOLE); + event.getRegistry().register(CARGO_CRATE); + event.getRegistry().register(DRIVE_RACK); + event.getRegistry().register(ITEM_MONITOR); + event.getRegistry().register(ENERGY_COUNTER); + event.getRegistry().register(CHEMICAL_GENERATOR); + event.getRegistry().register(PLATE_PRESS); + event.getRegistry().register(GRAVITATION_STABILIZER); + event.getRegistry().register(MATTER_RECYCLER); + + event.getRegistry().register(DEBUG_EXPLOSION_SMALL); + event.getRegistry().register(DEBUG_SPHERE_POINTS); + + // OverdriveThatMatters.LOGGER.info("Registered block entities"); + } + + + @SubscribeEvent + @SuppressWarnings("unused") + public static void registerRenderers(final FMLClientSetupEvent event) { + BlockEntityRenderers.register(BLACK_HOLE, BlackHoleRenderer::new); + BlockEntityRenderers.register(GRAVITATION_STABILIZER, GravitationStabilizerRenderer::new); + BlockEntityRenderers.register(ENERGY_COUNTER, EnergyCounterRenderer::new); + } +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MBlocks.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MBlocks.java new file mode 100644 index 000000000..b4b0cf57e --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MBlocks.java @@ -0,0 +1,190 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.client.renderer.ItemBlockRenderTypes; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.util.valueproviders.UniformInt; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.OreBlock; +import net.minecraft.world.level.block.SoundType; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.material.MaterialColor; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import ru.dbotthepony.mc.otm.block.*; + +public class MBlocks { + public static final BlockAndroidStation ANDROID_STATION = new BlockAndroidStation(); + public static final BlockBatteryBank BATTERY_BANK = new BlockBatteryBank(); + public static final BlockMatterDecomposer MATTER_DECOMPOSER = new BlockMatterDecomposer(); + public static final BlockMatterCapacitorBank MATTER_CAPACITOR_BANK = new BlockMatterCapacitorBank(); + public static final BlockMatterCable MATTER_CABLE = new BlockMatterCable(); + public static final BlockPatternStorage PATTERN_STORAGE = new BlockPatternStorage(); + public static final BlockMatterScanner MATTER_SCANNER = new BlockMatterScanner(); + public static final BlockMatterPanel MATTER_PANEL = new BlockMatterPanel(); + public static final BlockMatterReplicator MATTER_REPLICATOR = new BlockMatterReplicator(); + public static final BlockMatterBottler MATTER_BOTTLER = new BlockMatterBottler(); + public static final BlockDriveViewer DRIVE_VIEWER = new BlockDriveViewer(); + public static final BlockCargoCrate CARGO_CRATE = new BlockCargoCrate(); + public static final BlockDriveRack DRIVE_RACK = new BlockDriveRack(); + public static final BlockItemMonitor ITEM_MONITOR = new BlockItemMonitor(); + public static final BlockEnergyCounter ENERGY_COUNTER = new BlockEnergyCounter(); + public static final BlockChemicalGenerator CHEMICAL_GENERATOR = new BlockChemicalGenerator(); + public static final BlockPlatePress PLATE_PRESS = new BlockPlatePress(); + public static final BlockMatterRecycler MATTER_RECYCLER = new BlockMatterRecycler(); + + public static final BlockExplosionDebugger DEBUG_EXPLOSION_SMALL = new BlockExplosionDebugger(); + public static final BlockSphereDebugger DEBUG_SPHERE_POINTS = new BlockSphereDebugger(); + + public static final BlockBlackHole BLACK_HOLE = new BlockBlackHole(); + public static final BlockGravitationStabilizer GRAVITATION_STABILIZER = new BlockGravitationStabilizer(); + public static final BlockGravitationStabilizerLens GRAVITATION_STABILIZER_LENS = new BlockGravitationStabilizerLens(); + + public static final Block TRITANIUM_ORE = new OreBlock( + BlockBehaviour.Properties.of(Material.STONE) + .strength(3.25F, 6.0F) + .requiresCorrectToolForDrops(), + UniformInt.of(0, 3) + ); + + public static final Block DEEPSLATE_TRITANIUM_ORE = new OreBlock( + BlockBehaviour.Properties.of(Material.STONE) + .strength(4.75F, 6.5F) + .requiresCorrectToolForDrops(), + UniformInt.of(0, 3) + ); + + public static final Block TRITANIUM_RAW_BLOCK = new Block( + BlockBehaviour.Properties.of(Material.STONE) + .strength(8.0F, 10F) + .requiresCorrectToolForDrops() + ); + + public static final Block[] CRATES = new Block[Registry.CRATES.length]; + + public static final Block TRITANIUM_BLOCK = new Block( + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) + .sound(SoundType.BASALT) + .requiresCorrectToolForDrops() + .explosionResistance(80) + .strength(4) + ); + + public static final Block TRITANIUM_STRIPED_BLOCK = new Block( + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) + .sound(SoundType.BASALT) + .requiresCorrectToolForDrops() + .explosionResistance(80) + .strength(4) + ); + + public static final Block CARBON_FIBRE_BLOCK = new Block( + BlockBehaviour.Properties.of(Material.METAL, MaterialColor.COLOR_LIGHT_BLUE) + .sound(SoundType.BASALT) + .requiresCorrectToolForDrops() + .explosionResistance(40) + .strength(3) + ); + + static { + for (int i = 0; i < Registry.CRATES.length; i++) { + CRATES[i] = new Block(BlockBehaviour.Properties.of(Material.METAL, Registry.CRATES[i].color()) + .sound(SoundType.METAL) + .requiresCorrectToolForDrops() + .strength(5.0F, 6.0F)); + + CRATES[i].setRegistryName(Registry.CRATES[i].name()); + } + + TRITANIUM_ORE.setRegistryName(MNames.TRITANIUM_ORE); + DEEPSLATE_TRITANIUM_ORE.setRegistryName(MNames.DEEPSLATE_TRITANIUM_ORE); + TRITANIUM_RAW_BLOCK.setRegistryName(MNames.TRITANIUM_RAW_BLOCK); + ANDROID_STATION.setRegistryName(MNames.ANDROID_STATION); + BATTERY_BANK.setRegistryName(MNames.BATTERY_BANK); + MATTER_DECOMPOSER.setRegistryName(MNames.MATTER_DECOMPOSER); + MATTER_CAPACITOR_BANK.setRegistryName(MNames.MATTER_CAPACITOR_BANK); + MATTER_CABLE.setRegistryName(MNames.MATTER_CABLE); + PATTERN_STORAGE.setRegistryName(MNames.PATTERN_STORAGE); + MATTER_SCANNER.setRegistryName(MNames.MATTER_SCANNER); + MATTER_PANEL.setRegistryName(MNames.MATTER_PANEL); + MATTER_REPLICATOR.setRegistryName(MNames.MATTER_REPLICATOR); + MATTER_BOTTLER.setRegistryName(MNames.MATTER_BOTTLER); + DRIVE_VIEWER.setRegistryName(MNames.DRIVE_VIEWER); + BLACK_HOLE.setRegistryName(MNames.BLACK_HOLE); + CARGO_CRATE.setRegistryName(MNames.CARGO_CRATE); + DRIVE_RACK.setRegistryName(MNames.DRIVE_RACK); + ITEM_MONITOR.setRegistryName(MNames.ITEM_MONITOR); + ENERGY_COUNTER.setRegistryName(MNames.ENERGY_COUNTER); + CHEMICAL_GENERATOR.setRegistryName(MNames.CHEMICAL_GENERATOR); + PLATE_PRESS.setRegistryName(MNames.PLATE_PRESS); + MATTER_RECYCLER.setRegistryName(MNames.MATTER_RECYCLER); + + GRAVITATION_STABILIZER.setRegistryName(MNames.GRAVITATION_STABILIZER); + GRAVITATION_STABILIZER_LENS.setRegistryName(MNames.GRAVITATION_STABILIZER_LENS); + + DEBUG_EXPLOSION_SMALL.setRegistryName(MNames.DEBUG_EXPLOSION_SMALL); + DEBUG_SPHERE_POINTS.setRegistryName(MNames.DEBUG_SPHERE_POINTS); + + TRITANIUM_BLOCK.setRegistryName(MNames.TRITANIUM_BLOCK); + TRITANIUM_STRIPED_BLOCK.setRegistryName(MNames.TRITANIUM_STRIPED_BLOCK); + CARBON_FIBRE_BLOCK.setRegistryName(MNames.CARBON_FIBRE_BLOCK); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public static void register(final RegistryEvent.Register event) { + event.getRegistry().register(ANDROID_STATION); + event.getRegistry().register(BATTERY_BANK); + event.getRegistry().register(MATTER_DECOMPOSER); + event.getRegistry().register(MATTER_CAPACITOR_BANK); + event.getRegistry().register(MATTER_CABLE); + event.getRegistry().register(PATTERN_STORAGE); + event.getRegistry().register(MATTER_SCANNER); + event.getRegistry().register(MATTER_PANEL); + event.getRegistry().register(MATTER_REPLICATOR); + event.getRegistry().register(MATTER_BOTTLER); + event.getRegistry().register(DRIVE_VIEWER); + event.getRegistry().register(TRITANIUM_BLOCK); + event.getRegistry().register(TRITANIUM_STRIPED_BLOCK); + event.getRegistry().register(CARBON_FIBRE_BLOCK); + event.getRegistry().register(BLACK_HOLE); + event.getRegistry().register(CARGO_CRATE); + event.getRegistry().register(TRITANIUM_ORE); + event.getRegistry().register(DEEPSLATE_TRITANIUM_ORE); + event.getRegistry().register(TRITANIUM_RAW_BLOCK); + event.getRegistry().register(DRIVE_RACK); + event.getRegistry().register(ITEM_MONITOR); + event.getRegistry().register(ENERGY_COUNTER); + event.getRegistry().register(CHEMICAL_GENERATOR); + event.getRegistry().register(PLATE_PRESS); + event.getRegistry().register(GRAVITATION_STABILIZER); + event.getRegistry().register(GRAVITATION_STABILIZER_LENS); + event.getRegistry().register(MATTER_RECYCLER); + + event.getRegistry().register(DEBUG_EXPLOSION_SMALL); + event.getRegistry().register(DEBUG_SPHERE_POINTS); + + for (var crate : CRATES) { + event.getRegistry().register(crate); + } + + for (var glass : Registry.INDUSTRIAL_GLASS_LIST) { + event.getRegistry().register(glass.block()); + event.getRegistry().register(glass.pane()); + } + + // OverdriveThatMatters.LOGGER.info("Registered blocks"); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public static void registerClient(final FMLClientSetupEvent event) { + final var translucent = RenderType.translucent(); + + for (var glass : Registry.INDUSTRIAL_GLASS_LIST) { + ItemBlockRenderTypes.setRenderLayer(glass.block(), translucent); + ItemBlockRenderTypes.setRenderLayer(glass.pane(), translucent); + } + } +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MItems.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MItems.java new file mode 100644 index 000000000..0a4393fa3 --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MItems.java @@ -0,0 +1,407 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.ChatFormatting; +import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.tags.BlockTags; +import net.minecraft.world.entity.EquipmentSlot; +import net.minecraft.world.food.FoodProperties; +import net.minecraft.world.item.*; +import net.minecraft.world.item.crafting.Ingredient; +import net.minecraft.world.level.Level; +import net.minecraftforge.common.ForgeTier; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import org.jetbrains.annotations.Nullable; +import ru.dbotthepony.mc.otm.OverdriveThatMatters; +import ru.dbotthepony.mc.otm.core.ImpreciseFraction; +import ru.dbotthepony.mc.otm.item.*; + +import javax.annotation.Nonnull; +import java.util.ConcurrentModificationException; +import java.util.List; + +public class MItems { + static { + if (OverdriveThatMatters.CREATIVE_TAB == null) { + throw new ConcurrentModificationException("Accessing Registry before OverdriveThatMatters class is initialized. This is not supported! If no other mods are installed this is a bug."); + } + } + + private static final Item.Properties DEFAULT_PROPERTIES = new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB); + + public static final BlockItem ANDROID_STATION = new BlockItem(MBlocks.ANDROID_STATION, DEFAULT_PROPERTIES); + public static final BlockItem BATTERY_BANK = new BlockItem(MBlocks.BATTERY_BANK, DEFAULT_PROPERTIES); + public static final BlockItem MATTER_DECOMPOSER = new BlockItem(MBlocks.MATTER_DECOMPOSER, DEFAULT_PROPERTIES); + public static final BlockItem MATTER_CAPACITOR_BANK = new BlockItem(MBlocks.MATTER_CAPACITOR_BANK, DEFAULT_PROPERTIES); + public static final BlockItem MATTER_CABLE = new BlockItem(MBlocks.MATTER_CABLE, DEFAULT_PROPERTIES); + public static final BlockItem PATTERN_STORAGE = new BlockItem(MBlocks.PATTERN_STORAGE, DEFAULT_PROPERTIES); + public static final BlockItem MATTER_SCANNER = new BlockItem(MBlocks.MATTER_SCANNER, DEFAULT_PROPERTIES); + public static final BlockItem MATTER_PANEL = new BlockItem(MBlocks.MATTER_PANEL, DEFAULT_PROPERTIES); + public static final BlockItem MATTER_REPLICATOR = new BlockItem(MBlocks.MATTER_REPLICATOR, DEFAULT_PROPERTIES); + public static final BlockItem MATTER_BOTTLER = new BlockItem(MBlocks.MATTER_BOTTLER, DEFAULT_PROPERTIES); + public static final BlockItem DRIVE_VIEWER = new BlockItem(MBlocks.DRIVE_VIEWER, DEFAULT_PROPERTIES); + public static final BlockItem CARGO_CRATE = new BlockItem(MBlocks.CARGO_CRATE, DEFAULT_PROPERTIES); + public static final BlockItem TRITANIUM_ORE = new BlockItem(MBlocks.TRITANIUM_ORE, DEFAULT_PROPERTIES); + public static final BlockItem DEEPSLATE_TRITANIUM_ORE = new BlockItem(MBlocks.DEEPSLATE_TRITANIUM_ORE, DEFAULT_PROPERTIES); + public static final BlockItem TRITANIUM_RAW_BLOCK = new BlockItem(MBlocks.TRITANIUM_RAW_BLOCK, DEFAULT_PROPERTIES); + public static final BlockItem DRIVE_RACK = new BlockItem(MBlocks.DRIVE_RACK, DEFAULT_PROPERTIES); + public static final BlockItem ITEM_MONITOR = new BlockItem(MBlocks.ITEM_MONITOR, DEFAULT_PROPERTIES); + public static final BlockItem ENERGY_COUNTER = new BlockItem(MBlocks.ENERGY_COUNTER, DEFAULT_PROPERTIES); + public static final BlockItem CHEMICAL_GENERATOR = new BlockItem(MBlocks.CHEMICAL_GENERATOR, DEFAULT_PROPERTIES); + public static final BlockItem PLATE_PRESS = new BlockItem(MBlocks.PLATE_PRESS, DEFAULT_PROPERTIES); + public static final BlockItem MATTER_RECYCLER = new BlockItem(MBlocks.MATTER_RECYCLER, DEFAULT_PROPERTIES); + public static final BlockItem GRAVITATION_STABILIZER = new BlockItem(MBlocks.GRAVITATION_STABILIZER, DEFAULT_PROPERTIES) { + @Override + public void appendHoverText(@Nonnull ItemStack p_40572_, @Nullable Level p_40573_, @Nonnull List p_40574_, @Nonnull TooltipFlag p_40575_) { + super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_); + + p_40574_.add(new TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer.desc").withStyle(ChatFormatting.GRAY)); + p_40574_.add(new TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer.desc2").withStyle(ChatFormatting.DARK_GRAY)); + p_40574_.add(new TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer.desc3").withStyle(ChatFormatting.DARK_GRAY)); + p_40574_.add(new TranslatableComponent("block.overdrive_that_matters.gravitation_stabilizer.desc4").withStyle(ChatFormatting.DARK_GRAY)); + } + }; + + public static final BlockItem DEBUG_EXPLOSION_SMALL = new BlockItem(MBlocks.DEBUG_EXPLOSION_SMALL, DEFAULT_PROPERTIES); + public static final BlockItem DEBUG_SPHERE_POINTS = new BlockItem(MBlocks.DEBUG_SPHERE_POINTS, DEFAULT_PROPERTIES); + + public static final ItemMatterDust MATTER_DUST = new ItemMatterDust(); + + public static final Item TRITANIUM_ORE_CLUMP = new Item(DEFAULT_PROPERTIES); + public static final Item TRITANIUM_INGOT = new Item(DEFAULT_PROPERTIES); + + public static final ForgeTier TRITANIUM_COMPONENT; + + static { + final var component = Ingredient.of(TRITANIUM_INGOT); + + TRITANIUM_COMPONENT = new ForgeTier( + Tiers.IRON.getLevel(), + 3072, + Tiers.IRON.getSpeed() * 1.1f, + 3.5f, + 16, + BlockTags.NEEDS_IRON_TOOL, + () -> component + ); + } + + private static final Item.Properties TOOLS_PROPRTIES = new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB); + public static final SwordItem TRITANIUM_SWORD = new SwordItem(TRITANIUM_COMPONENT, 4, -2.7f, TOOLS_PROPRTIES); + public static final ShovelItem TRITANIUM_SHOVEL = new ShovelItem(TRITANIUM_COMPONENT, 1.5f, -2.4f, TOOLS_PROPRTIES); + public static final AxeItem TRITANIUM_AXE = new AxeItem(TRITANIUM_COMPONENT, 8.5f, -3.4f, TOOLS_PROPRTIES); + public static final PickaxeItem TRITANIUM_PICKAXE = new PickaxeItem(TRITANIUM_COMPONENT, 2, -2.8f, TOOLS_PROPRTIES); + public static final HoeItem TRITANIUM_HOE = new HoeItem(TRITANIUM_COMPONENT, 0, -3.4f, TOOLS_PROPRTIES); + + public static final Item[] TRITANIUM_TOOLS = new Item[]{ + TRITANIUM_SWORD, + TRITANIUM_SHOVEL, + TRITANIUM_AXE, + TRITANIUM_PICKAXE, + TRITANIUM_HOE + }; + + public static final ItemTritaniumArmor TRITANIUM_HELMET = new ItemTritaniumArmor(EquipmentSlot.HEAD); + public static final ItemTritaniumArmor TRITANIUM_CHESTPLATE = new ItemTritaniumArmor(EquipmentSlot.CHEST); + public static final ItemTritaniumArmor TRITANIUM_PANTS = new ItemTritaniumArmor(EquipmentSlot.LEGS); + public static final ItemTritaniumArmor TRITANIUM_BOOTS = new ItemTritaniumArmor(EquipmentSlot.FEET); + + public static final Item[] TRITANIUM_ARMOR = new Item[]{ + TRITANIUM_HELMET, + TRITANIUM_CHESTPLATE, + TRITANIUM_PANTS, + TRITANIUM_BOOTS + }; + + public static final Item MATTER_IO_PORT = new Item(DEFAULT_PROPERTIES); + public static final Item MATTER_TRANSFORM_MATRIX = new Item(DEFAULT_PROPERTIES); + public static final Item ENERGY_BUS = new Item(DEFAULT_PROPERTIES); + public static final Item ELECTRIC_PARTS = new Item(DEFAULT_PROPERTIES); + public static final Item MACHINE_FRAME = new Item(DEFAULT_PROPERTIES); + public static final Item TRITANIUM_PLATE = new Item(DEFAULT_PROPERTIES); + public static final Item IRON_PLATE = new Item(DEFAULT_PROPERTIES); + public static final Item COPPER_WIRING = new Item(DEFAULT_PROPERTIES); + public static final Item GOLD_WIRING = new Item(DEFAULT_PROPERTIES); + public static final Item PORTABLE_CONDENSATION_DRIVE_CASING = new Item(DEFAULT_PROPERTIES); + public static final Item PORTABLE_DENSE_CONDENSATION_DRIVE_CASING = new Item(DEFAULT_PROPERTIES); + public static final Item CIRCUIT_PLATING = new Item(DEFAULT_PROPERTIES); + public static final Item BASIC_CONTROL_CIRCUIT = new Item(DEFAULT_PROPERTIES); + public static final Item ADVANCED_CONTROL_CIRCUIT = new Item(DEFAULT_PROPERTIES); + + public static final Item BLACK_HOLE_SCANNER = new Item(DEFAULT_PROPERTIES) { + @Override + public void appendHoverText(@Nonnull ItemStack p_40572_, @Nullable Level p_40573_, @Nonnull List p_40574_, @Nonnull TooltipFlag p_40575_) { + super.appendHoverText(p_40572_, p_40573_, p_40574_, p_40575_); + + p_40574_.add(new TranslatableComponent("item.overdrive_that_matters.black_hole_scanner.desc").withStyle(ChatFormatting.GRAY)); + p_40574_.add(new TranslatableComponent("item.overdrive_that_matters.black_hole_scanner.desc2").withStyle(ChatFormatting.DARK_GRAY)); + } + }; + public static final Item GRAVITATION_FIELD_LIMITER = new Item(DEFAULT_PROPERTIES); + public static final Item GRAVITATION_FIELD_SENSOR = new Item(DEFAULT_PROPERTIES); + public static final ItemPortableGravitationStabilizer PORTABLE_GRAVITATION_STABILIZER = new ItemPortableGravitationStabilizer(); + + public static final BlockItem BLACK_HOLE = new BlockItem(MBlocks.BLACK_HOLE, DEFAULT_PROPERTIES); + + public static final ItemGravitationalDisruptor GRAVITATIONAL_DISRUPTOR = new ItemGravitationalDisruptor(); + + public static final ItemPill PILL_ANDROID = new ItemPill(PillType.BECOME_ANDROID); + public static final ItemPill PILL_HUMANE = new ItemPill(PillType.BECOME_HUMANE); + public static final ItemPill PILL_OBLIVION = new ItemPill(PillType.OBLIVION); + public static final ItemPillHeal PILL_HEAL = new ItemPillHeal(); + + public static final ItemBattery BATTERY_CRUDE = new ItemBattery(new ImpreciseFraction(30_000), new ImpreciseFraction(150), new ImpreciseFraction(150)); + public static final ItemBattery BATTERY_BASIC = new ItemBattery(new ImpreciseFraction(60_000), new ImpreciseFraction(300), new ImpreciseFraction(300)); + public static final ItemBattery BATTERY_NORMAL = new ItemBattery(new ImpreciseFraction(250_000), new ImpreciseFraction(1000), new ImpreciseFraction(1000)); + public static final ItemBattery BATTERY_DENSE = new ItemBattery(new ImpreciseFraction(1_000_000), new ImpreciseFraction(2000), new ImpreciseFraction(2000)); + public static final ItemBattery BATTERY_CAPACITOR = new ItemBattery(new ImpreciseFraction(150_000), new ImpreciseFraction(15000), new ImpreciseFraction(15000)); + public static final ItemBattery BATTERY_CREATIVE = new ItemBattery(); + + public static final ItemBattery[] BATTERIES = { + BATTERY_CRUDE, + BATTERY_BASIC, + BATTERY_NORMAL, + BATTERY_DENSE, + BATTERY_CAPACITOR, + }; + + public static final Item MATTER_CAPACITOR_PARTS = new Item(new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); + + public static final Item[] DATAGEN_COMPONENTS = { + ENERGY_BUS, + ELECTRIC_PARTS, + TRITANIUM_PLATE, + IRON_PLATE, + COPPER_WIRING, + GOLD_WIRING, + CIRCUIT_PLATING, + BASIC_CONTROL_CIRCUIT, + ADVANCED_CONTROL_CIRCUIT, + MATTER_CAPACITOR_PARTS, + MATTER_IO_PORT, + MATTER_TRANSFORM_MATRIX, + }; + + public static final ItemMatterCapacitor MATTER_CAPACITOR_BASIC = new ItemMatterCapacitor(new ImpreciseFraction("4")); + public static final ItemMatterCapacitor MATTER_CAPACITOR_NORMAL = new ItemMatterCapacitor(new ImpreciseFraction("10")); + public static final ItemMatterCapacitor MATTER_CAPACITOR_DENSE = new ItemMatterCapacitor(new ImpreciseFraction("40")); + public static final ItemMatterCapacitor MATTER_CAPACITOR_CREATIVE = new ItemMatterCapacitor(); + + public static final ItemPatternStorage PATTERN_DRIVE_NORMAL = new ItemPatternStorage(4); + public static final ItemPatternStorage PATTERN_DRIVE_CREATIVE = new ItemPatternStorage(); + + public static final ItemPortableCondensationDrive PORTABLE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(4000); + public static final ItemPortableCondensationDrive PORTABLE_DENSE_CONDENSATION_DRIVE = new ItemPortableCondensationDrive(25000); + + public static final Item NUTRIENT_PASTE = new Item(new Item.Properties().stacksTo(64).food(new FoodProperties.Builder().meat().nutrition(8).saturationMod(0.9F).build()).tab(OverdriveThatMatters.CREATIVE_TAB)); + + public static final Item[] CRATES = new Item[Registry.CRATES.length]; + + public static final Item TRITANIUM_BLOCK = new BlockItem(MBlocks.TRITANIUM_BLOCK, DEFAULT_PROPERTIES); + public static final Item TRITANIUM_STRIPED_BLOCK = new BlockItem(MBlocks.TRITANIUM_STRIPED_BLOCK, DEFAULT_PROPERTIES); + public static final Item CARBON_FIBRE_BLOCK = new BlockItem(MBlocks.CARBON_FIBRE_BLOCK, DEFAULT_PROPERTIES); + + static { + for (int i = 0; i < Registry.CRATES.length; i++) { + CRATES[i] = new BlockItem(MBlocks.CRATES[i], new Item.Properties().stacksTo(64).tab(OverdriveThatMatters.CREATIVE_TAB)); + CRATES[i].setRegistryName(Registry.CRATES[i].name()); + } + + ANDROID_STATION.setRegistryName(MNames.ANDROID_STATION); + BATTERY_BANK.setRegistryName(MNames.BATTERY_BANK); + MATTER_DECOMPOSER.setRegistryName(MNames.MATTER_DECOMPOSER); + MATTER_CAPACITOR_BANK.setRegistryName(MNames.MATTER_CAPACITOR_BANK); + MATTER_CABLE.setRegistryName(MNames.MATTER_CABLE); + PATTERN_STORAGE.setRegistryName(MNames.PATTERN_STORAGE); + MATTER_SCANNER.setRegistryName(MNames.MATTER_SCANNER); + MATTER_PANEL.setRegistryName(MNames.MATTER_PANEL); + MATTER_REPLICATOR.setRegistryName(MNames.MATTER_REPLICATOR); + MATTER_BOTTLER.setRegistryName(MNames.MATTER_BOTTLER); + DRIVE_VIEWER.setRegistryName(MNames.DRIVE_VIEWER); + BLACK_HOLE.setRegistryName(MNames.BLACK_HOLE); + CARGO_CRATE.setRegistryName(MNames.CARGO_CRATE); + DRIVE_RACK.setRegistryName(MNames.DRIVE_RACK); + ITEM_MONITOR.setRegistryName(MNames.ITEM_MONITOR); + ENERGY_COUNTER.setRegistryName(MNames.ENERGY_COUNTER); + CHEMICAL_GENERATOR.setRegistryName(MNames.CHEMICAL_GENERATOR); + PLATE_PRESS.setRegistryName(MNames.PLATE_PRESS); + GRAVITATION_STABILIZER.setRegistryName(MNames.GRAVITATION_STABILIZER); + MATTER_RECYCLER.setRegistryName(MNames.MATTER_RECYCLER); + MATTER_DUST.setRegistryName(MNames.MATTER_DUST); + + DEBUG_EXPLOSION_SMALL.setRegistryName(MNames.DEBUG_EXPLOSION_SMALL); + DEBUG_SPHERE_POINTS.setRegistryName(MNames.DEBUG_SPHERE_POINTS); + + TRITANIUM_ORE.setRegistryName(MNames.TRITANIUM_ORE); + DEEPSLATE_TRITANIUM_ORE.setRegistryName(MNames.DEEPSLATE_TRITANIUM_ORE); + TRITANIUM_RAW_BLOCK.setRegistryName(MNames.TRITANIUM_RAW_BLOCK); + TRITANIUM_ORE_CLUMP.setRegistryName(MNames.TRITANIUM_ORE_CLUMP); + TRITANIUM_INGOT.setRegistryName(MNames.TRITANIUM_INGOT); + MATTER_IO_PORT.setRegistryName(MNames.MATTER_IO_PORT); + MATTER_TRANSFORM_MATRIX.setRegistryName(MNames.MATTER_TRANSFORM_MATRIX); + ENERGY_BUS.setRegistryName(MNames.ENERGY_BUS); + ELECTRIC_PARTS.setRegistryName(MNames.ELECTRIC_PARTS); + MACHINE_FRAME.setRegistryName(MNames.MACHINE_FRAME); + TRITANIUM_PLATE.setRegistryName(MNames.TRITANIUM_PLATE); + IRON_PLATE.setRegistryName(MNames.IRON_PLATE); + COPPER_WIRING.setRegistryName(MNames.COPPER_WIRING); + GOLD_WIRING.setRegistryName(MNames.GOLD_WIRING); + PORTABLE_CONDENSATION_DRIVE_CASING.setRegistryName(MNames.PORTABLE_CONDENSATION_DRIVE_CASING); + PORTABLE_DENSE_CONDENSATION_DRIVE_CASING.setRegistryName(MNames.PORTABLE_DENSE_CONDENSATION_DRIVE_CASING); + CIRCUIT_PLATING.setRegistryName(MNames.CIRCUIT_PLATING); + BASIC_CONTROL_CIRCUIT.setRegistryName(MNames.BASIC_CONTROL_CIRCUIT); + ADVANCED_CONTROL_CIRCUIT.setRegistryName(MNames.ADVANCED_CONTROL_CIRCUIT); + + BLACK_HOLE_SCANNER.setRegistryName(MNames.BLACK_HOLE_SCANNER); + GRAVITATION_FIELD_LIMITER.setRegistryName(MNames.GRAVITATION_FIELD_LIMITER); + GRAVITATION_FIELD_SENSOR.setRegistryName(MNames.GRAVITATION_FIELD_SENSOR); + PORTABLE_GRAVITATION_STABILIZER.setRegistryName(MNames.PORTABLE_GRAVITATION_STABILIZER); + + GRAVITATIONAL_DISRUPTOR.setRegistryName(MNames.GRAVITATIONAL_DISRUPTOR); + PILL_ANDROID.setRegistryName(MNames.PILL_ANDROID); + PILL_HUMANE.setRegistryName(MNames.PILL_HUMANE); + PILL_OBLIVION.setRegistryName(MNames.PILL_OBLIVION); + PILL_HEAL.setRegistryName(MNames.PILL_HEAL); + BATTERY_CRUDE.setRegistryName(MNames.BATTERY_CRUDE); + BATTERY_BASIC.setRegistryName(MNames.BATTERY_BASIC); + BATTERY_NORMAL.setRegistryName(MNames.BATTERY_NORMAL); + BATTERY_DENSE.setRegistryName(MNames.BATTERY_DENSE); + BATTERY_CAPACITOR.setRegistryName(MNames.BATTERY_CAPACITOR); + BATTERY_CREATIVE.setRegistryName(MNames.BATTERY_CREATIVE); + + MATTER_CAPACITOR_PARTS.setRegistryName(MNames.MATTER_CAPACITOR_PARTS); + MATTER_CAPACITOR_BASIC.setRegistryName(MNames.MATTER_CAPACITOR_BASIC); + MATTER_CAPACITOR_NORMAL.setRegistryName(MNames.MATTER_CAPACITOR_NORMAL); + MATTER_CAPACITOR_DENSE.setRegistryName(MNames.MATTER_CAPACITOR_DENSE); + MATTER_CAPACITOR_CREATIVE.setRegistryName(MNames.MATTER_CAPACITOR_CREATIVE); + + PATTERN_DRIVE_NORMAL.setRegistryName(MNames.PATTERN_DRIVE_NORMAL); + PATTERN_DRIVE_CREATIVE.setRegistryName(MNames.PATTERN_DRIVE_CREATIVE); + PORTABLE_CONDENSATION_DRIVE.setRegistryName(MNames.PORTABLE_CONDENSATION_DRIVE); + PORTABLE_DENSE_CONDENSATION_DRIVE.setRegistryName(MNames.PORTABLE_DENSE_CONDENSATION_DRIVE); + + NUTRIENT_PASTE.setRegistryName(MNames.NUTRIENT_PASTE); + + TRITANIUM_BLOCK.setRegistryName(MNames.TRITANIUM_BLOCK); + TRITANIUM_STRIPED_BLOCK.setRegistryName(MNames.TRITANIUM_STRIPED_BLOCK); + CARBON_FIBRE_BLOCK.setRegistryName(MNames.CARBON_FIBRE_BLOCK); + + TRITANIUM_SWORD.setRegistryName(MNames.TRITANIUM_SWORD); + TRITANIUM_PICKAXE.setRegistryName(MNames.TRITANIUM_PICKAXE); + TRITANIUM_SHOVEL.setRegistryName(MNames.TRITANIUM_SHOVEL); + TRITANIUM_AXE.setRegistryName(MNames.TRITANIUM_AXE); + TRITANIUM_HOE.setRegistryName(MNames.TRITANIUM_HOE); + + TRITANIUM_HELMET.setRegistryName(MNames.TRITANIUM_HELMET); + TRITANIUM_CHESTPLATE.setRegistryName(MNames.TRITANIUM_CHESTPLATE); + TRITANIUM_PANTS.setRegistryName(MNames.TRITANIUM_PANTS); + TRITANIUM_BOOTS.setRegistryName(MNames.TRITANIUM_BOOTS); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public static void register(final RegistryEvent.Register event) { + event.getRegistry().register(ANDROID_STATION); + event.getRegistry().register(BATTERY_BANK); + event.getRegistry().register(MATTER_DECOMPOSER); + event.getRegistry().register(MATTER_CAPACITOR_BANK); + event.getRegistry().register(MATTER_CABLE); + event.getRegistry().register(PATTERN_STORAGE); + event.getRegistry().register(MATTER_SCANNER); + event.getRegistry().register(MATTER_PANEL); + event.getRegistry().register(MATTER_REPLICATOR); + event.getRegistry().register(MATTER_BOTTLER); + event.getRegistry().register(DRIVE_VIEWER); + event.getRegistry().register(BLACK_HOLE); + event.getRegistry().register(CARGO_CRATE); + event.getRegistry().register(DRIVE_RACK); + event.getRegistry().register(ITEM_MONITOR); + event.getRegistry().register(ENERGY_COUNTER); + event.getRegistry().register(CHEMICAL_GENERATOR); + event.getRegistry().register(PLATE_PRESS); + event.getRegistry().register(GRAVITATION_STABILIZER); + event.getRegistry().register(MATTER_DUST); + event.getRegistry().register(MATTER_RECYCLER); + + event.getRegistry().register(DEBUG_EXPLOSION_SMALL); + event.getRegistry().register(DEBUG_SPHERE_POINTS); + + event.getRegistry().register(TRITANIUM_ORE); + event.getRegistry().register(DEEPSLATE_TRITANIUM_ORE); + event.getRegistry().register(TRITANIUM_RAW_BLOCK); + + event.getRegistry().register(TRITANIUM_ORE_CLUMP); + event.getRegistry().register(TRITANIUM_INGOT); + event.getRegistry().register(MATTER_IO_PORT); + event.getRegistry().register(MATTER_TRANSFORM_MATRIX); + event.getRegistry().register(ENERGY_BUS); + event.getRegistry().register(ELECTRIC_PARTS); + event.getRegistry().register(MACHINE_FRAME); + event.getRegistry().register(TRITANIUM_PLATE); + event.getRegistry().register(IRON_PLATE); + event.getRegistry().register(COPPER_WIRING); + event.getRegistry().register(GOLD_WIRING); + event.getRegistry().register(PORTABLE_CONDENSATION_DRIVE_CASING); + event.getRegistry().register(PORTABLE_DENSE_CONDENSATION_DRIVE_CASING); + event.getRegistry().register(CIRCUIT_PLATING); + event.getRegistry().register(BASIC_CONTROL_CIRCUIT); + event.getRegistry().register(ADVANCED_CONTROL_CIRCUIT); + + event.getRegistry().register(BLACK_HOLE_SCANNER); + event.getRegistry().register(GRAVITATION_FIELD_LIMITER); + event.getRegistry().register(GRAVITATION_FIELD_SENSOR); + event.getRegistry().register(PORTABLE_GRAVITATION_STABILIZER); + + event.getRegistry().register(GRAVITATIONAL_DISRUPTOR); + event.getRegistry().register(PILL_ANDROID); + event.getRegistry().register(PILL_HUMANE); + event.getRegistry().register(PILL_OBLIVION); + event.getRegistry().register(PILL_HEAL); + event.getRegistry().register(BATTERY_CRUDE); + event.getRegistry().register(BATTERY_BASIC); + event.getRegistry().register(BATTERY_NORMAL); + event.getRegistry().register(BATTERY_DENSE); + event.getRegistry().register(BATTERY_CAPACITOR); + event.getRegistry().register(BATTERY_CREATIVE); + + event.getRegistry().register(MATTER_CAPACITOR_PARTS); + event.getRegistry().register(MATTER_CAPACITOR_BASIC); + event.getRegistry().register(MATTER_CAPACITOR_NORMAL); + event.getRegistry().register(MATTER_CAPACITOR_DENSE); + event.getRegistry().register(MATTER_CAPACITOR_CREATIVE); + + event.getRegistry().register(PATTERN_DRIVE_NORMAL); + event.getRegistry().register(PATTERN_DRIVE_CREATIVE); + event.getRegistry().register(PORTABLE_CONDENSATION_DRIVE); + event.getRegistry().register(PORTABLE_DENSE_CONDENSATION_DRIVE); + + event.getRegistry().register(NUTRIENT_PASTE); + + event.getRegistry().register(TRITANIUM_BLOCK); + event.getRegistry().register(TRITANIUM_STRIPED_BLOCK); + event.getRegistry().register(CARBON_FIBRE_BLOCK); + + for (var crate : CRATES) { + event.getRegistry().register(crate); + } + + for (var glass : Registry.INDUSTRIAL_GLASS_LIST) { + event.getRegistry().register(glass.item()); + event.getRegistry().register(glass.paneItem()); + } + + event.getRegistry().register(TRITANIUM_SWORD); + event.getRegistry().register(TRITANIUM_SHOVEL); + event.getRegistry().register(TRITANIUM_AXE); + event.getRegistry().register(TRITANIUM_PICKAXE); + event.getRegistry().register(TRITANIUM_HOE); + + event.getRegistry().register(TRITANIUM_HELMET); + event.getRegistry().register(TRITANIUM_CHESTPLATE); + event.getRegistry().register(TRITANIUM_PANTS); + event.getRegistry().register(TRITANIUM_BOOTS); + + // OverdriveThatMatters.LOGGER.info("Registered items"); + } +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MMenus.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MMenus.java new file mode 100644 index 000000000..4894ff41d --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MMenus.java @@ -0,0 +1,97 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.client.gui.screens.MenuScreens; +import net.minecraft.world.inventory.MenuType; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import ru.dbotthepony.mc.otm.client.screen.*; +import ru.dbotthepony.mc.otm.menu.*; + +public class MMenus { + public static final MenuType ANDROID_STATION = new MenuType<>(AndroidStationMenu::new); + public static final MenuType BATTERY_BANK = new MenuType<>(MenuBatteryBank::new); + public static final MenuType MATTER_DECOMPOSER = new MenuType<>(MenuMatterDecomposer::new); + public static final MenuType MATTER_CAPACITOR_BANK = new MenuType<>(MenuMatterCapacitor::new); + public static final MenuType PATTERN_STORAGE = new MenuType<>(MenuPatternStorage::new); + public static final MenuType MATTER_SCANNER = new MenuType<>(MenuMatterScanner::new); + public static final MenuType MATTER_PANEL = new MenuType<>(MenuMatterPanel::new); + public static final MenuType MATTER_REPLICATOR = new MenuType<>(MenuMatterReplicator::new); + public static final MenuType MATTER_BOTTLER = new MenuType<>(MenuMatterBottler::new); + public static final MenuType DRIVE_VIEWER = new MenuType<>(MenuDriveViewer::new); + public static final MenuType CARGO_CRATE = new MenuType<>(MenuCargoCrate::new); + public static final MenuType DRIVE_RACK = new MenuType<>(MenuDriveRack::new); + public static final MenuType ITEM_MONITOR = new MenuType<>(MenuItemMonitor::new); + public static final MenuType ENERGY_COUNTER = new MenuType<>(MenuEnergyCounter::new); + public static final MenuType CHEMICAL_GENERATOR = new MenuType<>(MenuChemicalGenerator::new); + public static final MenuType PLATE_PRESS = new MenuType<>(MenuPlatePress::new); + public static final MenuType MATTER_RECYCLER = new MenuType<>(MenuMatterRecycler::new); + + static { + ANDROID_STATION.setRegistryName(MNames.ANDROID_STATION); + BATTERY_BANK.setRegistryName(MNames.BATTERY_BANK); + MATTER_DECOMPOSER.setRegistryName(MNames.MATTER_DECOMPOSER); + MATTER_CAPACITOR_BANK.setRegistryName(MNames.MATTER_CAPACITOR_BANK); + PATTERN_STORAGE.setRegistryName(MNames.PATTERN_STORAGE); + MATTER_SCANNER.setRegistryName(MNames.MATTER_SCANNER); + MATTER_PANEL.setRegistryName(MNames.MATTER_PANEL); + MATTER_REPLICATOR.setRegistryName(MNames.MATTER_REPLICATOR); + MATTER_BOTTLER.setRegistryName(MNames.MATTER_BOTTLER); + DRIVE_VIEWER.setRegistryName(MNames.DRIVE_VIEWER); + CARGO_CRATE.setRegistryName(MNames.CARGO_CRATE); + DRIVE_RACK.setRegistryName(MNames.DRIVE_RACK); + ITEM_MONITOR.setRegistryName(MNames.ITEM_MONITOR); + ENERGY_COUNTER.setRegistryName(MNames.ENERGY_COUNTER); + CHEMICAL_GENERATOR.setRegistryName(MNames.CHEMICAL_GENERATOR); + PLATE_PRESS.setRegistryName(MNames.PLATE_PRESS); + MATTER_RECYCLER.setRegistryName(MNames.MATTER_RECYCLER); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public static void register(final RegistryEvent.Register> event) { + event.getRegistry().register(ANDROID_STATION); + event.getRegistry().register(BATTERY_BANK); + event.getRegistry().register(MATTER_DECOMPOSER); + event.getRegistry().register(MATTER_CAPACITOR_BANK); + event.getRegistry().register(PATTERN_STORAGE); + event.getRegistry().register(MATTER_SCANNER); + event.getRegistry().register(MATTER_PANEL); + event.getRegistry().register(MATTER_REPLICATOR); + event.getRegistry().register(MATTER_BOTTLER); + event.getRegistry().register(DRIVE_VIEWER); + event.getRegistry().register(CARGO_CRATE); + event.getRegistry().register(DRIVE_RACK); + event.getRegistry().register(ITEM_MONITOR); + event.getRegistry().register(ENERGY_COUNTER); + event.getRegistry().register(CHEMICAL_GENERATOR); + event.getRegistry().register(PLATE_PRESS); + event.getRegistry().register(MATTER_RECYCLER); + + // OverdriveThatMatters.LOGGER.info("Registered menus"); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public static void registerScreens(final FMLClientSetupEvent event) { + MenuScreens.register(ANDROID_STATION, ScreenAndroidStation::new); + MenuScreens.register(BATTERY_BANK, ScreenBatteryBank::new); + MenuScreens.register(MATTER_DECOMPOSER, ScreenMatterDecomposer::new); + MenuScreens.register(MATTER_CAPACITOR_BANK, ScreenMatterCapacitorBank::new); + MenuScreens.register(PATTERN_STORAGE, ScreenPatternStorage::new); + MenuScreens.register(MATTER_SCANNER, ScreenMatterScanner::new); + MenuScreens.register(MATTER_PANEL, MatterPanelScreen::new); + MenuScreens.register(MATTER_REPLICATOR, ScreenMatterReplicator::new); + MenuScreens.register(MATTER_BOTTLER, ScreenMatterBottler::new); + MenuScreens.register(DRIVE_VIEWER, ScreenDriveViewer::new); + MenuScreens.register(CARGO_CRATE, ScreenCargoCrate::new); + MenuScreens.register(DRIVE_RACK, ScreenDriveRack::new); + MenuScreens.register(ITEM_MONITOR, ScreenItemMonitor::new); + MenuScreens.register(ENERGY_COUNTER, ScreenEnergyCounter::new); + MenuScreens.register(CHEMICAL_GENERATOR, ScreenChemicalGenerator::new); + MenuScreens.register(PLATE_PRESS, ScreenPlatePress::new); + MenuScreens.register(MATTER_RECYCLER, ScreenMatterRecycler::new); + + // OverdriveThatMatters.LOGGER.info("Registered screens"); + } +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MNames.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MNames.java new file mode 100644 index 000000000..bc8cdb1da --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MNames.java @@ -0,0 +1,173 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.resources.ResourceLocation; +import ru.dbotthepony.mc.otm.OverdriveThatMatters; + +public class MNames { + private static ResourceLocation loc(String path) { + return new ResourceLocation(OverdriveThatMatters.MOD_ID, path); + } + + // blocks + public static final ResourceLocation ANDROID_STATION = loc("android_station"); // без рецепта + public static final ResourceLocation BATTERY_BANK = loc("battery_bank"); // нужен рецепт + public static final ResourceLocation MATTER_DECOMPOSER = loc("matter_decomposer"); // есть рецепт + public static final ResourceLocation MATTER_CAPACITOR_BANK = loc("matter_capacitor_bank"); // есть рецепт + public static final ResourceLocation MATTER_CABLE = loc("matter_cable"); // есть рецепт + public static final ResourceLocation PATTERN_STORAGE = loc("pattern_storage"); // есть рецепт + public static final ResourceLocation MATTER_SCANNER = loc("matter_scanner"); // есть рецепт + public static final ResourceLocation MATTER_PANEL = loc("matter_panel"); // есть рецепт + public static final ResourceLocation MATTER_REPLICATOR = loc("matter_replicator"); // есть рецепт + public static final ResourceLocation MATTER_BOTTLER = loc("matter_bottler"); // есть рецепт + public static final ResourceLocation DRIVE_VIEWER = loc("drive_viewer"); // есть рецепт + public static final ResourceLocation DRIVE_RACK = loc("drive_rack"); // нужен рецепт (после улучшений) + public static final ResourceLocation ITEM_MONITOR = loc("item_monitor"); // нужен рецепт (после улучшений) + public static final ResourceLocation ENERGY_COUNTER = loc("energy_counter"); // есть рецепт + public static final ResourceLocation CHEMICAL_GENERATOR = loc("chemical_generator"); // есть рецепт + public static final ResourceLocation PLATE_PRESS = loc("plate_press"); // есть рецепт + public static final ResourceLocation MATTER_RECYCLER = loc("matter_recycler"); // нужен рецепт + + public static final ResourceLocation DEBUG_EXPLOSION_SMALL = loc("debug_explosion_small"); + public static final ResourceLocation DEBUG_SPHERE_POINTS = loc("debug_sphere_points"); + + public static final ResourceLocation BLACK_HOLE = loc("black_hole"); + public static final ResourceLocation GRAVITATION_STABILIZER = loc("gravitation_stabilizer"); // нужен рецепт + public static final ResourceLocation GRAVITATION_STABILIZER_LENS = loc("gravitation_stabilizer_lens"); + public static final ResourceLocation CARGO_CRATE = loc("cargo_crate"); // нужен рецепт? + + // building blocks + public static final ResourceLocation TRITANIUM_BLOCK = loc("tritanium_block"); + public static final ResourceLocation TRITANIUM_STRIPED_BLOCK = loc("tritanium_striped_block"); + + public static final ResourceLocation CARBON_FIBRE_BLOCK = loc("carbon_fibre_block"); + + // capabilities + public static final ResourceLocation ANDROID_CAPABILITY = loc("android_capability"); + + // items + public static final ResourceLocation GRAVITATIONAL_DISRUPTOR = loc("gravitational_disruptor"); + public static final ResourceLocation MATTER_DUST = loc("matter_dust"); + + public static final ResourceLocation PILL_ANDROID = loc("pill_android"); + public static final ResourceLocation PILL_HUMANE = loc("pill_humane"); + public static final ResourceLocation PILL_OBLIVION = loc("pill_oblivion"); + public static final ResourceLocation PILL_HEAL = loc("pill_heal"); + + public static final ResourceLocation BATTERY_CRUDE = loc("battery_crude"); + public static final ResourceLocation BATTERY_BASIC = loc("battery_basic"); + public static final ResourceLocation BATTERY_NORMAL = loc("battery_normal"); + public static final ResourceLocation BATTERY_DENSE = loc("battery_dense"); + public static final ResourceLocation BATTERY_CAPACITOR = loc("battery_capacitor"); + public static final ResourceLocation BATTERY_CREATIVE = loc("battery_creative"); + + public static final ResourceLocation MATTER_CAPACITOR_PARTS = loc("matter_capacitor_parts"); + public static final ResourceLocation MATTER_CAPACITOR_BASIC = loc("matter_capacitor_basic"); + public static final ResourceLocation MATTER_CAPACITOR_NORMAL = loc("matter_capacitor_normal"); + public static final ResourceLocation MATTER_CAPACITOR_DENSE = loc("matter_capacitor_dense"); + public static final ResourceLocation MATTER_CAPACITOR_CREATIVE = loc("matter_capacitor_creative"); + + public static final ResourceLocation PATTERN_DRIVE_NORMAL = loc("pattern_drive_normal"); + public static final ResourceLocation PATTERN_DRIVE_CREATIVE = loc("pattern_drive_creative"); + + public static final ResourceLocation NUTRIENT_PASTE = loc("nutrient_paste"); + + public static final ResourceLocation PORTABLE_CONDENSATION_DRIVE = loc("portable_condensation_drive"); + public static final ResourceLocation PORTABLE_DENSE_CONDENSATION_DRIVE = loc("portable_dense_condensation_drive"); + + public static final ResourceLocation BLACK_HOLE_SCANNER = loc("black_hole_scanner"); + public static final ResourceLocation GRAVITATION_FIELD_LIMITER = loc("gravitation_field_limiter"); + public static final ResourceLocation GRAVITATION_FIELD_SENSOR = loc("graivtation_field_sensor"); + public static final ResourceLocation PORTABLE_GRAVITATION_STABILIZER = loc("portable_gravitation_stabilizer"); + + // armor + public static final ResourceLocation TRITANIUM_HELMET = loc("tritanium_helmet"); + public static final ResourceLocation TRITANIUM_CHESTPLATE = loc("tritanium_chestplate"); + public static final ResourceLocation TRITANIUM_PANTS = loc("tritanium_pants"); + public static final ResourceLocation TRITANIUM_BOOTS = loc("tritanium_boots"); + + // tools + public static final ResourceLocation TRITANIUM_SWORD = loc("tritanium_sword"); + public static final ResourceLocation TRITANIUM_AXE = loc("tritanium_axe"); + public static final ResourceLocation TRITANIUM_PICKAXE = loc("tritanium_pickaxe"); + public static final ResourceLocation TRITANIUM_SHOVEL = loc("tritanium_shovel"); + public static final ResourceLocation TRITANIUM_HOE = loc("tritanium_hoe"); + + // items: crafting components + public static final ResourceLocation TRITANIUM_INGOT = loc("tritanium_ingot"); + + public static final ResourceLocation MATTER_IO_PORT = loc("matter_io_port"); + public static final ResourceLocation MATTER_TRANSFORM_MATRIX = loc("matter_transform_matrix"); + + public static final ResourceLocation ENERGY_BUS = loc("energy_bus"); + public static final ResourceLocation ELECTRIC_PARTS = loc("electric_parts"); + + public static final ResourceLocation MACHINE_FRAME = loc("machine_frame"); + public static final ResourceLocation TRITANIUM_PLATE = loc("tritanium_plate"); + public static final ResourceLocation IRON_PLATE = loc("iron_plate"); + public static final ResourceLocation COPPER_WIRING = loc("copper_wiring"); + public static final ResourceLocation GOLD_WIRING = loc("gold_wiring"); + + public static final ResourceLocation PORTABLE_CONDENSATION_DRIVE_CASING = loc("portable_condensation_drive_casing"); + public static final ResourceLocation PORTABLE_DENSE_CONDENSATION_DRIVE_CASING = loc("portable_dense_condensation_drive_casing"); + + public static final ResourceLocation CIRCUIT_PLATING = loc("circuit_plating"); + public static final ResourceLocation BASIC_CONTROL_CIRCUIT = loc("basic_control_circuit"); + public static final ResourceLocation ADVANCED_CONTROL_CIRCUIT = loc("advanced_control_circuit"); + + public static final ResourceLocation TRITANIUM_ORE = loc("tritanium_ore"); + public static final ResourceLocation DEEPSLATE_TRITANIUM_ORE = loc("deepslate_tritanium_ore"); + public static final ResourceLocation TRITANIUM_RAW_BLOCK = loc("tritanium_raw_block"); + public static final ResourceLocation TRITANIUM_ORE_CLUMP = loc("tritanium_ore_clump"); + + // android features and research + public static final ResourceLocation AIR_BAGS = loc("air_bags"); + + public static final ResourceLocation LIMB_OVERCLOCKING = loc("limb_overclocking"); + public static final ResourceLocation LIMB_OVERCLOCKING_1 = loc("limb_overclocking_1"); + public static final ResourceLocation LIMB_OVERCLOCKING_2 = loc("limb_overclocking_2"); + public static final ResourceLocation LIMB_OVERCLOCKING_3 = loc("limb_overclocking_3"); + public static final ResourceLocation LIMB_OVERCLOCKING_4 = loc("limb_overclocking_4"); + + public static final ResourceLocation[] LIMB_OVERCLOCKING_LIST = new ResourceLocation[]{LIMB_OVERCLOCKING_1, LIMB_OVERCLOCKING_2, LIMB_OVERCLOCKING_3, LIMB_OVERCLOCKING_4}; + + public static final ResourceLocation NANOBOTS = loc("nanobots"); + public static final ResourceLocation NANOBOTS_REGENERATION = loc("nanobots_regeneration"); + public static final ResourceLocation NANOBOTS_REGENERATION_1 = loc("nanobots_regeneration_1"); + public static final ResourceLocation NANOBOTS_REGENERATION_2 = loc("nanobots_regeneration_2"); + public static final ResourceLocation NANOBOTS_REGENERATION_3 = loc("nanobots_regeneration_3"); + public static final ResourceLocation NANOBOTS_REGENERATION_4 = loc("nanobots_regeneration_4"); + + public static final ResourceLocation[] NANOBOTS_REGENERATION_LIST = new ResourceLocation[]{NANOBOTS_REGENERATION_1, NANOBOTS_REGENERATION_2, NANOBOTS_REGENERATION_3, NANOBOTS_REGENERATION_4}; + + public static final ResourceLocation NANOBOTS_ARMOR = loc("nanobots_armor"); + + public static final ResourceLocation NANOBOTS_ARMOR_STRENGTH_1 = loc("nanobots_armor_strength_1"); + public static final ResourceLocation NANOBOTS_ARMOR_STRENGTH_2 = loc("nanobots_armor_strength_2"); + public static final ResourceLocation NANOBOTS_ARMOR_STRENGTH_3 = loc("nanobots_armor_strength_3"); + public static final ResourceLocation[] NANOBOTS_ARMOR_STRENGTH_LIST = new ResourceLocation[]{ + NANOBOTS_ARMOR_STRENGTH_1, + NANOBOTS_ARMOR_STRENGTH_2, + NANOBOTS_ARMOR_STRENGTH_3, + }; + + public static final ResourceLocation NANOBOTS_ARMOR_SPEED_1 = loc("nanobots_armor_speed_1"); + public static final ResourceLocation NANOBOTS_ARMOR_SPEED_2 = loc("nanobots_armor_speed_2"); + public static final ResourceLocation NANOBOTS_ARMOR_SPEED_3 = loc("nanobots_armor_speed_3"); + public static final ResourceLocation[] NANOBOTS_ARMOR_SPEED_LIST = new ResourceLocation[]{ + NANOBOTS_ARMOR_SPEED_1, + NANOBOTS_ARMOR_SPEED_2, + NANOBOTS_ARMOR_SPEED_3, + }; + + public static final ResourceLocation HYDRAULICS_OVERLOAD = loc("hydraulics_overload"); + public static final ResourceLocation HYDRAULICS_OVERLOAD_1 = loc("hydraulics_overload_1"); + public static final ResourceLocation HYDRAULICS_OVERLOAD_2 = loc("hydraulics_overload_2"); + public static final ResourceLocation HYDRAULICS_OVERLOAD_3 = loc("hydraulics_overload_3"); + + public static final ResourceLocation EXTENDED_REACH = loc("extended_reach"); + + // stats + public static final ResourceLocation DAMAGE_ABSORBED = loc("damage_absorbed"); + public static final ResourceLocation HEALTH_REGENERATED = loc("health_regenerated"); + public static final ResourceLocation POWER_CONSUMED = loc("power_consumed"); +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MRecipes.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MRecipes.java new file mode 100644 index 000000000..27ac7158b --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MRecipes.java @@ -0,0 +1,44 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import ru.dbotthepony.mc.otm.recipe.PlatePressRecipe; +import ru.dbotthepony.mc.otm.recipe.PlatePressRecipeFactory; + +public class MRecipes { + public static class MatteryRecipeType> implements RecipeType { + public final ResourceLocation name; + + private MatteryRecipeType(ResourceLocation name) { + this.name = name; + } + + private void register() { + net.minecraft.core.Registry.register(net.minecraft.core.Registry.RECIPE_TYPE, name, this); + } + + @Override + public String toString() { + return name.toString(); + } + } + + public static final MatteryRecipeType PLATE_PRESS = new MatteryRecipeType<>(MNames.PLATE_PRESS); + + @SubscribeEvent + @SuppressWarnings("unused") + public static void register(final FMLCommonSetupEvent event) { + PLATE_PRESS.register(); + } + + @SubscribeEvent + @SuppressWarnings("unused") + public static void register(final RegistryEvent.Register> event) { + event.getRegistry().register(PlatePressRecipeFactory.INSTANCE); + } +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MStats.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MStats.java new file mode 100644 index 000000000..9a7f2d4a9 --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MStats.java @@ -0,0 +1,19 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.stats.StatFormatter; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; + +public class MStats { + @SubscribeEvent + @SuppressWarnings("unused") + public static void registerVanilla(final FMLCommonSetupEvent event) { + net.minecraft.core.Registry.register(net.minecraft.core.Registry.CUSTOM_STAT, MNames.DAMAGE_ABSORBED, MNames.DAMAGE_ABSORBED); + net.minecraft.core.Registry.register(net.minecraft.core.Registry.CUSTOM_STAT, MNames.HEALTH_REGENERATED, MNames.HEALTH_REGENERATED); + net.minecraft.core.Registry.register(net.minecraft.core.Registry.CUSTOM_STAT, MNames.POWER_CONSUMED, MNames.POWER_CONSUMED); + + net.minecraft.stats.Stats.CUSTOM.get(MNames.DAMAGE_ABSORBED, StatFormatter.DIVIDE_BY_TEN); + net.minecraft.stats.Stats.CUSTOM.get(MNames.HEALTH_REGENERATED, StatFormatter.DIVIDE_BY_TEN); + net.minecraft.stats.Stats.CUSTOM.get(MNames.POWER_CONSUMED, StatFormatter.DIVIDE_BY_TEN); + } +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/MTags.java b/src/main/java/ru/dbotthepony/mc/otm/registry/MTags.java new file mode 100644 index 000000000..c1525895f --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/MTags.java @@ -0,0 +1,15 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.ItemTags; +import net.minecraft.world.item.Item; +import net.minecraftforge.common.Tags; + +import java.util.Set; + +public class MTags { + public static class Items { + public static final Tags.IOptionalNamedTag INGOT_TRITANIUM = ItemTags.createOptional(new ResourceLocation("forge", "ingots/tritanium"), Set.of(() -> MItems.TRITANIUM_INGOT)); + public static final Tags.IOptionalNamedTag PLATE_TRITANIUM = ItemTags.createOptional(new ResourceLocation("forge", "plates/tritanium"), Set.of(() -> MItems.TRITANIUM_PLATE)); + } +} diff --git a/src/main/java/ru/dbotthepony/mc/otm/registry/Registry.java b/src/main/java/ru/dbotthepony/mc/otm/registry/Registry.java new file mode 100644 index 000000000..5978ac23b --- /dev/null +++ b/src/main/java/ru/dbotthepony/mc/otm/registry/Registry.java @@ -0,0 +1,207 @@ +package ru.dbotthepony.mc.otm.registry; + +import net.minecraft.client.gui.screens.MenuScreens; +import net.minecraft.network.chat.TextComponent; +import net.minecraft.network.chat.TranslatableComponent; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.stats.StatFormatter; +import net.minecraft.tags.ItemTags; +import net.minecraft.world.damagesource.DamageSource; +import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.item.*; +import net.minecraft.world.item.crafting.Recipe; +import net.minecraft.world.item.crafting.RecipeSerializer; +import net.minecraft.world.item.crafting.RecipeType; +import net.minecraft.world.level.block.*; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.material.Material; +import net.minecraft.world.level.material.MaterialColor; +import net.minecraftforge.event.RegistryEvent; +import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent; +import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent; +import net.minecraftforge.registries.ForgeRegistry; +import net.minecraftforge.registries.RegistryBuilder; +import org.jetbrains.annotations.Nullable; +import ru.dbotthepony.mc.otm.OverdriveThatMatters; +import ru.dbotthepony.mc.otm.android.AndroidResearchBuilder; +import ru.dbotthepony.mc.otm.android.AndroidResearchType; +import ru.dbotthepony.mc.otm.android.feature.AndroidNanobotsArmor; +import ru.dbotthepony.mc.otm.android.AndroidFeatureType; +import ru.dbotthepony.mc.otm.client.render.SkinElement; +import ru.dbotthepony.mc.otm.menu.*; +import ru.dbotthepony.mc.otm.client.screen.*; +import ru.dbotthepony.mc.otm.recipe.PlatePressRecipe; +import ru.dbotthepony.mc.otm.recipe.PlatePressRecipeFactory; + +import net.minecraftforge.common.Tags.IOptionalNamedTag; +import ru.dbotthepony.mc.otm.registry.AndroidFeatures; +import ru.dbotthepony.mc.otm.registry.MItems; +import ru.dbotthepony.mc.otm.registry.MNames; + +import java.util.ConcurrentModificationException; +import java.util.Set; + +public class Registry { + static { + if (OverdriveThatMatters.CREATIVE_TAB == null) { + throw new ConcurrentModificationException("Accessing Registry before OverdriveThatMatters class is initialized. This is not supported! If no other mods are installed this is a bug."); + } + } + + public static final DamageSource DAMAGE_BECOME_ANDROID = new DamageSource("otm_become_android"); + public static final DamageSource DAMAGE_BECOME_HUMANE = new DamageSource("otm_become_humane"); + public static final DamageSource DAMAGE_EVENT_HORIZON = new DamageSource("otm_event_horizon"); + public static final DamageSource DAMAGE_HAWKING_RADIATION = new DamageSource("otm_hawking_radiation"); + + static { + DAMAGE_BECOME_ANDROID.bypassArmor().bypassInvul().bypassMagic(); + DAMAGE_BECOME_HUMANE.bypassArmor().bypassInvul().bypassMagic(); + DAMAGE_EVENT_HORIZON.bypassMagic().bypassArmor(); + // DAMAGE_HAWKING_RADIATION.bypassMagic().bypassArmor(); + } + + public static final ForgeRegistry> ANDROID_FEATURES; + public static final ForgeRegistry> ANDROID_RESEARCH; + + static { + var builder = new RegistryBuilder>(); + builder.setName(new ResourceLocation(OverdriveThatMatters.MOD_ID, "android_features")); + + // make it shut up + builder.setType(c(AndroidFeatureType.class)); + ANDROID_FEATURES = (ForgeRegistry>) builder.create(); + + var builder2 = new RegistryBuilder>(); + builder2.setName(new ResourceLocation(OverdriveThatMatters.MOD_ID, "android_research")); + + // make it shut up + builder2.setType(c(AndroidResearchType.class)); + ANDROID_RESEARCH = (ForgeRegistry>) builder2.create(); + } + + public static void dummy() {} + + @SuppressWarnings("unchecked") + private static Class c(Class cls) { return (Class) cls; } + + record CrateProps(MaterialColor color, ResourceLocation name) { + public CrateProps(MaterialColor color, String name) { + this(color, new ResourceLocation(OverdriveThatMatters.MOD_ID, "crate_" + name)); + } + } + + public static final CrateProps[] CRATES = new CrateProps[] { + new CrateProps(MaterialColor.COLOR_RED, "red"), + new CrateProps(MaterialColor.COLOR_BLUE, "blue"), + new CrateProps(MaterialColor.COLOR_YELLOW, "yellow"), + new CrateProps(MaterialColor.COLOR_GREEN, "green"), + new CrateProps(MaterialColor.COLOR_BLACK, "black"), + new CrateProps(MaterialColor.COLOR_PINK, "pink"), + new CrateProps(MaterialColor.COLOR_PURPLE, "purple"), + }; + + public record IndustrialGlassProps(@Nullable DyeColor color, ResourceLocation name, ResourceLocation namePane, Block block, Block pane, BlockItem item, BlockItem paneItem) { + public IndustrialGlassProps(@Nullable DyeColor color, ResourceLocation name, ResourceLocation namePane, Block block, Block pane, BlockItem item, BlockItem paneItem) { + this.color = color; + this.name = name; + this.namePane = namePane; + this.block = block; + this.pane = pane; + this.item = item; + this.paneItem = paneItem; + + this.block.setRegistryName(this.name); + this.pane.setRegistryName(this.namePane); + this.item.setRegistryName(this.name); + this.paneItem.setRegistryName(this.namePane); + } + + IndustrialGlassProps(@Nullable DyeColor color, ResourceLocation name, ResourceLocation namePane, Block block, Block pane) { + this(color, name, namePane, block, pane, + new BlockItem(block, new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB).stacksTo(64)), + new BlockItem(pane, new Item.Properties().tab(OverdriveThatMatters.CREATIVE_TAB).stacksTo(64))); + } + + IndustrialGlassProps(@Nullable DyeColor color, ResourceLocation name, ResourceLocation namePane) { + this(color, name, namePane, + glass(color, BlockBehaviour.Properties.of(Material.GLASS, color != null ? color.getMaterialColor() : MaterialColor.NONE) + .strength(1.5F, 5.0F) + .requiresCorrectToolForDrops() + .sound(SoundType.GLASS) + .noOcclusion() + .isValidSpawn((_a, _b, _c, _d) -> false) + .isRedstoneConductor((_a, _b, _c) -> false) + .isSuffocating((_a, _b, _c) -> false) + .isViewBlocking((_a, _b, _c) -> false)), + pane(color, BlockBehaviour.Properties.of(Material.GLASS, color != null ? color.getMaterialColor() : MaterialColor.NONE) + .strength(1.25F, 5.0F) + .requiresCorrectToolForDrops() + .sound(SoundType.GLASS) + .noOcclusion()) + ); + } + + private static Block glass(@Nullable DyeColor color, BlockBehaviour.Properties props) { + if (color == null) { + return new GlassBlock(props); + } + + return new StainedGlassBlock(color, props); + } + + private static Block pane(@Nullable DyeColor color, BlockBehaviour.Properties props) { + if (color == null) { + return new IronBarsBlock(props); + } + + return new StainedGlassPaneBlock(color, props); + } + + IndustrialGlassProps(@Nullable DyeColor color) { + this(color, + new ResourceLocation(OverdriveThatMatters.MOD_ID, color != null ? "industrial_glass_" + color.getName() : "industrial_glass"), + new ResourceLocation(OverdriveThatMatters.MOD_ID, color != null ? "industrial_glass_pane_" + color.getName() : "industrial_glass_pane") + ); + } + } + + public static final IndustrialGlassProps INDUSTRIAL_GLASS = new IndustrialGlassProps(null); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_WHITE = new IndustrialGlassProps(DyeColor.WHITE); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_ORANGE = new IndustrialGlassProps(DyeColor.ORANGE); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_MAGENTA = new IndustrialGlassProps(DyeColor.MAGENTA); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_LIGHT_BLUE = new IndustrialGlassProps(DyeColor.LIGHT_BLUE); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_YELLOW = new IndustrialGlassProps(DyeColor.YELLOW); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_LIME = new IndustrialGlassProps(DyeColor.LIME); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_PINK = new IndustrialGlassProps(DyeColor.PINK); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_GRAY = new IndustrialGlassProps(DyeColor.GRAY); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_LIGHT_GRAY = new IndustrialGlassProps(DyeColor.LIGHT_GRAY); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_CYAN = new IndustrialGlassProps(DyeColor.CYAN); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_PURPLE = new IndustrialGlassProps(DyeColor.PURPLE); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_BLUE = new IndustrialGlassProps(DyeColor.BLUE); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_BROWN = new IndustrialGlassProps(DyeColor.BROWN); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_GREEN = new IndustrialGlassProps(DyeColor.GREEN); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_RED = new IndustrialGlassProps(DyeColor.RED); + public static final IndustrialGlassProps INDUSTRIAL_GLASS_BLACK = new IndustrialGlassProps(DyeColor.BLACK); + + public static final IndustrialGlassProps[] INDUSTRIAL_GLASS_LIST = new IndustrialGlassProps[] { + INDUSTRIAL_GLASS, + INDUSTRIAL_GLASS_WHITE, + INDUSTRIAL_GLASS_ORANGE, + INDUSTRIAL_GLASS_MAGENTA, + INDUSTRIAL_GLASS_LIGHT_BLUE, + INDUSTRIAL_GLASS_YELLOW, + INDUSTRIAL_GLASS_LIME, + INDUSTRIAL_GLASS_PINK, + INDUSTRIAL_GLASS_GRAY, + INDUSTRIAL_GLASS_LIGHT_GRAY, + INDUSTRIAL_GLASS_CYAN, + INDUSTRIAL_GLASS_PURPLE, + INDUSTRIAL_GLASS_BLUE, + INDUSTRIAL_GLASS_BROWN, + INDUSTRIAL_GLASS_GREEN, + INDUSTRIAL_GLASS_RED, + INDUSTRIAL_GLASS_BLACK, + }; + +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockAndroidStation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockAndroidStation.kt index f2b9e7297..a0674713c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockAndroidStation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockAndroidStation.kt @@ -14,11 +14,10 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.BlockHitResult import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityAndroidStation import ru.dbotthepony.mc.otm.capability.MatteryCapability -import ru.dbotthepony.mc.otm.capability.android.IAndroidCapability import ru.dbotthepony.mc.otm.orNull +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes class BlockAndroidStation : BlockMattery(), EntityBlock { @@ -56,7 +55,7 @@ class BlockAndroidStation : BlockMattery(), EntityBlock { state: BlockState, type: BlockEntityType ): BlockEntityTicker? { - if (level.isClientSide || type !== Registry.BlockEntities.ANDROID_STATION) + if (level.isClientSide || type !== MBlockEntities.ANDROID_STATION) return null return BlockEntityTicker { _, _, _, t -> if (t is BlockEntityAndroidStation) t.tick() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBatteryBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBatteryBank.kt index 29986f0d2..d4c809785 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBatteryBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBatteryBank.kt @@ -2,12 +2,10 @@ package ru.dbotthepony.mc.otm.block import net.minecraft.MethodsReturnNonnullByDefault import javax.annotation.ParametersAreNonnullByDefault -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import net.minecraft.world.level.block.EntityBlock import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.properties.BooleanProperty -import ru.dbotthepony.mc.otm.block.BlockBatteryBank import net.minecraft.world.level.block.entity.BlockEntity import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.entity.BlockEntityTicker @@ -20,7 +18,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.Registry +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @@ -40,7 +38,7 @@ class BlockBatteryBank : BlockMatteryRotatable(), EntityBlock { p_153213_: BlockState, type: BlockEntityType ): BlockEntityTicker? { - if (level.isClientSide || type !== Registry.BlockEntities.BATTERY_BANK) + if (level.isClientSide || type !== MBlockEntities.BATTERY_BANK) return null return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityBatteryBank) tile.tick() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBlackHole.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBlackHole.kt index 3cafce7b6..a35ef8727 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBlackHole.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockBlackHole.kt @@ -10,11 +10,10 @@ import net.minecraft.world.level.block.entity.BlockEntityTicker import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.material.Material -import net.minecraft.world.level.material.MaterialColor import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes class BlockBlackHole : @@ -37,7 +36,7 @@ class BlockBlackHole : p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153214_ !== Registry.BlockEntities.BLACK_HOLE) return null + if (p_153214_ !== MBlockEntities.BLACK_HOLE) return null if (p_153212_.isClientSide) { return BlockEntityTicker { _, _, _, t -> if (t is BlockEntityBlackHole) t.clientTick() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockChemicalGenerator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockChemicalGenerator.kt index e9e5b93f5..bcf245df1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockChemicalGenerator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockChemicalGenerator.kt @@ -15,9 +15,9 @@ 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.OverdriveThatMatters -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityChemicalGenerator import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes class BlockChemicalGenerator : BlockMatteryRotatable(), EntityBlock { @@ -30,7 +30,7 @@ class BlockChemicalGenerator : BlockMatteryRotatable(), EntityBlock { state: BlockState, type: BlockEntityType ): BlockEntityTicker? { - if (level.isClientSide || type != Registry.BlockEntities.CHEMICAL_GENERATOR) + if (level.isClientSide || type != MBlockEntities.CHEMICAL_GENERATOR) return null return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityChemicalGenerator) tile.tick() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveRack.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveRack.kt index 18a5da9ad..d881f251d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveRack.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveRack.kt @@ -11,8 +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.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveRack +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes class BlockDriveRack : BlockMatteryRotatable(), EntityBlock { @@ -25,7 +25,7 @@ class BlockDriveRack : BlockMatteryRotatable(), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153214_ != Registry.BlockEntities.DRIVE_RACK || p_153212_.isClientSide) + if (p_153214_ != MBlockEntities.DRIVE_RACK || p_153212_.isClientSide) return null return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityDriveRack) tile.tick() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveViewer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveViewer.kt index 4c8969358..84b04f807 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveViewer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockDriveViewer.kt @@ -11,9 +11,9 @@ import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.BooleanProperty -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveViewer import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState +import ru.dbotthepony.mc.otm.registry.MBlockEntities class BlockDriveViewer : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { @@ -25,7 +25,7 @@ class BlockDriveViewer : BlockMatteryRotatable(), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153212_.isClientSide || p_153214_ !== Registry.BlockEntities.DRIVE_VIEWER) + if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.DRIVE_VIEWER) return null return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityDriveViewer) tile.tick() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt index 0f9ece5de..5c3511360 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockEnergyCounter.kt @@ -15,8 +15,8 @@ import net.minecraft.world.level.block.state.StateDefinition import net.minecraft.world.level.block.state.properties.EnumProperty import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes class BlockEnergyCounter : BlockMattery(), EntityBlock { @@ -29,7 +29,7 @@ class BlockEnergyCounter : BlockMattery(), EntityBlock { blockState: BlockState, blockEntityType: BlockEntityType ): BlockEntityTicker? { - if (blockEntityType !== Registry.BlockEntities.ENERGY_COUNTER) + if (blockEntityType !== MBlockEntities.ENERGY_COUNTER) return null if (level.isClientSide) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockExplosionDebugger.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockExplosionDebugger.kt index 900a6d290..82e58bbe2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockExplosionDebugger.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockExplosionDebugger.kt @@ -9,9 +9,9 @@ import net.minecraft.world.level.block.entity.BlockEntityTicker import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.material.Material -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityExplosionDebugger import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntitySphereDebugger +import ru.dbotthepony.mc.otm.registry.MBlockEntities class BlockExplosionDebugger : Block(Properties.of(Material.STONE)), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { @@ -23,7 +23,7 @@ class BlockExplosionDebugger : Block(Properties.of(Material.STONE)), EntityBlock p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (!p_153212_.isClientSide && p_153214_ === Registry.BlockEntities.DEBUG_EXPLOSION_SMALL) { + if (!p_153212_.isClientSide && p_153214_ === MBlockEntities.DEBUG_EXPLOSION_SMALL) { return BlockEntityTicker {_, _, _, t -> if (t is BlockEntityExplosionDebugger) t.tick()} } @@ -41,7 +41,7 @@ class BlockSphereDebugger : Block(Properties.of(Material.STONE)), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (!p_153212_.isClientSide && p_153214_ === Registry.BlockEntities.DEBUG_SPHERE_POINTS) { + if (!p_153212_.isClientSide && p_153214_ === MBlockEntities.DEBUG_SPHERE_POINTS) { return BlockEntityTicker {_, _, _, t -> if (t is BlockEntitySphereDebugger) t.tick()} } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockGravitationStabilizer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockGravitationStabilizer.kt index 880714d18..7f7c499c3 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockGravitationStabilizer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockGravitationStabilizer.kt @@ -23,12 +23,13 @@ import net.minecraft.world.level.material.PushReaction import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.core.times +import ru.dbotthepony.mc.otm.registry.MBlockEntities +import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.shapes.BlockShapes import kotlin.math.PI @@ -44,7 +45,7 @@ class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153212_.isClientSide || p_153214_ !== Registry.BlockEntities.GRAVITATION_STABILIZER) + if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.GRAVITATION_STABILIZER) return null return BlockEntityTicker { level, _, _, tile -> if (tile is BlockEntityGravitationStabilizer) tile.tick(level) } @@ -98,7 +99,7 @@ class BlockGravitationStabilizer : BlockMatteryRotatable(props), EntityBlock { if (!level.isClientSide) { val bbPos = blockPos + blockState.getValue(FACING_FULL).normal - val newState = Registry.Blocks.GRAVITATION_STABILIZER_LENS.defaultBlockState() + val newState = MBlocks.GRAVITATION_STABILIZER_LENS.defaultBlockState() .setValue(FACING_FULL, blockState.getValue(FACING_FULL)) level.setBlock(bbPos, newState, UPDATE_ALL) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockItemMonitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockItemMonitor.kt index 27ec55379..8951ca07c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockItemMonitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockItemMonitor.kt @@ -11,9 +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.Registry -import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveRack import ru.dbotthepony.mc.otm.block.entity.BlockEntityItemMonitor +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes class BlockItemMonitor : BlockMatteryRotatable(), EntityBlock { @@ -26,7 +25,7 @@ class BlockItemMonitor : BlockMatteryRotatable(), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153214_ != Registry.BlockEntities.ITEM_MONITOR || p_153212_.isClientSide) + if (p_153214_ != MBlockEntities.ITEM_MONITOR || p_153212_.isClientSide) return null return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityItemMonitor) tile.tick() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterBottler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterBottler.kt index 08d74ca6d..aad15ca86 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterBottler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterBottler.kt @@ -2,7 +2,6 @@ package ru.dbotthepony.mc.otm.block import net.minecraft.MethodsReturnNonnullByDefault import javax.annotation.ParametersAreNonnullByDefault -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import net.minecraft.world.level.block.EntityBlock import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -19,8 +18,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.Registry import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @@ -35,7 +34,7 @@ class BlockMatterBottler : BlockMatteryRotatable(), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153212_.isClientSide || p_153214_ !== Registry.BlockEntities.MATTER_BOTTLER) + if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_BOTTLER) return null return BlockEntityTicker {_, _, _, tile -> if (tile is BlockEntityMatterBottler) tile.tick()} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterDecomposer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterDecomposer.kt index 663f4b8b6..b1b6384bb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterDecomposer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterDecomposer.kt @@ -2,7 +2,6 @@ package ru.dbotthepony.mc.otm.block import net.minecraft.MethodsReturnNonnullByDefault import javax.annotation.ParametersAreNonnullByDefault -import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import net.minecraft.world.level.block.EntityBlock import net.minecraft.core.BlockPos import net.minecraft.core.Direction @@ -17,9 +16,8 @@ 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.Registry -import ru.dbotthepony.mc.otm.block.BlockMatterDecomposer import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes @MethodsReturnNonnullByDefault @@ -34,7 +32,7 @@ class BlockMatterDecomposer : BlockMatteryRotatable(), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153212_.isClientSide || p_153214_ !== Registry.BlockEntities.MATTER_DECOMPOSER) + if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_DECOMPOSER) return null return BlockEntityTicker {_, _, _, t -> if (t is BlockEntityMatterDecomposer) t.tick()} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterRecycler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterRecycler.kt index b8b25a0c0..f6a8fcb94 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterRecycler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterRecycler.kt @@ -7,8 +7,8 @@ import net.minecraft.world.level.block.entity.BlockEntity import net.minecraft.world.level.block.entity.BlockEntityTicker import net.minecraft.world.level.block.entity.BlockEntityType import net.minecraft.world.level.block.state.BlockState -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterRecycler +import ru.dbotthepony.mc.otm.registry.MBlockEntities class BlockMatterRecycler : BlockMatteryRotatable(), EntityBlock { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { @@ -20,7 +20,7 @@ class BlockMatterRecycler : BlockMatteryRotatable(), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153212_.isClientSide || p_153214_ !== Registry.BlockEntities.MATTER_RECYCLER) + if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_RECYCLER) return null return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityMatterRecycler) tile.tick() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterReplicator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterReplicator.kt index 901973007..cc65162f5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterReplicator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterReplicator.kt @@ -13,9 +13,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.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterReplicator import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes class BlockMatterReplicator : BlockMatteryRotatable(), EntityBlock { @@ -28,7 +28,7 @@ class BlockMatterReplicator : BlockMatteryRotatable(), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153212_.isClientSide || p_153214_ !== Registry.BlockEntities.MATTER_REPLICATOR) + if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_REPLICATOR) return null return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityMatterReplicator) tile.basicTicker() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterScanner.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterScanner.kt index 6a58f7c76..cfc852156 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterScanner.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockMatterScanner.kt @@ -13,9 +13,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.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterScanner import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes class BlockMatterScanner : BlockMatteryRotatable(), EntityBlock { @@ -28,7 +28,7 @@ class BlockMatterScanner : BlockMatteryRotatable(), EntityBlock { p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153212_.isClientSide || p_153214_ !== Registry.BlockEntities.MATTER_SCANNER) + if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.MATTER_SCANNER) return null return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityMatterScanner) tile.basicTicker() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPlatePress.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPlatePress.kt index a76410063..f033eebb1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPlatePress.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/BlockPlatePress.kt @@ -13,9 +13,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.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityPlatePress import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.shapes.BlockShapes class BlockPlatePress(properties: Properties = DEFAULT_PROPERTIES) : BlockMatteryRotatable(properties), EntityBlock { @@ -28,7 +28,7 @@ class BlockPlatePress(properties: Properties = DEFAULT_PROPERTIES) : BlockMatter p_153213_: BlockState, p_153214_: BlockEntityType ): BlockEntityTicker? { - if (p_153212_.isClientSide || p_153214_ !== Registry.BlockEntities.PLATE_PRESS) + if (p_153212_.isClientSide || p_153214_ !== MBlockEntities.PLATE_PRESS) return null return BlockEntityTicker { _, _, _, tile -> if (tile is BlockEntityPlatePress) tile.basicTicker() } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityAndroidStation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityAndroidStation.kt index 482bd3a3b..19d6677ba 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityAndroidStation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityAndroidStation.kt @@ -10,14 +10,14 @@ import net.minecraft.world.entity.player.Player import net.minecraft.world.inventory.AbstractContainerMenu import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.AABB -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.menu.AndroidStationMenu +import ru.dbotthepony.mc.otm.registry.MBlockEntities class BlockEntityAndroidStation(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryPowered(Registry.BlockEntities.ANDROID_STATION, p_155229_, p_155230_), MenuProvider { + BlockEntityMatteryPowered(MBlockEntities.ANDROID_STATION, p_155229_, p_155230_), MenuProvider { override fun createMenu(containerID: Int, inventory: Inventory, ply: Player): AbstractContainerMenu { return AndroidStationMenu(containerID, inventory, this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityBatteryBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityBatteryBank.kt index a44bcc156..cd9861638 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityBatteryBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityBatteryBank.kt @@ -19,7 +19,6 @@ import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.energy.CapabilityEnergy import net.minecraftforge.energy.IEnergyStorage import net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.BlockBatteryBank import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage @@ -27,16 +26,16 @@ import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.extractEnergy import ru.dbotthepony.mc.otm.capability.receiveEnergy import ru.dbotthepony.mc.otm.container.MatteryContainer -import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.menu.MenuBatteryBank +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.unaryMinus import javax.annotation.ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BlockEntityBatteryBank(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(Registry.BlockEntities.BATTERY_BANK, p_155229_, p_155230_) { +class BlockEntityBatteryBank(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(MBlockEntities.BATTERY_BANK, p_155229_, p_155230_) { // 6 на 2 val container: MatteryContainer = object : MatteryContainer(this::setChanged, CAPACITY) { override fun setChanged(slot: Int, new: ItemStack, old: ItemStack) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityCargoCrate.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityCargoCrate.kt index 001e7e9ec..4a9f044d2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityCargoCrate.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityCargoCrate.kt @@ -13,17 +13,17 @@ 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.Registry import ru.dbotthepony.mc.otm.block.BlockCargoCrate import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.menu.MenuCargoCrate +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set class BlockEntityCargoCrate( p_155229_: BlockPos, p_155230_: BlockState -) : BlockEntityMattery(Registry.BlockEntities.CARGO_CRATE, p_155229_, p_155230_) { +) : BlockEntityMattery(MBlockEntities.CARGO_CRATE, p_155229_, p_155230_) { val container = MatteryContainer(this::setChanged, CAPACITY) private var interactingPlayers = 0 val handler = container.handler() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt index f12b689b3..c3e40ec3a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityChemicalGenerator.kt @@ -25,13 +25,13 @@ import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.capability.* import ru.dbotthepony.mc.otm.container.MatteryContainer -import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.menu.MenuChemicalGenerator +import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.lang.ref.WeakReference -class BlockEntityChemicalGenerator(pos: BlockPos, state: BlockState) : BlockEntityMattery(Registry.BlockEntities.CHEMICAL_GENERATOR, pos, state) { +class BlockEntityChemicalGenerator(pos: BlockPos, state: BlockState) : BlockEntityMattery(MBlockEntities.CHEMICAL_GENERATOR, pos, state) { override fun getDefaultDisplayName(): Component { return NAME } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveRack.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveRack.kt index fa44728cd..8dedb4600 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveRack.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveRack.kt @@ -14,7 +14,6 @@ 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.Registry import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage @@ -24,10 +23,11 @@ import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.menu.MenuDriveRack import ru.dbotthepony.mc.otm.set import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent class BlockEntityDriveRack(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryPowered(Registry.BlockEntities.DRIVE_RACK, p_155229_, p_155230_) { + BlockEntityMatteryPowered(MBlockEntities.DRIVE_RACK, p_155229_, p_155230_) { override val energy = WorkerEnergyStorage(this, STORAGE) @JvmField diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveViewer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveViewer.kt index e27da7e0e..b5efaa220 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveViewer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityDriveViewer.kt @@ -12,20 +12,19 @@ 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.Registry import ru.dbotthepony.mc.otm.block.BlockDriveViewer import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage import ru.dbotthepony.mc.otm.container.MatteryContainer -import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.menu.MenuDriveViewer +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set import javax.annotation.ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault -class BlockEntityDriveViewer(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryPowered(Registry.BlockEntities.DRIVE_VIEWER, p_155229_, p_155230_) { +class BlockEntityDriveViewer(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryPowered(MBlockEntities.DRIVE_VIEWER, p_155229_, p_155230_) { override fun setChanged() { super.setChanged() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityEnergyCounter.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityEnergyCounter.kt index fcfe6354d..858cfa878 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityEnergyCounter.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityEnergyCounter.kt @@ -28,10 +28,10 @@ import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.extractEnergy import ru.dbotthepony.mc.otm.capability.receiveEnergy -import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.menu.MenuEnergyCounter import ru.dbotthepony.mc.otm.network.MatteryNetworking +import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.lang.ref.WeakReference import java.util.function.Supplier @@ -71,7 +71,7 @@ data class EnergyCounterPacket(val pos: BlockPos, val thisTick: ImpreciseFractio } } -class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(Registry.BlockEntities.ENERGY_COUNTER, p_155229_, p_155230_) { +class BlockEntityEnergyCounter(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(MBlockEntities.ENERGY_COUNTER, p_155229_, p_155230_) { var passed = ImpreciseFraction.ZERO internal set diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt index 5a56002c5..6f798ece2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityGravitationStabilizer.kt @@ -9,18 +9,17 @@ 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.phys.AABB -import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizer import ru.dbotthepony.mc.otm.block.BlockGravitationStabilizerLens import ru.dbotthepony.mc.otm.block.BlockMatteryRotatable import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState -import ru.dbotthepony.mc.otm.core.minus import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.core.times +import ru.dbotthepony.mc.otm.registry.MBlockEntities -class BlockEntityGravitationStabilizer(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery(Registry.BlockEntities.GRAVITATION_STABILIZER, p_155229_, p_155230_) { +class BlockEntityGravitationStabilizer(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMattery( + MBlockEntities.GRAVITATION_STABILIZER, p_155229_, p_155230_) { override fun getDefaultDisplayName() = NAME override fun createMenu(containerID: Int, inventory: Inventory, ply: Player) = null diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityItemMonitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityItemMonitor.kt index 1446bbad3..182416c0c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityItemMonitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityItemMonitor.kt @@ -12,16 +12,15 @@ 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.Registry import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage -import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.graph.storage.BasicStorageGraphNode import ru.dbotthepony.mc.otm.graph.storage.StorageNetworkGraph import ru.dbotthepony.mc.otm.menu.MenuItemMonitor +import ru.dbotthepony.mc.otm.registry.MBlockEntities class BlockEntityItemMonitor(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryPowered(Registry.BlockEntities.ITEM_MONITOR, p_155229_, p_155230_) { + BlockEntityMatteryPowered(MBlockEntities.ITEM_MONITOR, p_155229_, p_155230_) { @JvmField val cell = BasicStorageGraphNode() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterBottler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterBottler.kt index 997798e57..a9f7694c5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterBottler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterBottler.kt @@ -16,7 +16,6 @@ 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.Registry import ru.dbotthepony.mc.otm.block.BlockMatterBottler import ru.dbotthepony.mc.otm.block.entity.worker.WorkerState import ru.dbotthepony.mc.otm.capability.MatteryCapability @@ -32,10 +31,11 @@ import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.menu.MenuMatterBottler import ru.dbotthepony.mc.otm.orNull +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set class BlockEntityMatterBottler(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryPowered(Registry.BlockEntities.MATTER_BOTTLER, p_155229_, p_155230_), IMatterGraphNode { + BlockEntityMatteryPowered(MBlockEntities.MATTER_BOTTLER, p_155229_, p_155230_), IMatterGraphNode { private val node = Graph6Node(this) private val resolverNode = LazyOptional.of { this } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCable.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCable.kt index 6da055b09..b181f1f7f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCable.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCable.kt @@ -9,16 +9,16 @@ import net.minecraft.world.level.block.entity.BlockEntity 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.Registry import ru.dbotthepony.mc.otm.block.BlockMatterCable import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.GraphNodeListener import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph +import ru.dbotthepony.mc.otm.registry.MBlockEntities class BlockEntityMatterCable(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntity(Registry.BlockEntities.MATTER_CABLE, p_155229_, p_155230_), IMatterGraphNode, GraphNodeListener { + BlockEntity(MBlockEntities.MATTER_CABLE, p_155229_, p_155230_), IMatterGraphNode, GraphNodeListener { private var valid = true private val node = Graph6Node(this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.kt index e639d059b..4c445e31f 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterCapacitorBank.kt @@ -16,7 +16,6 @@ import net.minecraft.world.level.block.Block 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.Registry import ru.dbotthepony.mc.otm.block.BlockBatteryBank import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.matter.IMatterHandler @@ -27,13 +26,14 @@ import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.menu.MenuMatterCapacitor +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set import javax.annotation.ParametersAreNonnullByDefault @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault class BlockEntityMatterCapacitorBank(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMattery(Registry.BlockEntities.MATTER_CAPACITOR_BANK, p_155229_, p_155230_), IMatterGraphNode, IMatterHandler { + BlockEntityMattery(MBlockEntities.MATTER_CAPACITOR_BANK, p_155229_, p_155230_), IMatterGraphNode, IMatterHandler { private val node = Graph6Node(this) private val resolverNode = LazyOptional.of { this } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterDecomposer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterDecomposer.kt index e91aaad0d..b737fc87c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterDecomposer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterDecomposer.kt @@ -16,7 +16,6 @@ import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.common.util.LazyOptional import net.minecraftforge.items.CapabilityItemHandler import net.minecraftforge.items.IItemHandler -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus @@ -35,11 +34,13 @@ import ru.dbotthepony.mc.otm.matter.baselineComplexityDecomposeTicks import ru.dbotthepony.mc.otm.matter.canDecompose import ru.dbotthepony.mc.otm.matter.getMatterValue import ru.dbotthepony.mc.otm.menu.MenuMatterDecomposer +import ru.dbotthepony.mc.otm.registry.MBlockEntities +import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.set fun moveMatterAsDustIntoContainer(_matterValue: ImpreciseFraction, container: MatteryContainer, OUTPUT_DUST_MAIN: Int, OUTPUT_DUST_STACKING: Int): ImpreciseFraction { var matterValue = _matterValue - val item = Registry.Items.MATTER_DUST + val item = MItems.MATTER_DUST while (matterValue > ImpreciseFraction.ZERO) { val stack = container[OUTPUT_DUST_MAIN] @@ -91,7 +92,7 @@ fun moveMatterAsDustIntoContainer(_matterValue: ImpreciseFraction, container: Ma } class BlockEntityMatterDecomposer(pos: BlockPos, state: BlockState) - : BlockEntityMatteryWorker(Registry.BlockEntities.MATTER_DECOMPOSER, pos, state), IMatterGraphNode { + : BlockEntityMatteryWorker(MBlockEntities.MATTER_DECOMPOSER, pos, state), IMatterGraphNode { override val energy = WorkerEnergyStorage(this, ENERGY_STORAGE, MAX_IO) private var valid = true diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterPanel.kt index c63cff1f5..f132565ac 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterPanel.kt @@ -1,7 +1,5 @@ package ru.dbotthepony.mc.otm.block.entity -import net.minecraft.MethodsReturnNonnullByDefault -import javax.annotation.ParametersAreNonnullByDefault import net.minecraft.core.BlockPos import net.minecraft.core.Direction import net.minecraft.world.level.block.state.BlockState @@ -26,15 +24,15 @@ 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.Registry import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph +import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.util.ArrayList import java.util.List class BlockEntityMatterPanel(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMattery(Registry.BlockEntities.MATTER_PANEL, p_155229_, p_155230_), IMatterGraphNode, IMatterTaskProvider { + BlockEntityMattery(MBlockEntities.MATTER_PANEL, p_155229_, p_155230_), IMatterGraphNode, IMatterTaskProvider { private val listeners = ArrayList() private val node = Graph6Node(this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterRecycler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterRecycler.kt index f2e3a27e3..25bdd9e0a 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterRecycler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterRecycler.kt @@ -14,7 +14,6 @@ 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.Registry import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus @@ -33,10 +32,11 @@ import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.item.ItemMatterDust import ru.dbotthepony.mc.otm.menu.MenuMatterRecycler +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set class BlockEntityMatterRecycler(blockPos: BlockPos, blockState: BlockState) - : BlockEntityMatteryWorker(Registry.BlockEntities.MATTER_RECYCLER, blockPos, blockState), IMatterGraphNode { + : BlockEntityMatteryWorker(MBlockEntities.MATTER_RECYCLER, blockPos, blockState), IMatterGraphNode { val matter = MatterHandlerImpl( this::setChangedLight, MatterDirection.EXTRACT, diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterReplicator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterReplicator.kt index 7d25a824d..9a2bd3bb7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterReplicator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterReplicator.kt @@ -9,13 +9,11 @@ import net.minecraft.server.level.ServerLevel import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player import net.minecraft.world.inventory.AbstractContainerMenu -import net.minecraft.world.item.ItemStack 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 net.minecraftforge.items.CapabilityItemHandler -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus @@ -24,7 +22,6 @@ import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.WorkerEnergyStorage import ru.dbotthepony.mc.otm.capability.matter.* import ru.dbotthepony.mc.otm.container.MatteryContainer -import ru.dbotthepony.mc.otm.container.MatteryContainerFilter import ru.dbotthepony.mc.otm.container.MatteryContainerFilterOnlyOut import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.graph.Graph6Node @@ -34,11 +31,11 @@ import ru.dbotthepony.mc.otm.ifHas import ru.dbotthepony.mc.otm.matter.baselineComplexityReplicateTicks import ru.dbotthepony.mc.otm.matter.getMatterValue import ru.dbotthepony.mc.otm.menu.MenuMatterReplicator +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set -import kotlin.math.pow class BlockEntityMatterReplicator(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryWorker(Registry.BlockEntities.MATTER_REPLICATOR, p_155229_, p_155230_), IMatterGraphNode { + BlockEntityMatteryWorker(MBlockEntities.MATTER_REPLICATOR, p_155229_, p_155230_), IMatterGraphNode { override val energy = WorkerEnergyStorage(this, STORAGE, MAX_IO) private val node = Graph6Node(this) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterScanner.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterScanner.kt index c7d56469f..244fd4b75 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterScanner.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityMatterScanner.kt @@ -15,7 +15,6 @@ 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.Registry import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus @@ -29,10 +28,11 @@ import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.matter.* import ru.dbotthepony.mc.otm.menu.MenuMatterScanner +import ru.dbotthepony.mc.otm.registry.MBlockEntities import java.util.* class BlockEntityMatterScanner(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMatteryWorker(Registry.BlockEntities.MATTER_SCANNER, p_155229_, p_155230_), IMatterGraphNode { + BlockEntityMatteryWorker(MBlockEntities.MATTER_SCANNER, p_155229_, p_155230_), IMatterGraphNode { val container = MatteryContainer(this::setChanged, 1) override val energy = WorkerEnergyStorage(this, STORAGE, MAX_IO) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPatternStorage.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPatternStorage.kt index 8b7f5505c..88a79eb1b 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPatternStorage.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPatternStorage.kt @@ -22,19 +22,19 @@ import net.minecraft.server.level.ServerLevel import net.minecraft.world.level.Level import net.minecraft.world.level.block.Block import net.minecraftforge.common.capabilities.Capability -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.capability.matter.* import ru.dbotthepony.mc.otm.graph.Graph6Node import ru.dbotthepony.mc.otm.graph.matter.IMatterGraphNode import ru.dbotthepony.mc.otm.graph.matter.MatterNetworkGraph import ru.dbotthepony.mc.otm.ifHas +import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.set import java.util.ArrayList @MethodsReturnNonnullByDefault @ParametersAreNonnullByDefault class BlockEntityPatternStorage(p_155229_: BlockPos, p_155230_: BlockState) : - BlockEntityMattery(Registry.BlockEntities.PATTERN_STORAGE, p_155229_, p_155230_), IMatterGraphNode, IPatternStorage { + BlockEntityMattery(MBlockEntities.PATTERN_STORAGE, p_155229_, p_155230_), IMatterGraphNode, IPatternStorage { private val node = Graph6Node(this) private val resolverPatterns = LazyOptional.of { this } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt index 942fac1ee..efe7e4ab5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/BlockEntityPlatePress.kt @@ -12,7 +12,6 @@ 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.Registry import ru.dbotthepony.mc.otm.block.entity.worker.BlockEntityMatteryWorker import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJob import ru.dbotthepony.mc.otm.block.entity.worker.WorkerJobStatus @@ -21,9 +20,11 @@ import ru.dbotthepony.mc.otm.container.MatteryContainer import ru.dbotthepony.mc.otm.container.MatteryContainerFilter import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.menu.MenuPlatePress +import ru.dbotthepony.mc.otm.registry.MBlockEntities +import ru.dbotthepony.mc.otm.registry.MRecipes import ru.dbotthepony.mc.otm.set -class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryWorker(Registry.BlockEntities.PLATE_PRESS, p_155229_, p_155230_) { +class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntityMatteryWorker(MBlockEntities.PLATE_PRESS, p_155229_, p_155230_) { val container = MatteryContainer(this::setChangedLight, 2) override val energy = WorkerEnergyStorage(this::setChangedLight) @@ -86,7 +87,7 @@ class BlockEntityPlatePress(p_155229_: BlockPos, p_155230_: BlockState) : BlockE override fun computeNextJob(): WorkerJob? { val level = level ?: return null - val recipe = level.recipeManager.getRecipeFor(Registry.Recipes.PLATE_PRESS, container, level).orElse(null) ?: return null + val recipe = level.recipeManager.getRecipeFor(MRecipes.PLATE_PRESS, container, level).orElse(null) ?: return null val copy = container[SLOT_INPUT].copy() container[SLOT_INPUT].shrink(1) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt index 38d064266..5e989c341 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityBlackHole.kt @@ -21,18 +21,20 @@ import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.levelgen.structure.BoundingBox import net.minecraft.world.phys.AABB import net.minecraft.world.phys.Vec3 -import ru.dbotthepony.mc.otm.Registry +import ru.dbotthepony.mc.otm.registry.Registry import ru.dbotthepony.mc.otm.block.BlockBlackHole import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer import ru.dbotthepony.mc.otm.block.entity.blackhole.ExplosionQueue.Companion.queueForLevel import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.matter.getMatterValue +import ru.dbotthepony.mc.otm.registry.MBlockEntities +import ru.dbotthepony.mc.otm.registry.MItems import ru.dbotthepony.mc.otm.set import kotlin.math.roundToInt import kotlin.math.sqrt -class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(Registry.BlockEntities.BLACK_HOLE, p_155229_, p_155230_) { +class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(MBlockEntities.BLACK_HOLE, p_155229_, p_155230_) { var mass = BASELINE_MASS set(mass) { if (mass <= ImpreciseFraction.ZERO) { @@ -275,7 +277,7 @@ class BlockEntityBlackHole(p_155229_: BlockPos, p_155230_: BlockState) : BlockEn if (distance < gravitationStrength + 1) { if (item.hurt(Registry.DAMAGE_EVENT_HORIZON, (gravitationStrength / distance).toFloat()) && item.isRemoved) { - if (item.item.item === Registry.Items.GRAVITATIONAL_DISRUPTOR) { + if (item.item.item === MItems.GRAVITATIONAL_DISRUPTOR) { collapse() } else { val mass = getMatterValue(item.item) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityExplosionDebugger.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityExplosionDebugger.kt index aa48134c9..0cdad6434 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityExplosionDebugger.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/BlockEntityExplosionDebugger.kt @@ -7,11 +7,11 @@ import net.minecraft.world.level.block.Blocks import net.minecraft.world.level.block.entity.BlockEntity import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.Vec3 -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.core.plus import ru.dbotthepony.mc.otm.core.times +import ru.dbotthepony.mc.otm.registry.MBlockEntities -class BlockEntityExplosionDebugger(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(Registry.BlockEntities.DEBUG_EXPLOSION_SMALL, p_155229_, p_155230_) { +class BlockEntityExplosionDebugger(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(MBlockEntities.DEBUG_EXPLOSION_SMALL, p_155229_, p_155230_) { private var hive: ExplosionRayHive? = null fun tick() { @@ -33,7 +33,7 @@ class BlockEntityExplosionDebugger(p_155229_: BlockPos, p_155230_: BlockState) : } } -class BlockEntitySphereDebugger(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(Registry.BlockEntities.DEBUG_SPHERE_POINTS, p_155229_, p_155230_) { +class BlockEntitySphereDebugger(p_155229_: BlockPos, p_155230_: BlockState) : BlockEntity(MBlockEntities.DEBUG_SPHERE_POINTS, p_155229_, p_155230_) { private var placed = false fun tick() { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/Explosions.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/Explosions.kt index c55260b1c..ecd430e18 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/Explosions.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/blackhole/Explosions.kt @@ -19,7 +19,7 @@ import net.minecraft.world.phys.Vec3 import net.minecraftforge.event.TickEvent import net.minecraftforge.eventbus.api.SubscribeEvent import org.apache.logging.log4j.LogManager -import ru.dbotthepony.mc.otm.Registry +import ru.dbotthepony.mc.otm.registry.Registry import ru.dbotthepony.mc.otm.block.BlockExplosionDebugger import ru.dbotthepony.mc.otm.core.* import ru.dbotthepony.mc.otm.core.Vector diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/android/AndroidCapability.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/android/AndroidCapability.kt index 73cbcebf3..16710879b 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/android/AndroidCapability.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/android/AndroidCapability.kt @@ -31,13 +31,13 @@ import net.minecraftforge.common.capabilities.Capability import net.minecraftforge.eventbus.api.SubscribeEvent import net.minecraftforge.event.entity.living.LivingEvent.LivingUpdateEvent import net.minecraftforge.eventbus.api.EventPriority -import ru.dbotthepony.mc.otm.Registry +import ru.dbotthepony.mc.otm.registry.Registry import ru.dbotthepony.mc.otm.capability.IMatteryEnergyStorage import ru.dbotthepony.mc.otm.capability.extractEnergy import ru.dbotthepony.mc.otm.capability.receiveEnergy -import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.ifHas +import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.set import java.util.* @@ -324,7 +324,7 @@ open class AndroidCapability(@JvmField protected val ent: LivingEntity) : ICapab if (howMuch.isZero) { if (!simulate && ent is ServerPlayer) { - ent.awardStat(Registry.Names.POWER_CONSUMED, drained.toInt() * 10) + ent.awardStat(MNames.POWER_CONSUMED, drained.toInt() * 10) } return drained @@ -338,7 +338,7 @@ open class AndroidCapability(@JvmField protected val ent: LivingEntity) : ICapab battery = new if (ent is ServerPlayer) { - ent.awardStat(Registry.Names.POWER_CONSUMED, drained.toInt() * 10) + ent.awardStat(MNames.POWER_CONSUMED, drained.toInt() * 10) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/android/AndroidCapabilityPlayer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/android/AndroidCapabilityPlayer.kt index e6617807c..0e3699877 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/capability/android/AndroidCapabilityPlayer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/capability/android/AndroidCapabilityPlayer.kt @@ -13,14 +13,15 @@ import net.minecraftforge.event.AttachCapabilitiesEvent import net.minecraftforge.event.entity.player.PlayerEvent.Clone import net.minecraftforge.event.entity.player.PlayerEvent.PlayerChangedDimensionEvent import net.minecraftforge.eventbus.api.SubscribeEvent -import ru.dbotthepony.mc.otm.Registry +import ru.dbotthepony.mc.otm.registry.Registry import ru.dbotthepony.mc.otm.android.AndroidResearch import ru.dbotthepony.mc.otm.android.AndroidResearchType import ru.dbotthepony.mc.otm.capability.MatteryCapability -import ru.dbotthepony.mc.otm.core.Fraction import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.network.android.AndroidResearchPacket import ru.dbotthepony.mc.otm.network.android.AndroidStatusPacket +import ru.dbotthepony.mc.otm.registry.AndroidFeatures +import ru.dbotthepony.mc.otm.registry.MNames import ru.dbotthepony.mc.otm.set import java.util.* @@ -221,7 +222,7 @@ class AndroidCapabilityPlayer(@JvmField val ply: Player) : AndroidCapability(ply // TODO: Maybe passive drain? // extractEnergyInner(BigDecimal.valueOf(new Random().nextDouble()), false); - if (ply.isSwimming && !hasFeature(Registry.AndroidFeatures.AIR_BAGS)) { + if (ply.isSwimming && !hasFeature(AndroidFeatures.AIR_BAGS)) { ply.isSwimming = false } @@ -259,7 +260,7 @@ class AndroidCapabilityPlayer(@JvmField val ply: Player) : AndroidCapability(ply val ent = event.`object` if (ent is Player) { - event.addCapability(Registry.Names.ANDROID_CAPABILITY, AndroidCapabilityPlayer(ent)) + event.addCapability(MNames.ANDROID_CAPABILITY, AndroidCapabilityPlayer(ent)) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/BlackHoleRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/BlackHoleRenderer.kt index 64c5e3154..f259fef76 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/BlackHoleRenderer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/BlackHoleRenderer.kt @@ -12,12 +12,12 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider import net.minecraft.network.chat.TranslatableComponent import net.minecraft.world.phys.Vec3 import org.lwjgl.opengl.GL30 -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityGravitationStabilizer import ru.dbotthepony.mc.otm.block.entity.blackhole.BlockEntityBlackHole import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.core.* import ru.dbotthepony.mc.otm.menu.FormattingHelper +import ru.dbotthepony.mc.otm.registry.MItems import kotlin.math.PI private const val BEAM_WIDTH = 0.2 @@ -112,7 +112,7 @@ class BlackHoleRenderer(private val context: BlockEntityRendererProvider.Context val ply = Minecraft.getInstance().player if (ply != null) { - if (ply.mainHandItem.item == Registry.Items.GRAVITATION_STABILIZER || ply.offhandItem.item == Registry.Items.GRAVITATION_STABILIZER) { + if (ply.mainHandItem.item == MItems.GRAVITATION_STABILIZER || ply.offhandItem.item == MItems.GRAVITATION_STABILIZER) { RenderSystem.setShader(GameRenderer::getPositionTexShader) RenderSystem.setShaderTexture(0, BeaconRenderer.BEAM_LOCATION) RenderSystem.disableCull() @@ -143,7 +143,7 @@ class BlackHoleRenderer(private val context: BlockEntityRendererProvider.Context } if (!Minecraft.getInstance().options.hideGui && ( - (ply.mainHandItem.item == Registry.Items.BLACK_HOLE_SCANNER || ply.offhandItem.item == Registry.Items.BLACK_HOLE_SCANNER) && + (ply.mainHandItem.item == MItems.BLACK_HOLE_SCANNER || ply.offhandItem.item == MItems.BLACK_HOLE_SCANNER) && poseStack.translation().length() < tile.gravitationStrength * 64.0 || (ply.abilities.instabuild || ply.abilities.invulnerable || ply.getCapability(MatteryCapability.ANDROID).isPresent && diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenAndroidStation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenAndroidStation.kt index f559d0299..2c737c549 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenAndroidStation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/ScreenAndroidStation.kt @@ -6,7 +6,7 @@ import net.minecraft.client.Minecraft import net.minecraft.network.chat.Component import net.minecraft.network.chat.TranslatableComponent import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.Registry +import ru.dbotthepony.mc.otm.registry.Registry import ru.dbotthepony.mc.otm.android.AndroidResearch import ru.dbotthepony.mc.otm.android.AndroidResearchType import ru.dbotthepony.mc.otm.capability.MatteryCapability diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/compat/jei/JEIPlugin.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/compat/jei/JEIPlugin.kt index df038e2a0..8771775a6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/compat/jei/JEIPlugin.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/compat/jei/JEIPlugin.kt @@ -7,7 +7,7 @@ import mezz.jei.api.registration.IRecipeCatalystRegistration import net.minecraft.resources.ResourceLocation import net.minecraft.world.item.ItemStack import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.Registry +import ru.dbotthepony.mc.otm.registry.MBlocks @JeiPlugin class JEIPlugin : IModPlugin { @@ -20,6 +20,6 @@ class JEIPlugin : IModPlugin { } override fun registerRecipeCatalysts(registration: IRecipeCatalystRegistration) { - registration.addRecipeCatalyst(ItemStack(Registry.Blocks.CHEMICAL_GENERATOR), VanillaRecipeCategoryUid.FUEL) + registration.addRecipeCatalyst(ItemStack(MBlocks.CHEMICAL_GENERATOR), VanillaRecipeCategoryUid.FUEL) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemTritaniumArmor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemTritaniumArmor.kt index 13fd9f4b6..5d43a2fd1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemTritaniumArmor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/item/ItemTritaniumArmor.kt @@ -1,11 +1,6 @@ package ru.dbotthepony.mc.otm.item import net.minecraft.client.model.HumanoidModel -import net.minecraft.client.model.geom.PartPose -import net.minecraft.client.model.geom.builders.CubeDeformation -import net.minecraft.client.model.geom.builders.CubeListBuilder -import net.minecraft.client.model.geom.builders.LayerDefinition -import net.minecraft.client.model.geom.builders.MeshDefinition import net.minecraft.sounds.SoundEvent import net.minecraft.sounds.SoundEvents import net.minecraft.world.entity.Entity @@ -18,8 +13,8 @@ import net.minecraft.world.item.Rarity import net.minecraft.world.item.crafting.Ingredient import net.minecraftforge.client.IItemRenderProperties import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.client.model.TritaniumArmorModel +import ru.dbotthepony.mc.otm.registry.MTags import java.util.function.Consumer @@ -48,7 +43,7 @@ private object TritaniumArmorMaterial : ArmorMaterial { override fun getEnchantmentValue() = 9 override fun getEquipSound(): SoundEvent = SoundEvents.ARMOR_EQUIP_GENERIC - override fun getRepairIngredient(): Ingredient = Ingredient.of(Registry.Tags.Items.INGOT_TRITANIUM) + override fun getRepairIngredient(): Ingredient = Ingredient.of(MTags.Items.INGOT_TRITANIUM) const val ID = "${OverdriveThatMatters.MOD_ID}:tritanium_armor" diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterData.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterData.kt index 70a68440c..9a6338bbd 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterData.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterData.kt @@ -9,8 +9,9 @@ import net.minecraft.world.item.crafting.RecipeType import net.minecraftforge.event.server.ServerStartedEvent import net.minecraftforge.eventbus.api.SubscribeEvent import org.apache.logging.log4j.LogManager -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.core.ImpreciseFraction +import ru.dbotthepony.mc.otm.registry.MItems +import ru.dbotthepony.mc.otm.registry.MRecipes /** * baselineComplexityReplicateTicks * complexity = replicate ticks @@ -139,7 +140,7 @@ fun serverStartData(event: ServerStartedEvent) { floodRecipeCategory(event.server.recipeManager.getAllRecipesFor(RecipeType.BLASTING)) floodRecipeCategory(event.server.recipeManager.getAllRecipesFor(RecipeType.SMOKING)) floodRecipeCategory(event.server.recipeManager.getAllRecipesFor(RecipeType.STONECUTTING)) - floodRecipeCategory(event.server.recipeManager.getAllRecipesFor(Registry.Recipes.PLATE_PRESS)) + floodRecipeCategory(event.server.recipeManager.getAllRecipesFor(MRecipes.PLATE_PRESS)) floodRecipeCategory(event.server.recipeManager.getAllRecipesFor(RecipeType.CRAFTING)) for (item in mappedInputs.keys) { @@ -341,7 +342,7 @@ private fun registerRoots() { make(Items.AMETHYST_SHARD, AMETHYST) make(Items.DIAMOND, DIAMOND) make(Items.IRON_INGOT, IRON) - make(Registry.Items.TRITANIUM_INGOT, TRITANIUM) + make(MItems.TRITANIUM_INGOT, TRITANIUM) make(Items.COPPER_INGOT, COPPER) make(Items.LAPIS_LAZULI, LAPIS) make(Items.REDSTONE, REDSTONE) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuAndroidStation.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuAndroidStation.kt index 43317488b..7949586a6 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuAndroidStation.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuAndroidStation.kt @@ -4,10 +4,10 @@ import net.minecraft.world.SimpleContainer 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.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityAndroidStation import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.android.IAndroidCapability +import ru.dbotthepony.mc.otm.registry.MMenus private class AndroidStationContainer(val player: Player) : SimpleContainer(1) { var android: IAndroidCapability? = null @@ -33,7 +33,7 @@ class AndroidStationMenu @JvmOverloads constructor( containerID: Int, inventory: Inventory, tile: BlockEntityAndroidStation? = null -) : MenuMatteryPowered(Registry.Menus.ANDROID_STATION, containerID, inventory, tile) { +) : MenuMatteryPowered(MMenus.ANDROID_STATION, containerID, inventory, tile) { val androidBattery: MatterySlot = AndroidBatterySlot(AndroidStationContainer(inventory.player), 0) init { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuBatteryBank.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuBatteryBank.kt index 5d12dee40..634ce0a2b 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuBatteryBank.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuBatteryBank.kt @@ -5,16 +5,16 @@ import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory import ru.dbotthepony.mc.otm.block.entity.BlockEntityBatteryBank import net.minecraft.world.SimpleContainer -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.orNull +import ru.dbotthepony.mc.otm.registry.MMenus class MenuBatteryBank @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityBatteryBank? = null, -) : MatteryMenu(Registry.Menus.BATTERY_BANK, p_38852_, inventory, tile) { +) : MatteryMenu(MMenus.BATTERY_BANK, p_38852_, inventory, tile) { val powerLevel: LevelGaugeWidget val containerSlots: Array diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuCargoCrate.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuCargoCrate.kt index 9cff6b48c..1584f70f7 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuCargoCrate.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuCargoCrate.kt @@ -3,14 +3,14 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Player -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityCargoCrate +import ru.dbotthepony.mc.otm.registry.MMenus class MenuCargoCrate @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityCargoCrate? = null -) : MatteryMenu(Registry.Menus.CARGO_CRATE, p_38852_, inventory, tile) { +) : MatteryMenu(MMenus.CARGO_CRATE, p_38852_, inventory, tile) { val crateSlots: Array init { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuChemicalGenerator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuChemicalGenerator.kt index d6efedef3..b17009a0e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuChemicalGenerator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuChemicalGenerator.kt @@ -5,14 +5,14 @@ import net.minecraft.world.entity.player.Inventory import net.minecraft.world.item.ItemStack import net.minecraftforge.common.ForgeHooks import net.minecraftforge.energy.CapabilityEnergy -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityChemicalGenerator import ru.dbotthepony.mc.otm.menu.data.IntDataContainer import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget +import ru.dbotthepony.mc.otm.registry.MMenus class MenuChemicalGenerator @JvmOverloads constructor(id: Int, inv: Inventory, tile: BlockEntityChemicalGenerator? = null) - : MatteryMenu(Registry.Menus.CHEMICAL_GENERATOR, id, inv, tile) { + : MatteryMenu(MMenus.CHEMICAL_GENERATOR, id, inv, tile) { val container = tile?.container ?: SimpleContainer(3) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveRack.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveRack.kt index 94e0184c4..b435ae1ef 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveRack.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveRack.kt @@ -2,14 +2,14 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveRack +import ru.dbotthepony.mc.otm.registry.MMenus class MenuDriveRack @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityDriveRack? = null -) : MenuMatteryPowered(Registry.Menus.DRIVE_RACK, p_38852_, inventory, tile) { +) : MenuMatteryPowered(MMenus.DRIVE_RACK, p_38852_, inventory, tile) { val drives = arrayOfNulls(4) init { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveViewer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveViewer.kt index c2207a77d..2586f5721 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveViewer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuDriveViewer.kt @@ -7,7 +7,6 @@ import net.minecraft.world.entity.player.Player import net.minecraft.world.item.ItemStack import net.minecraftforge.energy.CapabilityEnergy import net.minecraftforge.network.NetworkEvent -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityDriveViewer import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.drive.IMatteryDrive @@ -15,6 +14,7 @@ import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive import ru.dbotthepony.mc.otm.item.ItemPortableCondensationDrive.FilterSettings import ru.dbotthepony.mc.otm.menu.data.INetworkedItemViewSupplier import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView +import ru.dbotthepony.mc.otm.registry.MMenus import ru.dbotthepony.mc.otm.storage.ItemStackWrapper import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent import java.util.function.Supplier @@ -24,7 +24,7 @@ class MenuDriveViewer @JvmOverloads constructor( inventory: Inventory, tile: BlockEntityDriveViewer? = null ) : MenuMatteryPowered( - Registry.Menus.DRIVE_VIEWER, containerID, inventory, tile + MMenus.DRIVE_VIEWER, containerID, inventory, tile ), INetworkedItemViewSupplier { @JvmField val view: NetworkedItemView private val powered: PoweredVirtualComponent? diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuEnergyCounter.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuEnergyCounter.kt index c85fac927..de1e22e26 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuEnergyCounter.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuEnergyCounter.kt @@ -2,16 +2,15 @@ package ru.dbotthepony.mc.otm.menu import kotlin.jvm.JvmOverloads import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityEnergyCounter -import ru.dbotthepony.mc.otm.menu.data.FractionDataContainer import ru.dbotthepony.mc.otm.menu.data.ImpreciseFractionDataContainer +import ru.dbotthepony.mc.otm.registry.MMenus class MenuEnergyCounter @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityEnergyCounter? = null -) : MatteryMenu(Registry.Menus.ENERGY_COUNTER, p_38852_, inventory, tile) { +) : MatteryMenu(MMenus.ENERGY_COUNTER, p_38852_, inventory, tile) { @JvmField val passed = ImpreciseFractionDataContainer() @JvmField val average = ImpreciseFractionDataContainer() @JvmField val last20Ticks = ImpreciseFractionDataContainer() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuItemMonitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuItemMonitor.kt index afd6cdc23..0efb943a0 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuItemMonitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuItemMonitor.kt @@ -3,11 +3,11 @@ 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.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityItemMonitor import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.menu.data.INetworkedItemViewSupplier import ru.dbotthepony.mc.otm.menu.data.NetworkedItemView +import ru.dbotthepony.mc.otm.registry.MMenus import ru.dbotthepony.mc.otm.storage.ItemStackWrapper import ru.dbotthepony.mc.otm.storage.PoweredVirtualComponent import ru.dbotthepony.mc.otm.storage.VirtualComponent @@ -16,7 +16,7 @@ class MenuItemMonitor @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityItemMonitor? = null -) : MenuMatteryPowered(Registry.Menus.ITEM_MONITOR, p_38852_, inventory, tile), INetworkedItemViewSupplier { +) : MenuMatteryPowered(MMenus.ITEM_MONITOR, p_38852_, inventory, tile), INetworkedItemViewSupplier { @JvmField val view = NetworkedItemView(inventory.player, this, tile == null) private val subscribed: VirtualComponent? diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterBottler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterBottler.kt index c27319344..ea65f3f13 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterBottler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterBottler.kt @@ -3,7 +3,6 @@ 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.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterBottler import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.capability.matter.MatterDirection @@ -12,13 +11,14 @@ import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.network.MatterBottlerSwitchPacket import ru.dbotthepony.mc.otm.network.MatteryNetworking +import ru.dbotthepony.mc.otm.registry.MMenus class MenuMatterBottler @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityMatterBottler? = null ) : MenuMatteryPowered( - Registry.Menus.MATTER_BOTTLER, p_38852_, inventory, tile + MMenus.MATTER_BOTTLER, p_38852_, inventory, tile ) { var workFlow = BooleanDataContainer() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterCapacitor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterCapacitor.kt index a292a9f8e..226499592 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterCapacitor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterCapacitor.kt @@ -2,19 +2,18 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterCapacitorBank -import ru.dbotthepony.mc.otm.core.Fraction 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 class MenuMatterCapacitor @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityMatterCapacitorBank? = null ) : MatteryMenu( - Registry.Menus.MATTER_CAPACITOR_BANK, p_38852_, inventory, tile + MMenus.MATTER_CAPACITOR_BANK, p_38852_, inventory, tile ) { val matterGauge: LevelGaugeWidget val totalMatterGauge: LevelGaugeWidget diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterDecomposer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterDecomposer.kt index 3283862cb..6e5e6ef38 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterDecomposer.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterDecomposer.kt @@ -7,16 +7,16 @@ import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import net.minecraft.world.SimpleContainer import net.minecraft.world.item.ItemStack -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.capability.MatteryCapability import ru.dbotthepony.mc.otm.matter.canDecompose import ru.dbotthepony.mc.otm.orNull +import ru.dbotthepony.mc.otm.registry.MMenus class MenuMatterDecomposer @JvmOverloads constructor( containerID: Int, inventory: Inventory, tile: BlockEntityMatterDecomposer? = null -) : MenuMatteryPowered(Registry.Menus.MATTER_DECOMPOSER, containerID, inventory, tile) { +) : MenuMatteryPowered(MMenus.MATTER_DECOMPOSER, containerID, inventory, tile) { val input: MatterySlot val outputMain: MachineOutputSlot val outputStacking: MachineOutputSlot diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterPanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterPanel.kt index 99904d883..773eb4822 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterPanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterPanel.kt @@ -5,7 +5,6 @@ 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.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterPanel import ru.dbotthepony.mc.otm.capability.matter.MatterTask import ru.dbotthepony.mc.otm.capability.matter.PatternState @@ -15,6 +14,7 @@ import ru.dbotthepony.mc.otm.network.CancelMatterTaskPacket import ru.dbotthepony.mc.otm.network.MatterTaskPacket import ru.dbotthepony.mc.otm.network.MatteryNetworking import ru.dbotthepony.mc.otm.network.PatternGridPacket +import ru.dbotthepony.mc.otm.registry.MMenus import java.util.* import java.util.function.Consumer @@ -22,7 +22,7 @@ class MenuMatterPanel @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityMatterPanel? = null -) : MatteryMenu(Registry.Menus.MATTER_PANEL, p_38852_, inventory, tile), IMatterGraphListener { +) : MatteryMenu(MMenus.MATTER_PANEL, p_38852_, inventory, tile), IMatterGraphListener { fun taskUpdated(task: MatterTask) { sendNetwork(MatterTaskPacket(true, listOf(task))) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterRecycler.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterRecycler.kt index d8d31174e..6949cffbb 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterRecycler.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterRecycler.kt @@ -3,17 +3,17 @@ 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.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterRecycler import ru.dbotthepony.mc.otm.item.ItemMatterDust import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget +import ru.dbotthepony.mc.otm.registry.MMenus class MenuMatterRecycler @JvmOverloads constructor( containerID: Int, inventory: Inventory, tile: BlockEntityMatterRecycler? = null -) : MenuMatteryPowered(Registry.Menus.MATTER_RECYCLER, containerID, inventory, tile) { +) : MenuMatteryPowered(MMenus.MATTER_RECYCLER, containerID, inventory, tile) { val input: MatterySlot val progress: ProgressGaugeWidget val matter = LevelGaugeWidget(this, tile?.matter) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterReplicator.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterReplicator.kt index b9825a024..9250fcfa2 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterReplicator.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterReplicator.kt @@ -6,14 +6,14 @@ import ru.dbotthepony.mc.otm.block.entity.BlockEntityMatterReplicator import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import net.minecraft.world.SimpleContainer -import ru.dbotthepony.mc.otm.Registry +import ru.dbotthepony.mc.otm.registry.MMenus class MenuMatterReplicator @JvmOverloads constructor( p_38852_: Int, inventory: Inventory, tile: BlockEntityMatterReplicator? = null ) : MenuMatteryPowered( - Registry.Menus.MATTER_REPLICATOR, p_38852_, inventory, tile + MMenus.MATTER_REPLICATOR, p_38852_, inventory, tile ) { val matter: LevelGaugeWidget val progress: ProgressGaugeWidget diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterScanner.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterScanner.kt index c1dea8732..059fe8d76 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterScanner.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuMatterScanner.kt @@ -7,9 +7,9 @@ import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget import ru.dbotthepony.mc.otm.menu.widget.LevelGaugeWidget import net.minecraft.world.SimpleContainer import net.minecraft.world.item.ItemStack -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.core.ImpreciseFraction import ru.dbotthepony.mc.otm.matter.canDecompose +import ru.dbotthepony.mc.otm.registry.MMenus import java.math.BigInteger class MenuMatterScanner @JvmOverloads constructor( @@ -17,7 +17,7 @@ class MenuMatterScanner @JvmOverloads constructor( inventory: Inventory, tile: BlockEntityMatterScanner? = null ) : MenuMatteryPowered( - Registry.Menus.MATTER_SCANNER, p_38852_, inventory, tile + MMenus.MATTER_SCANNER, p_38852_, inventory, tile ) { val input: MatterySlot val progress: ProgressGaugeWidget diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPatternStorage.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPatternStorage.kt index e7b7f73d6..1b551a686 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPatternStorage.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPatternStorage.kt @@ -2,19 +2,18 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityPatternStorage -import ru.dbotthepony.mc.otm.core.Fraction 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 class MenuPatternStorage @JvmOverloads constructor( p_38852_: Int, inventory: Inventory?, tile: BlockEntityPatternStorage? = null ) : MatteryMenu( - Registry.Menus.PATTERN_STORAGE, p_38852_, inventory!!, tile + MMenus.PATTERN_STORAGE, p_38852_, inventory!!, tile ) { val pattern_slots = arrayOfNulls(2 * 4) val stored_this: LevelGaugeWidget diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPlatePress.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPlatePress.kt index c144f553d..41945c808 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPlatePress.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/menu/MenuPlatePress.kt @@ -2,15 +2,15 @@ package ru.dbotthepony.mc.otm.menu import net.minecraft.world.SimpleContainer import net.minecraft.world.entity.player.Inventory -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityPlatePress import ru.dbotthepony.mc.otm.menu.widget.ProgressGaugeWidget +import ru.dbotthepony.mc.otm.registry.MMenus class MenuPlatePress @JvmOverloads constructor( containerID: Int, inventory: Inventory, tile: BlockEntityPlatePress? = null -) : MenuMatteryPowered(Registry.Menus.PLATE_PRESS, containerID, inventory, tile) { +) : MenuMatteryPowered(MMenus.PLATE_PRESS, containerID, inventory, tile) { val container = tile?.container ?: SimpleContainer(2) val inputSlot = MatterySlot(container, BlockEntityPlatePress.SLOT_INPUT) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt index 03f33c9a2..483df7f67 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/recipe/PlatePressRecipe.kt @@ -15,9 +15,10 @@ import net.minecraft.world.level.Level import net.minecraftforge.registries.ForgeRegistryEntry import org.apache.logging.log4j.LogManager import ru.dbotthepony.mc.otm.OverdriveThatMatters -import ru.dbotthepony.mc.otm.Registry import ru.dbotthepony.mc.otm.block.entity.BlockEntityPlatePress import ru.dbotthepony.mc.otm.get +import ru.dbotthepony.mc.otm.registry.MNames +import ru.dbotthepony.mc.otm.registry.MRecipes class PlatePressRecipe( private val id: ResourceLocation, @@ -78,7 +79,7 @@ class PlatePressRecipe( return PlatePressRecipeFactory } - override fun getType(): RecipeType = Registry.Recipes.PLATE_PRESS + override fun getType(): RecipeType = MRecipes.PLATE_PRESS } object PlatePressRecipeFactory : ForgeRegistryEntry>(), RecipeSerializer { @@ -86,7 +87,7 @@ object PlatePressRecipeFactory : ForgeRegistryEntry>(), Reci private val LOGGER = LogManager.getLogger() init { - registryName = Registry.Names.PLATE_PRESS + registryName = MNames.PLATE_PRESS } override fun fromJson(loc: ResourceLocation, obj: JsonObject): PlatePressRecipe {