diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/advancements/MachineAdvancementsData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/advancements/MachineAdvancementsData.kt index d42055f7b..ee3fb0337 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/advancements/MachineAdvancementsData.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/advancements/MachineAdvancementsData.kt @@ -108,7 +108,7 @@ fun addMachineAdvancements(serializer: Consumer, lang: Matter russianName = "Сканируем вещи которые материальны") val decomposer = CraftEntry(MItems.MATTER_DECOMPOSER.values, "Decaying the Atoms", "Keep your limbs outside of the working chamber at all times", russianName = "Разлагаем атомы", russianSuffix = "Во всех ситуациях держите свои конечности вне рабочей камеры") - val panel = CraftEntry(MItems.MATTER_PANEL, "Indexing the Library", + val panel = CraftEntry(MItems.MATTER_PANEL.values, "Indexing the Library", russianName = "Индексируем библиотеку") val replicator = CraftEntry(MItems.MATTER_REPLICATOR.values, "Cook with (Im)Perfection", "Now let's bake some perfect bread", russianName = "Повар с (не) идеальностями", russianSuffix = "А теперь давайте выпечем немного идеального хлеба") @@ -184,7 +184,7 @@ fun addMachineAdvancements(serializer: Consumer, lang: Matter russianSuffix = "Только пользоваться этим устройством могут вёдра с болтами", englishSuffix = "Except only buckets of bolts can use this thing") - val charger = CraftEntry(MItems.ANDROID_CHARGER, "Android Home Router", + val charger = CraftEntry(MItems.ANDROID_CHARGER.values, "Android Home Router", russianName = "Домашняя страница андроидов") station.make(serializer, press, translation).also { diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockModels.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockModels.kt index 56051f317..531d0fd89 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockModels.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockModels.kt @@ -16,7 +16,16 @@ fun addBlockModels(provider: MatteryBlockModelProvider) { colored(MBlocks.MATTER_RECONSTRUCTOR, listOf("0", "particle")) colored("matter_capacitor_bank", listOf("1", "particle"), "mattercapacitorbank_frame") - colored("battery_bank", listOf("1", "particle"), "batterybank_frame") + colored("battery_bank", listOf("0", "particle"), "batterybank_frame") + + colored("android_charger", "_base", listOf("0", "particle")) + colored("android_charger", "_middle", listOf("0", "particle")) + colored("android_charger", "_top", listOf("0", "particle")) + + colored("storage_power_supplier", listOf("0", "particle")) + colored("matter_panel", listOf("texture", "particle")) + colored("drive_viewer", "_idle", listOf("texture", "particle")) + colored("drive_viewer", "_working", listOf("texture", "particle")) coloredMachineCombined("plate_press", "plate_press2", listOf("0", "particle")) coloredMachineCombined("twin_plate_press", "plate_press2", listOf("0", "particle")) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockStates.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockStates.kt index 5d1e53aca..70bacd72d 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockStates.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/BlockStates.kt @@ -46,15 +46,17 @@ fun addBlockStates(provider: MatteryBlockStateProvider) { } } - with(provider.getMultipartBuilder(MBlocks.ANDROID_CHARGER)) { - for (dir in BlockRotationFreedom.HORIZONTAL.possibleValues) { - for (part in AndroidChargerBlock.PART.possibleValues) { - part().modelFile(provider.models().getExistingFile(modLocation("block/${MNames.ANDROID_CHARGER}_${part.serializedName}"))) - .rotationY(dir.front.yRotationBlockstateNorth()) - .addModel() - .condition(AndroidChargerBlock.PART, part) - .condition(BlockRotationFreedom.HORIZONTAL.property, dir) - .end() + for (block in MBlocks.ANDROID_CHARGER.values) { + with(provider.getMultipartBuilder(block)) { + for (dir in BlockRotationFreedom.HORIZONTAL.possibleValues) { + for (part in AndroidChargerBlock.PART.possibleValues) { + part().modelFile(provider.models().getExistingFile(modLocation("block/${block.registryName!!.path}_${part.serializedName}"))) + .rotationY(dir.front.yRotationBlockstateNorth()) + .addModel() + .condition(AndroidChargerBlock.PART, part) + .condition(BlockRotationFreedom.HORIZONTAL.property, dir) + .end() + } } } } @@ -104,7 +106,8 @@ fun addBlockStates(provider: MatteryBlockStateProvider) { provider.block(MBlocks.POWERED_FURNACE.values) provider.block(MBlocks.POWERED_SMOKER.values) - provider.block(MBlocks.STORAGE_POWER_SUPPLIER) + provider.block(MBlocks.STORAGE_POWER_SUPPLIER.values) + provider.block(MBlocks.MATTER_PANEL.values) provider.block(MBlocks.MATTER_RECYCLER.values) provider.block(MBlocks.MATTER_RECONSTRUCTOR.values) provider.block(MBlocks.ENERGY_SERVO) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/ComplexBlockStates.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/ComplexBlockStates.kt index dbadd096c..f0c14a863 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/ComplexBlockStates.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/blocks/ComplexBlockStates.kt @@ -7,26 +7,29 @@ import ru.dbotthepony.mc.otm.block.matter.PatternStorageBlock import ru.dbotthepony.mc.otm.block.storage.DriveViewerBlock import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth +import ru.dbotthepony.mc.otm.core.registryName import ru.dbotthepony.mc.otm.datagen.modLocation import ru.dbotthepony.mc.otm.registry.MBlocks fun addComplexBlockStates(provider: MatteryBlockStateProvider) { - with(provider.getMultipartBuilder(MBlocks.DRIVE_VIEWER)) { - for (facing in BlockRotationFreedom.HORIZONTAL.possibleValues) { - part() - .modelFile(provider.models().getExistingFile(modLocation("block/drive_viewer_drive_part"))) - .rotationY(facing.front.yRotationBlockstateNorth()) - .addModel() - .condition(BlockRotationFreedom.HORIZONTAL.property, facing) - .condition(DriveViewerBlock.DRIVE_PRESENT, true) - - for (workState in WorkerState.SEMI_WORKER_STATE.possibleValues) { + for (block in MBlocks.DRIVE_VIEWER.values) { + with(provider.getMultipartBuilder(block)) { + for (facing in BlockRotationFreedom.HORIZONTAL.possibleValues) { part() - .modelFile(provider.models().getExistingFile(modLocation("block/drive_viewer_${workState.name.lowercase()}"))) + .modelFile(provider.models().getExistingFile(modLocation("block/drive_viewer_drive_part"))) .rotationY(facing.front.yRotationBlockstateNorth()) .addModel() - .condition(WorkerState.SEMI_WORKER_STATE, workState) .condition(BlockRotationFreedom.HORIZONTAL.property, facing) + .condition(DriveViewerBlock.DRIVE_PRESENT, true) + + for (workState in WorkerState.SEMI_WORKER_STATE.possibleValues) { + part() + .modelFile(provider.models().getExistingFile(modLocation("block/${block.registryName!!.path}_${workState.name.lowercase()}"))) + .rotationY(facing.front.yRotationBlockstateNorth()) + .addModel() + .condition(WorkerState.SEMI_WORKER_STATE, workState) + .condition(BlockRotationFreedom.HORIZONTAL.property, facing) + } } } } diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt index 2a7dc3cc7..8990c07b7 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/items/ItemModels.kt @@ -171,6 +171,7 @@ fun addItemModels(provider: MatteryItemModelProvider) { provider.coloredWithBaseBlock(MItems.MATTER_BOTTLER, "matter_bottler", "_idle") provider.coloredWithBaseBlock(MItems.MATTER_SCANNER, "matter_scanner", "_idle") provider.coloredWithBaseBlock(MItems.MATTER_REPLICATOR, "matter_replicator", "_idle") + provider.coloredWithBaseBlock(MItems.DRIVE_VIEWER, "drive_viewer", "_idle") provider.block(MItems.MATTER_CABLE, "matter_cable_core") provider.coloredWithBaseBlock(MItems.MATTER_DECOMPOSER, "matter_decomposer", "_idle") provider.block(MItems.ENERGY_SERVO, "energy_servo") @@ -183,10 +184,17 @@ fun addItemModels(provider: MatteryItemModelProvider) { provider.coloredWithBaseBlock(MItems.PLATE_PRESS, "plate_press", "_idle") provider.coloredWithBaseBlock(MItems.TWIN_PLATE_PRESS, "twin_plate_press", "_idle") - provider.block(MItems.STORAGE_POWER_SUPPLIER, "storage_power_supplier") + provider.coloredWithBaseBlock(MItems.STORAGE_POWER_SUPPLIER, "storage_power_supplier") provider.coloredWithBaseBlock(MItems.MATTER_RECYCLER, "matter_recycler", "_idle") provider.coloredWithBaseBlock(MItems.COBBLESTONE_GENERATOR, "cobblestone_generator") + for (dye in DyeColor.entries) { + provider.exec { + provider.withExistingParent("android_charger_${dye.name.lowercase()}", modLocation("item/android_charger")).texture("0", modLocation("block/android_charger/${dye.name.lowercase()}")) + provider.withExistingParent("matter_panel_${dye.name.lowercase()}", modLocation("item/matter_panel")).texture("texture", modLocation("block/matter_panel/${dye.name.lowercase()}")) + } + } + provider.block(MItems.STORAGE_BUS) provider.block(MItems.STORAGE_IMPORTER) provider.block(MItems.STORAGE_EXPORTER) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt index 912698d02..927636f6f 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/English.kt @@ -417,18 +417,18 @@ private fun death(provider: MatteryLanguageProvider) { private fun blocks(provider: MatteryLanguageProvider) { with(provider.english) { addBlock(MBlocks.ANDROID_STATION.values, "Android Station") - add(MBlocks.ANDROID_CHARGER, "Wireless Charger") - add(MBlocks.ANDROID_CHARGER, "desc", "Charges nearby androids and exopacks") + addBlock(MBlocks.ANDROID_CHARGER.values, "Wireless Charger") + addBlock(MBlocks.ANDROID_CHARGER.values, "desc", "Charges nearby androids and exopacks") addBlock(MBlocks.BATTERY_BANK.values, "Battery Bank") addBlock(MBlocks.MATTER_DECOMPOSER.values, "Matter Decomposer") addBlock(MBlocks.MATTER_CAPACITOR_BANK.values, "Matter Capacitor Bank") add(MBlocks.MATTER_CABLE, "Matter Network Cable") add(MBlocks.PATTERN_STORAGE, "Pattern Storage") addBlock(MBlocks.MATTER_SCANNER.values, "Matter Scanner") - add(MBlocks.MATTER_PANEL, "Pattern Monitor") + addBlock(MBlocks.MATTER_PANEL.values, "Pattern Monitor") addBlock(MBlocks.MATTER_REPLICATOR.values, "Matter Replicator") addBlock(MBlocks.MATTER_BOTTLER.values, "Matter Bottler") - add(MBlocks.DRIVE_VIEWER, "Drive Viewer") + addBlock(MBlocks.DRIVE_VIEWER.values, "Drive Viewer") add(MBlocks.BLACK_HOLE, "Local Anomalous Spacetime Dilation Singular Point") addBlock(MBlocks.COBBLESTONE_GENERATOR.values, "Cobblestone Generator") add(MBlocks.INFINITE_WATER_SOURCE, "Infinite Water Source") @@ -486,7 +486,7 @@ private fun blocks(provider: MatteryLanguageProvider) { add(MBlocks.TRITANIUM_RAW_BLOCK, "Raw Tritanium Block") add(MBlocks.STORAGE_CABLE, "Storage Cable") - add(MBlocks.STORAGE_POWER_SUPPLIER, "Storage Power Supplier") + addBlock(MBlocks.STORAGE_POWER_SUPPLIER.values, "Storage Power Supplier") add(MBlocks.STORAGE_BUS, "Storage Bus") add(MBlocks.STORAGE_IMPORTER, "Storage Importer") add(MBlocks.STORAGE_EXPORTER, "Storage Exporter") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt index 33373595b..3dc3f7820 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/lang/Russian.kt @@ -419,18 +419,18 @@ private fun death(provider: MatteryLanguageProvider) { private fun blocks(provider: MatteryLanguageProvider) { with(provider.russian) { addBlock(MBlocks.ANDROID_STATION.values, "Станция андроидов") - add(MBlocks.ANDROID_CHARGER, "Беспроводной зарядник") - add(MBlocks.ANDROID_CHARGER, "desc", "Заряжает ближайших андроидов и экзопаки") + addBlock(MBlocks.ANDROID_CHARGER.values, "Беспроводной зарядник") + addBlock(MBlocks.ANDROID_CHARGER.values, "desc", "Заряжает ближайших андроидов и экзопаки") addBlock(MBlocks.BATTERY_BANK.values, "Банк аккумуляторов") addBlock(MBlocks.MATTER_DECOMPOSER.values, "Декомпозитор материи") addBlock(MBlocks.MATTER_CAPACITOR_BANK.values, "Банк накопителей материи") add(MBlocks.MATTER_CABLE, "Кабель сети материи") add(MBlocks.PATTERN_STORAGE, "Хранилище шаблонов") addBlock(MBlocks.MATTER_SCANNER.values, "Сканер материи") - add(MBlocks.MATTER_PANEL, "Монитор шаблонов") + addBlock(MBlocks.MATTER_PANEL.values, "Монитор шаблонов") addBlock(MBlocks.MATTER_REPLICATOR.values, "Репликатор материи") addBlock(MBlocks.MATTER_BOTTLER.values, "Бутилировщик материи") - add(MBlocks.DRIVE_VIEWER, "Просмотрщик дисков конденсации") + addBlock(MBlocks.DRIVE_VIEWER.values, "Просмотрщик дисков конденсации") add(MBlocks.BLACK_HOLE, "Локализированная сингулярная точка аномального искажения пространства-времени") addBlock(MBlocks.COBBLESTONE_GENERATOR.values, "Генератор булыжника") add(MBlocks.INFINITE_WATER_SOURCE, "Неиссякаемый источник воды") @@ -488,7 +488,7 @@ private fun blocks(provider: MatteryLanguageProvider) { add(MBlocks.TRITANIUM_RAW_BLOCK, "Блок рудного тритана") add(MBlocks.STORAGE_CABLE, "Кабель хранилища") - add(MBlocks.STORAGE_POWER_SUPPLIER, "Подстанция сети хранилища") + addBlock(MBlocks.STORAGE_POWER_SUPPLIER.values, "Подстанция сети хранилища") add(MBlocks.STORAGE_BUS, "Шина хранилища") add(MBlocks.STORAGE_IMPORTER, "Импортер хранилища") add(MBlocks.STORAGE_EXPORTER, "Экспортер хранилища") diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesData.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesData.kt index ae5ead785..c6d6db337 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesData.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/loot/LootTablesData.kt @@ -144,14 +144,14 @@ fun addLootTables(lootTables: LootTables) { lootTables.tile(MBlocks.HOLO_SIGN, "isLocked") lootTables.tile(MBlocks.STORAGE_CABLE) lootTables.tile(MBlocks.ANDROID_STATION.values) - lootTables.tile(MBlocks.ANDROID_CHARGER) + lootTables.tile(MBlocks.ANDROID_CHARGER.values) lootTables.tile(MBlocks.BATTERY_BANK.values) - lootTables.tile(MBlocks.DRIVE_VIEWER) + lootTables.tile(MBlocks.DRIVE_VIEWER.values) lootTables.tile(MBlocks.STORAGE_BUS) lootTables.tile(MBlocks.STORAGE_IMPORTER) lootTables.tile(MBlocks.STORAGE_EXPORTER) - lootTables.tile(MBlocks.STORAGE_POWER_SUPPLIER) + lootTables.tile(MBlocks.STORAGE_POWER_SUPPLIER.values) lootTables.tile(MBlocks.DRIVE_RACK) lootTables.tile(MBlocks.MATTER_DECOMPOSER.values) @@ -165,7 +165,7 @@ fun addLootTables(lootTables: LootTables) { lootTables.tile(MBlocks.POWERED_SMOKER.values) lootTables.tile(MBlocks.POWERED_BLAST_FURNACE.values) - lootTables.tile(MBlocks.MATTER_PANEL) + lootTables.tile(MBlocks.MATTER_PANEL.values) lootTables.tile(MBlocks.PATTERN_STORAGE) lootTables.tile(MBlocks.MATTER_CAPACITOR_BANK.values) lootTables.tile(MBlocks.MATTER_BOTTLER.values) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt index 8bbe938dd..f95654429 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/models/MatteryModelProvider.kt @@ -127,6 +127,10 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve return colored(modelName, "", textureKeys.associateWith { modelName }) } + fun colored(modelName: String, suffix: String, textureKeys: Collection) { + return colored(modelName, suffix, textureKeys.associateWith { modelName }) + } + fun coloredMachineCombined(modelName: String, textureName: String, textureKeys: Collection) { for (state in listOf("_idle", "_error", "_working")) { colored(modelName, state, textureKeys.associateWith { textureName }) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt index 6131890fc..2dc37b549 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/CraftingTableRecipes.kt @@ -322,7 +322,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) { .build(consumer) // беспроводной зарядник андроидов - MatteryRecipe(MItems.ANDROID_CHARGER) + MatteryRecipe(MItems.ANDROID_CHARGER[null]!!) .row(MItems.ELECTRIC_PARTS, MItems.QUANTUM_TRANSCEIVER, MItems.ELECTRIC_PARTS) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES) diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/PainterRecipes.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/PainterRecipes.kt index 94cb6b3bb..38b956114 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/PainterRecipes.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/recipes/PainterRecipes.kt @@ -289,6 +289,10 @@ fun addPainterRecipes(consumer: RecipeOutput) { MItems.POWERED_BLAST_FURNACE, MItems.MATTER_RECYCLER, MItems.ANDROID_STATION, + MItems.STORAGE_POWER_SUPPLIER, + MItems.DRIVE_VIEWER, + MItems.ANDROID_CHARGER, + MItems.MATTER_PANEL, ) for (list in blocks) { diff --git a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt index 9e4d0f783..2d9edd62e 100644 --- a/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt +++ b/src/data/kotlin/ru/dbotthepony/mc/otm/datagen/tags/Tags.kt @@ -180,7 +180,7 @@ fun addTags(tagsProvider: TagsProvider) { *MBlocks.MATTER_CAPACITOR_BANK.values.toTypedArray(), MBlocks.PATTERN_STORAGE, *MBlocks.MATTER_SCANNER.values.toTypedArray(), - MBlocks.MATTER_PANEL, + *MBlocks.MATTER_PANEL.values.toTypedArray(), *MBlocks.MATTER_REPLICATOR.values.toTypedArray(), *MBlocks.MATTER_BOTTLER.values.toTypedArray(), MBlocks.ENERGY_COUNTER, @@ -198,10 +198,10 @@ fun addTags(tagsProvider: TagsProvider) { MBlocks.STORAGE_IMPORTER, MBlocks.STORAGE_EXPORTER, - MBlocks.DRIVE_VIEWER, + *MBlocks.DRIVE_VIEWER.values.toTypedArray(), MBlocks.DRIVE_RACK, *MBlocks.ITEM_MONITOR.values.toTypedArray(), - MBlocks.STORAGE_POWER_SUPPLIER, + *MBlocks.STORAGE_POWER_SUPPLIER.values.toTypedArray(), MBlocks.PHANTOM_ATTRACTOR, MBlocks.ENERGY_SERVO, @@ -217,7 +217,7 @@ fun addTags(tagsProvider: TagsProvider) { *MBlocks.ESSENCE_STORAGE.values.toTypedArray(), *MBlocks.MATTER_RECONSTRUCTOR.values.toTypedArray(), MBlocks.FLUID_TANK, - MBlocks.ANDROID_CHARGER, + *MBlocks.ANDROID_CHARGER.values.toTypedArray(), ), Tiers.IRON) tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ANVIL, Tiers.IRON) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt index 9fa0ca85e..e52220123 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/block/entity/tech/AbstractPoweredFurnaceBlockEntity.kt @@ -5,6 +5,7 @@ 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.item.crafting.AbstractCookingRecipe import net.minecraft.world.item.crafting.BlastingRecipe import net.minecraft.world.item.crafting.RecipeType @@ -46,19 +47,31 @@ sealed class AbstractPoweredFurnaceBlockEntity

, val secondaryRecipeType: RecipeType?, - val config: WorkerBalanceValues -) : MatteryWorkerBlockEntity(type, blockPos, blockState, ItemJob.CODEC, 2) { + val config: WorkerBalanceValues, + maxJobs: Int = 2 +) : MatteryWorkerBlockEntity(type, blockPos, blockState, ItemJob.CODEC, maxJobs) { final override val upgrades = UpgradeContainer(this::markDirtyFast, 2, UpgradeType.BASIC_PROCESSING) final override val energy = ProfiledEnergyStorage(WorkerEnergyStorage(this::energyLevelUpdated, upgrades.transform(config))) - val inputs = immutableList(2) { MatteryContainer(this::itemContainerUpdated, 1) } - val outputs = immutableList(2) { MatteryContainer(this::itemContainerUpdated, 1) } + val inputs = immutableList(maxJobs) { MatteryContainer(this::itemContainerUpdated, 1) } + val outputs = immutableList(maxJobs) { MatteryContainer(this::itemContainerUpdated, 1) } init { inputs.forEach { addDroppableContainer(it) } outputs.forEach { addDroppableContainer(it) } } + inner class SyncSlot { + var inputItem by synchronizer.item(observe = false) + var outputItem by synchronizer.item(observe = false) + var progress by synchronizer.float().property + var visualRotation = 0f + } + + var lastRender = 0L + + val syncSlots = immutableList(maxJobs) { SyncSlot() } + val experience = ExperienceStorage(config::maxExperienceStored).also(::addNeighbourListener) val energyConfig = ConfigurableEnergy(energy) val itemConfig = ConfigurableItemHandler( @@ -92,11 +105,19 @@ sealed class AbstractPoweredFurnaceBlockEntity

, id: Int) { if (outputs[id].fullyAddItem(status.job.itemStack)) { experience.storeExperience(status.experience, this) + syncSlots[id].inputItem = ItemStack.EMPTY + syncSlots[id].outputItem = ItemStack.EMPTY + syncSlots[id].progress = 0f } else { status.noItem() } } + override fun onJobTick(status: JobStatus, id: Int) { + super.onJobTick(status, id) + syncSlots[id].progress = status.workProgress + } + override fun computeNextJob(id: Int): JobContainer { if (!energy.batteryLevel.isPositive) return JobContainer.noEnergy() @@ -131,9 +152,14 @@ sealed class AbstractPoweredFurnaceBlockEntity

30_000_000L) { - tile.particleRenderScore = tile.particleRenderScore % 30_000_000L + tile.particleRenderScore %= 30_000_000L if (rand.nextDouble() > 0.75 && !isPaused && tile.blockState[WorkerState.WORKER_STATE] == WorkerState.WORKING) { val (x, y, z) = tile.blockPos diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/PoweredSmokerRenderer.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/PoweredSmokerRenderer.kt new file mode 100644 index 000000000..0832b46d5 --- /dev/null +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/render/blockentity/PoweredSmokerRenderer.kt @@ -0,0 +1,74 @@ +package ru.dbotthepony.mc.otm.client.render.blockentity + +import com.mojang.blaze3d.vertex.PoseStack +import net.minecraft.client.renderer.MultiBufferSource +import net.minecraft.client.renderer.block.model.ItemTransforms +import net.minecraft.client.renderer.blockentity.BlockEntityRenderer +import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider +import ru.dbotthepony.mc.otm.block.entity.tech.AbstractPoweredFurnaceBlockEntity +import ru.dbotthepony.mc.otm.core.math.normalizeAngle +import ru.dbotthepony.mc.otm.core.math.rotateY +import ru.dbotthepony.mc.otm.core.math.yRotationNorth +import ru.dbotthepony.mc.otm.core.math.yRotationSouth + +class PoweredSmokerRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer> { + override fun render(tile: AbstractPoweredFurnaceBlockEntity<*, *>, partialTick: Float, pose: PoseStack, buffers: MultiBufferSource, packedLight: Int, packedOverlay: Int) { + val diff = System.nanoTime() - tile.lastRender + tile.lastRender = System.nanoTime() + + for (slot in tile.syncSlots) { + if (slot.inputItem.isEmpty && slot.outputItem.isEmpty) continue + slot.visualRotation = normalizeAngle(slot.visualRotation + diff / 400_000_000f) + + pose.pushPose() + pose.translate(0.5f, 0.5f, 0.5f) + pose.rotateY(tile.blockRotation.front.yRotationNorth()) + pose.translate(-0.5f, -0.5f, -0.5f) + pose.translate(0.625f, 0.5f, 0.5f) + pose.scale(0.25f, 0.25f, 0.25f) + + pose.rotateY(slot.visualRotation) + + if (slot.progress <= 0.8f && !slot.inputItem.isEmpty) { + val model = context.itemRenderer.getModel( + slot.inputItem, + tile.level, + null, + 0 + ) + + context.itemRenderer.render( + slot.inputItem, + ItemTransforms.TransformType.NONE, + false, + pose, + buffers, + packedLight, + packedOverlay, + model + ) + } else if (slot.progress > 0.8f && !slot.outputItem.isEmpty) { + val model = context.itemRenderer.getModel( + slot.outputItem, + tile.level, + null, + 0 + ) + + context.itemRenderer.render( + slot.outputItem, + ItemTransforms.TransformType.NONE, + false, + pose, + buffers, + packedLight, + packedOverlay, + model + ) + } + + pose.popPose() + break + } + } +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/EuclidMath.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/EuclidMath.kt index cac3f59d9..599db0dac 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/EuclidMath.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/math/EuclidMath.kt @@ -656,8 +656,8 @@ fun Direction.yRotationNorth(): Float { return when (this) { Direction.DOWN, Direction.UP, Direction.NORTH -> 0f Direction.SOUTH -> PIf - Direction.WEST -> -PIf / 2f - Direction.EAST -> PIf / 2f + Direction.WEST -> PIf / 2f + Direction.EAST -> -PIf / 2f } } @@ -665,8 +665,8 @@ fun Direction.yRotationSouth(): Float { return when (this) { Direction.DOWN, Direction.UP, Direction.SOUTH -> 0f Direction.NORTH -> PIf - Direction.WEST -> PIf / 2f - Direction.EAST -> -PIf / 2f + Direction.WEST -> -PIf / 2f + Direction.EAST -> PIf / 2f } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/Savetables.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/Savetables.kt index bd8a2b099..e348fb661 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/Savetables.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/core/util/Savetables.kt @@ -52,9 +52,10 @@ class Savetables : INBTSerializable { return stateful(getter, name, T::class.java) } - inline fun , reified T : Tag> stateful(values: List, name: String): ImmutableList> { + inline fun , reified T : Tag> stateful(values: Collection, name: String): ImmutableList> { + val iterator = values.iterator() return immutableList(values.size) { - stateful(values[it], "${name}_$it", T::class.java) + stateful(iterator.next(), "${name}_$it", T::class.java) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt index 40480d309..f63103276 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/matter/MatterManager.kt @@ -1611,6 +1611,22 @@ object MatterManager { val stream2 = stream.map { it to get(it.value) } + fun writeValue(a: String, b: String, c: String, commentary: Collection) { + if (commentary.size < 2) { + writer.write(arrayOf(a, b, c, commentary.firstOrNull() ?: "").joinToString(";", transform = ::transformQuotes)) + writer.write("\n") + } else { + val iterator = commentary.iterator() + writer.write(arrayOf(a, b, c, iterator.next()).joinToString(";", transform = ::transformQuotes)) + writer.write("\n") + + for (v in iterator) { + writer.write(arrayOf("", "", "", v).joinToString(";", transform = ::transformQuotes)) + writer.write("\n") + } + } + } + for ((entry, value) in filter.filter(stream2)) { val (key, item) = entry val isBlacklisted: Boolean @@ -1624,16 +1640,14 @@ object MatterManager { } if (isBlacklisted) { - writer.write(arrayOf(key.location().toString(), "---", "---", "Item is blacklisted from having matter value").joinToString(";", transform = ::transformQuotes)) + writeValue(key.location().toString(), "---", "---", listOf("Item is blacklisted from having matter value")) } else { if (!value.hasMatterValue) { - writer.write(arrayOf(key.location().toString(), "", "", commentary[item]?.joinToString("\n", transform = { transformQuotes(it.string) }) ?: "").joinToString(";", transform = ::transformQuotes)) + writeValue(key.location().toString(), "", "", commentary[item]?.map { it.string } ?: listOf()) } else { - writer.write(arrayOf(key.location().toString(), value.matter.toString(), value.complexity.toString(), commentary[item]?.joinToString("\n", transform = { transformQuotes(it.string) }) ?: "").joinToString(";", transform = ::transformQuotes)) + writeValue(key.location().toString(), value.matter.toString(), value.complexity.toString(), commentary[item]?.map { it.string } ?: listOf()) } } - - writer.write("\n") } writer.close() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/AndroidFeatures.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/AndroidFeatures.kt index eb4b7cb9c..c8c195727 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/AndroidFeatures.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/AndroidFeatures.kt @@ -8,22 +8,22 @@ import ru.dbotthepony.mc.otm.android.DummyAndroidFeature import ru.dbotthepony.mc.otm.android.feature.* object AndroidFeatures { - private val registry = DeferredRegister.create(MRegistry.ANDROID_FEATURES_KEY, OverdriveThatMatters.MOD_ID) + private val registry = MDeferredRegister(MRegistry.ANDROID_FEATURES_KEY) - val AIR_BAGS: AndroidFeatureType by registry.register(MNames.AIR_BAGS) { AndroidFeatureType(::DummyAndroidFeature) } - val STEP_ASSIST: AndroidFeatureType by registry.register(MNames.STEP_ASSIST) { AndroidFeatureType(::StepAssistFeature) } - val SWIM_BOOSTERS: AndroidFeatureType by registry.register(MNames.SWIM_BOOSTERS) { AndroidFeatureType(::SwimBoostersFeature) } - val LIMB_OVERCLOCKING: AndroidFeatureType by registry.register(MNames.LIMB_OVERCLOCKING) { AndroidFeatureType(::LimbOverclockingFeature) } - val ATTACK_BOOST: AndroidFeatureType by registry.register(MNames.ATTACK_BOOST) { AndroidFeatureType(::AttackBoostFeature) } - val NANOBOTS_REGENERATION: AndroidFeatureType by registry.register(MNames.NANOBOTS_REGENERATION) { AndroidFeatureType(::NanobotsRegenerationFeature) } - val NANOBOTS_ARMOR: AndroidFeatureType by registry.register(MNames.NANOBOTS_ARMOR) { AndroidFeatureType(::NanobotsArmorFeature) } - val EXTENDED_REACH: AndroidFeatureType by registry.register(MNames.EXTENDED_REACH) { AndroidFeatureType(::ExtendedReachFeature) } - val NIGHT_VISION: AndroidFeatureType by registry.register(MNames.NIGHT_VISION) { AndroidFeatureType(::NightVisionFeature) } - val SHOCKWAVE: AndroidFeatureType by registry.register(MNames.SHOCKWAVE) { AndroidFeatureType(::ShockwaveFeature) } - val ITEM_MAGNET: AndroidFeatureType by registry.register(MNames.ITEM_MAGNET) { AndroidFeatureType(::ItemMagnetFeature) } - val FALL_DAMPENERS: AndroidFeatureType by registry.register(MNames.FALL_DAMPENERS) { AndroidFeatureType(::FallDampenersFeature) } - val JUMP_BOOST: AndroidFeatureType by registry.register(MNames.JUMP_BOOST) { AndroidFeatureType(::JumpBoostFeature) } - val ENDER_TELEPORTER: AndroidFeatureType by registry.register(MNames.ENDER_TELEPORTER) { AndroidFeatureType(::EnderTeleporterFeature) } + val AIR_BAGS by registry.register(MNames.AIR_BAGS) { AndroidFeatureType(::DummyAndroidFeature) } + val STEP_ASSIST by registry.register(MNames.STEP_ASSIST) { AndroidFeatureType(::StepAssistFeature) } + val SWIM_BOOSTERS by registry.register(MNames.SWIM_BOOSTERS) { AndroidFeatureType(::SwimBoostersFeature) } + val LIMB_OVERCLOCKING by registry.register(MNames.LIMB_OVERCLOCKING) { AndroidFeatureType(::LimbOverclockingFeature) } + val ATTACK_BOOST by registry.register(MNames.ATTACK_BOOST) { AndroidFeatureType(::AttackBoostFeature) } + val NANOBOTS_REGENERATION by registry.register(MNames.NANOBOTS_REGENERATION) { AndroidFeatureType(::NanobotsRegenerationFeature) } + val NANOBOTS_ARMOR by registry.register(MNames.NANOBOTS_ARMOR) { AndroidFeatureType(::NanobotsArmorFeature) } + val EXTENDED_REACH by registry.register(MNames.EXTENDED_REACH) { AndroidFeatureType(::ExtendedReachFeature) } + val NIGHT_VISION by registry.register(MNames.NIGHT_VISION) { AndroidFeatureType(::NightVisionFeature) } + val SHOCKWAVE by registry.register(MNames.SHOCKWAVE) { AndroidFeatureType(::ShockwaveFeature) } + val ITEM_MAGNET by registry.register(MNames.ITEM_MAGNET) { AndroidFeatureType(::ItemMagnetFeature) } + val FALL_DAMPENERS by registry.register(MNames.FALL_DAMPENERS) { AndroidFeatureType(::FallDampenersFeature) } + val JUMP_BOOST by registry.register(MNames.JUMP_BOOST) { AndroidFeatureType(::JumpBoostFeature) } + val ENDER_TELEPORTER by registry.register(MNames.ENDER_TELEPORTER) { AndroidFeatureType(::EnderTeleporterFeature) } internal fun register(bus: IEventBus) { registry.register(bus) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/Ext.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/Ext.kt deleted file mode 100644 index 9b3ff14b8..000000000 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/Ext.kt +++ /dev/null @@ -1,25 +0,0 @@ -package ru.dbotthepony.mc.otm.registry - -import net.minecraft.world.item.DyeColor -import net.minecraftforge.registries.DeferredRegister -import net.minecraftforge.registries.RegistryObject -import ru.dbotthepony.mc.otm.core.collect.SupplierMap -import java.util.function.Supplier -import kotlin.reflect.KProperty - -operator fun RegistryObject.getValue(thisRef: Any, property: KProperty<*>): T { - return get() -} - -internal fun DeferredRegister.colored(prefix: String, factory: (color: DyeColor, name: String) -> R): Map { - return SupplierMap(MRegistry.DYE_ORDER.map { it to register(prefix + "_" + it.name.lowercase()) { factory.invoke(it, prefix + "_" + it.name.lowercase()) } }) -} - -internal fun DeferredRegister.coloredWithBase(prefix: String, factory: (color: DyeColor?, name: String) -> R): Map { - val values = ArrayList>>() - - values.add(null to register(prefix) { factory.invoke(null, prefix) }) - MRegistry.DYE_ORDER.forEach { values.add(it to register(prefix + "_" + it.name.lowercase()) { factory.invoke(it, prefix + "_" + it.name.lowercase()) }) } - - return SupplierMap(values) -} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlockEntities.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlockEntities.kt index ed14ab272..701b44c92 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlockEntities.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlockEntities.kt @@ -38,50 +38,54 @@ import java.util.function.Supplier @Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") // Type<*> is unused in BlockEntityType.Builder object MBlockEntities { - private val registry = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, OverdriveThatMatters.MOD_ID) + private val registry = MDeferredRegister(ForgeRegistries.BLOCK_ENTITY_TYPES) - private fun register(name: String, factory: BlockEntityType.BlockEntitySupplier, vararg blocks: Supplier): RegistryObject> { + private fun register(name: String, factory: BlockEntityType.BlockEntitySupplier, vararg blocks: Supplier): MDeferredRegister<*>.Entry> { return registry.register(name) { BlockEntityType.Builder.of(factory, *blocks.map { it.get() }.toTypedArray()).build(null) } } - val ANDROID_STATION by register(MNames.ANDROID_STATION, ::AndroidStationBlockEntity, *MBlocks.ANDROID_STATION.asSupplierArray()) - val BATTERY_BANK by register(MNames.BATTERY_BANK, ::BatteryBankBlockEntity, *MBlocks.BATTERY_BANK.asSupplierArray()) - val MATTER_DECOMPOSER by register(MNames.MATTER_DECOMPOSER, ::MatterDecomposerBlockEntity, *MBlocks.MATTER_DECOMPOSER.asSupplierArray()) - val MATTER_CAPACITOR_BANK by register(MNames.MATTER_CAPACITOR_BANK, ::MatterCapacitorBankBlockEntity, *MBlocks.MATTER_CAPACITOR_BANK.asSupplierArray()) + private fun register(name: String, factory: BlockEntityType.BlockEntitySupplier, blocks: Map<*, Block>): MDeferredRegister<*>.Entry> { + return registry.register(name) { BlockEntityType.Builder.of(factory, *blocks.values.toTypedArray()).build(null) } + } + + val ANDROID_STATION by register(MNames.ANDROID_STATION, ::AndroidStationBlockEntity, MBlocks.ANDROID_STATION) + val BATTERY_BANK by register(MNames.BATTERY_BANK, ::BatteryBankBlockEntity, MBlocks.BATTERY_BANK) + val MATTER_DECOMPOSER by register(MNames.MATTER_DECOMPOSER, ::MatterDecomposerBlockEntity, MBlocks.MATTER_DECOMPOSER) + val MATTER_CAPACITOR_BANK by register(MNames.MATTER_CAPACITOR_BANK, ::MatterCapacitorBankBlockEntity, MBlocks.MATTER_CAPACITOR_BANK) val MATTER_CABLE by register(MNames.MATTER_CABLE, ::MatterCableBlockEntity, MBlocks::MATTER_CABLE) val STORAGE_CABLE by register(MNames.STORAGE_CABLE, ::StorageCableBlockEntity, MBlocks::STORAGE_CABLE) val PATTERN_STORAGE by register(MNames.PATTERN_STORAGE, ::PatternStorageBlockEntity, MBlocks::PATTERN_STORAGE) - val MATTER_SCANNER by register(MNames.MATTER_SCANNER, ::MatterScannerBlockEntity, *MBlocks.MATTER_SCANNER.asSupplierArray()) - val MATTER_PANEL by register(MNames.MATTER_PANEL, ::MatterPanelBlockEntity, MBlocks::MATTER_PANEL) - val MATTER_REPLICATOR by register(MNames.MATTER_REPLICATOR, ::MatterReplicatorBlockEntity, *MBlocks.MATTER_REPLICATOR.asSupplierArray()) - val MATTER_BOTTLER by register(MNames.MATTER_BOTTLER, ::MatterBottlerBlockEntity, *MBlocks.MATTER_BOTTLER.asSupplierArray()) - val DRIVE_VIEWER by register(MNames.DRIVE_VIEWER, ::DriveViewerBlockEntity, MBlocks::DRIVE_VIEWER) + val MATTER_SCANNER by register(MNames.MATTER_SCANNER, ::MatterScannerBlockEntity, MBlocks.MATTER_SCANNER) + val MATTER_PANEL by register(MNames.MATTER_PANEL, ::MatterPanelBlockEntity, MBlocks.MATTER_PANEL) + val MATTER_REPLICATOR by register(MNames.MATTER_REPLICATOR, ::MatterReplicatorBlockEntity, MBlocks.MATTER_REPLICATOR) + val MATTER_BOTTLER by register(MNames.MATTER_BOTTLER, ::MatterBottlerBlockEntity, MBlocks.MATTER_BOTTLER) + val DRIVE_VIEWER by register(MNames.DRIVE_VIEWER, ::DriveViewerBlockEntity, MBlocks.DRIVE_VIEWER) val BLACK_HOLE by register(MNames.BLACK_HOLE, ::BlackHoleBlockEntity, MBlocks::BLACK_HOLE) - val CARGO_CRATE by register(MNames.CARGO_CRATE, ::CargoCrateBlockEntity, *MRegistry.CARGO_CRATES.blocks.asSupplierArray()) + val CARGO_CRATE by register(MNames.CARGO_CRATE, ::CargoCrateBlockEntity, MRegistry.CARGO_CRATES.blocks) val DRIVE_RACK by register(MNames.DRIVE_RACK, ::DriveRackBlockEntity, MBlocks::DRIVE_RACK) - val ITEM_MONITOR by register(MNames.ITEM_MONITOR, ::ItemMonitorBlockEntity, *MBlocks.ITEM_MONITOR.asSupplierArray()) + val ITEM_MONITOR by register(MNames.ITEM_MONITOR, ::ItemMonitorBlockEntity, MBlocks.ITEM_MONITOR) val ENERGY_COUNTER by register(MNames.ENERGY_COUNTER, ::EnergyCounterBlockEntity, MBlocks::ENERGY_COUNTER) val CHEMICAL_GENERATOR by register(MNames.CHEMICAL_GENERATOR, ::ChemicalGeneratorBlockEntity, MBlocks::CHEMICAL_GENERATOR) - val PLATE_PRESS by register(MNames.PLATE_PRESS, ::PlatePressBlockEntity, *MBlocks.PLATE_PRESS.asSupplierArray()) - val TWIN_PLATE_PRESS by register(MNames.TWIN_PLATE_PRESS, { a, b -> PlatePressBlockEntity(a, b, true) }, *MBlocks.TWIN_PLATE_PRESS.asSupplierArray()) + val PLATE_PRESS by register(MNames.PLATE_PRESS, ::PlatePressBlockEntity, MBlocks.PLATE_PRESS) + val TWIN_PLATE_PRESS by register(MNames.TWIN_PLATE_PRESS, { a, b -> PlatePressBlockEntity(a, b, true) }, MBlocks.TWIN_PLATE_PRESS) val GRAVITATION_STABILIZER by register(MNames.GRAVITATION_STABILIZER, ::GravitationStabilizerBlockEntity, MBlocks::GRAVITATION_STABILIZER) - val MATTER_RECYCLER by register(MNames.MATTER_RECYCLER, ::MatterRecyclerBlockEntity, *MBlocks.MATTER_RECYCLER.asSupplierArray()) + val MATTER_RECYCLER by register(MNames.MATTER_RECYCLER, ::MatterRecyclerBlockEntity, MBlocks.MATTER_RECYCLER) val ENERGY_SERVO by register(MNames.ENERGY_SERVO, ::EnergyServoBlockEntity, MBlocks::ENERGY_SERVO) - val COBBLESTONE_GENERATOR by register(MNames.COBBLESTONE_GENERATOR, ::CobblerBlockEntity, *MBlocks.COBBLESTONE_GENERATOR.asSupplierArray()) - val ESSENCE_STORAGE by register(MNames.ESSENCE_STORAGE, ::EssenceStorageBlockEntity, *MBlocks.ESSENCE_STORAGE.asSupplierArray()) - val MATTER_RECONSTRUCTOR by register(MNames.MATTER_RECONSTRUCTOR, ::MatterReconstructorBlockEntity, *MBlocks.MATTER_RECONSTRUCTOR.asSupplierArray()) + val COBBLESTONE_GENERATOR by register(MNames.COBBLESTONE_GENERATOR, ::CobblerBlockEntity, MBlocks.COBBLESTONE_GENERATOR) + val ESSENCE_STORAGE by register(MNames.ESSENCE_STORAGE, ::EssenceStorageBlockEntity, MBlocks.ESSENCE_STORAGE) + val MATTER_RECONSTRUCTOR by register(MNames.MATTER_RECONSTRUCTOR, ::MatterReconstructorBlockEntity, MBlocks.MATTER_RECONSTRUCTOR) val FLUID_TANK by register(MNames.FLUID_TANK, ::FluidTankBlockEntity, MBlocks::FLUID_TANK) - val ANDROID_CHARGER by register(MNames.ANDROID_CHARGER, ::AndroidChargerBlockEntity, MBlocks::ANDROID_CHARGER) - val ANDROID_CHARGER_MIDDLE by register(MNames.ANDROID_CHARGER + "_middle", ::AndroidChargerMiddleBlockEntity, MBlocks::ANDROID_CHARGER) - val ANDROID_CHARGER_TOP by register(MNames.ANDROID_CHARGER + "_top", ::AndroidChargerTopBlockEntity, MBlocks::ANDROID_CHARGER) + val ANDROID_CHARGER by register(MNames.ANDROID_CHARGER, ::AndroidChargerBlockEntity, MBlocks.ANDROID_CHARGER) + val ANDROID_CHARGER_MIDDLE by register(MNames.ANDROID_CHARGER + "_middle", ::AndroidChargerMiddleBlockEntity, MBlocks.ANDROID_CHARGER) + val ANDROID_CHARGER_TOP by register(MNames.ANDROID_CHARGER + "_top", ::AndroidChargerTopBlockEntity, MBlocks.ANDROID_CHARGER) val INFINITE_WATER_SOURCE by register(MNames.INFINITE_WATER_SOURCE, ::InfiniteWaterSourceBlockEntity, MBlocks::INFINITE_WATER_SOURCE) val DEV_CHEST by register(MNames.DEV_CHEST, ::DevChestBlockEntity, MBlocks::DEV_CHEST) val PAINTER by register(MNames.PAINTER, ::PainterBlockEntity, MBlocks::PAINTER) val MATTER_ENTANGLER by register(MNames.MATTER_ENTANGLER, ::MatterEntanglerBlockEntity, MBlocks::MATTER_ENTANGLER) - val POWERED_FURNACE by register(MNames.POWERED_FURNACE, ::PoweredFurnaceBlockEntity, *MBlocks.POWERED_FURNACE.asSupplierArray()) - val POWERED_BLAST_FURNACE by register(MNames.POWERED_BLAST_FURNACE, ::PoweredBlastFurnaceBlockEntity, *MBlocks.POWERED_BLAST_FURNACE.asSupplierArray()) - val POWERED_SMOKER by register(MNames.POWERED_SMOKER, ::PoweredSmokerBlockEntity, *MBlocks.POWERED_SMOKER.asSupplierArray()) + val POWERED_FURNACE by register(MNames.POWERED_FURNACE, ::PoweredFurnaceBlockEntity, MBlocks.POWERED_FURNACE) + val POWERED_BLAST_FURNACE by register(MNames.POWERED_BLAST_FURNACE, ::PoweredBlastFurnaceBlockEntity, MBlocks.POWERED_BLAST_FURNACE) + val POWERED_SMOKER by register(MNames.POWERED_SMOKER, ::PoweredSmokerBlockEntity, MBlocks.POWERED_SMOKER) val ENERGY_CABLES: Map> = SupplierMap(CablesConfig.E.values().map { conf -> var selfFeed: Supplier> = Supplier { TODO() } @@ -89,10 +93,10 @@ object MBlockEntities { conf to selfFeed }) - val STORAGE_BUS: BlockEntityType by registry.register(MNames.STORAGE_BUS) { BlockEntityType.Builder.of(::StorageBusBlockEntity, MBlocks.STORAGE_BUS).build(null) } - val STORAGE_IMPORTER: BlockEntityType by registry.register(MNames.STORAGE_IMPORTER) { BlockEntityType.Builder.of(::StorageImporterBlockEntity, MBlocks.STORAGE_IMPORTER).build(null) } - val STORAGE_EXPORTER: BlockEntityType by registry.register(MNames.STORAGE_EXPORTER) { BlockEntityType.Builder.of(::StorageExporterBlockEntity, MBlocks.STORAGE_EXPORTER).build(null) } - val STORAGE_POWER_SUPPLIER: BlockEntityType by registry.register(MNames.STORAGE_POWER_SUPPLIER) { BlockEntityType.Builder.of(::StoragePowerSupplierBlockEntity, MBlocks.STORAGE_POWER_SUPPLIER).build(null) } + val STORAGE_BUS by register(MNames.STORAGE_BUS, ::StorageBusBlockEntity, MBlocks::STORAGE_BUS) + val STORAGE_IMPORTER by register(MNames.STORAGE_IMPORTER, ::StorageImporterBlockEntity, MBlocks::STORAGE_IMPORTER) + val STORAGE_EXPORTER by register(MNames.STORAGE_EXPORTER, ::StorageExporterBlockEntity, MBlocks::STORAGE_EXPORTER) + val STORAGE_POWER_SUPPLIER by register(MNames.STORAGE_POWER_SUPPLIER, ::StoragePowerSupplierBlockEntity, MBlocks.STORAGE_POWER_SUPPLIER) val HOLO_SIGN: BlockEntityType by registry.register(MNames.HOLO_SIGN) { BlockEntityType.Builder.of(::HoloSignBlockEntity, MBlocks.HOLO_SIGN).build(null) } @@ -114,6 +118,7 @@ object MBlockEntities { BlockEntityRenderers.register(MATTER_RECONSTRUCTOR, ::MatterReconstructorRenderer) BlockEntityRenderers.register(MATTER_REPLICATOR, ::MatterReplicatorRenderer) BlockEntityRenderers.register(MATTER_SCANNER, ::MatterScannerRenderer) + BlockEntityRenderers.register(POWERED_SMOKER, ::PoweredSmokerRenderer) BlockEntityRenderers.register(HOLO_SIGN, ::HoloSignRenderer) BlockEntityRenderers.register(FLUID_TANK, ::FluidTankRenderer) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt index 1af6c6848..efd20608e 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MBlocks.kt @@ -84,52 +84,52 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes import java.util.function.Supplier object MBlocks { - private val registry = DeferredRegister.create(ForgeRegistries.BLOCKS, OverdriveThatMatters.MOD_ID) + private val registry = MDeferredRegister(ForgeRegistries.BLOCKS) internal fun register(bus: IEventBus) { registry.register(bus) } - val ANDROID_STATION = registry.coloredWithBase(MNames.ANDROID_STATION) { color, _ -> AndroidStationBlock(color) } - val ANDROID_CHARGER: Block by registry.register(MNames.ANDROID_CHARGER) { AndroidChargerBlock() } - val BATTERY_BANK = registry.coloredWithBase(MNames.BATTERY_BANK) { color, _ -> BatteryBankBlock(color) } - val MATTER_DECOMPOSER = registry.coloredWithBase(MNames.MATTER_DECOMPOSER) { color, _ -> MatterDecomposerBlock(color) } - val MATTER_CAPACITOR_BANK = registry.coloredWithBase(MNames.MATTER_CAPACITOR_BANK) { color, _ -> MatterCapacitorBankBlock(color) } - val MATTER_CABLE: Block by registry.register(MNames.MATTER_CABLE) { MatterCableBlock() } - val PATTERN_STORAGE: Block by registry.register(MNames.PATTERN_STORAGE) { PatternStorageBlock() } - val MATTER_SCANNER = registry.coloredWithBase(MNames.MATTER_SCANNER) { color, _ -> MatterScannerBlock(color) } - val MATTER_PANEL: Block by registry.register(MNames.MATTER_PANEL) { MatterPanelBlock() } - val MATTER_REPLICATOR = registry.coloredWithBase(MNames.MATTER_REPLICATOR) { color, _ -> MatterReplicatorBlock(color) } - val MATTER_BOTTLER = registry.coloredWithBase(MNames.MATTER_BOTTLER) { color, _ -> MatterBottlerBlock(color) } - val ENERGY_COUNTER: Block by registry.register(MNames.ENERGY_COUNTER) { EnergyCounterBlock() } - val CHEMICAL_GENERATOR: Block by registry.register(MNames.CHEMICAL_GENERATOR) { ChemicalGeneratorBlock() } - val PLATE_PRESS = registry.coloredWithBase(MNames.PLATE_PRESS) { color, _ -> PlatePressBlock(color) } - val TWIN_PLATE_PRESS = registry.coloredWithBase(MNames.TWIN_PLATE_PRESS) { color, _ -> PlatePressBlock(color, isTwin = true) } - val POWERED_FURNACE = registry.coloredWithBase(MNames.POWERED_FURNACE) { color, _ -> PoweredFurnaceBlock(color) } - val POWERED_BLAST_FURNACE = registry.coloredWithBase(MNames.POWERED_BLAST_FURNACE) { color, _ -> PoweredBlastFurnaceBlock(color) } - val POWERED_SMOKER = registry.coloredWithBase(MNames.POWERED_SMOKER) { color, _ -> PoweredSmokerBlock(color) } - val MATTER_RECYCLER = registry.coloredWithBase(MNames.MATTER_RECYCLER) { color, _ -> MatterRecyclerBlock(color) } - val ENERGY_SERVO: Block by registry.register(MNames.ENERGY_SERVO) { EnergyServoBlock() } - val COBBLESTONE_GENERATOR = registry.coloredWithBase(MNames.COBBLESTONE_GENERATOR) { color, _ -> CobblerBlock(color) } - val INFINITE_WATER_SOURCE: Block by registry.register(MNames.INFINITE_WATER_SOURCE) { InfiniteWaterSourceBlock() } - val ESSENCE_STORAGE = registry.coloredWithBase(MNames.ESSENCE_STORAGE) { color, _ -> EssenceStorageBlock(color) } - val MATTER_RECONSTRUCTOR = registry.coloredWithBase(MNames.MATTER_RECONSTRUCTOR) { color, _ -> MatterReconstructorBlock(color) } - val PAINTER: PainterBlock by registry.register(MNames.PAINTER) { PainterBlock() } + val ANDROID_STATION = registry.coloredWithBase(MNames.ANDROID_STATION, ::AndroidStationBlock) + val ANDROID_CHARGER = registry.coloredWithBase(MNames.ANDROID_CHARGER, ::AndroidChargerBlock) + val BATTERY_BANK = registry.coloredWithBase(MNames.BATTERY_BANK, ::BatteryBankBlock) + val MATTER_DECOMPOSER = registry.coloredWithBase(MNames.MATTER_DECOMPOSER, ::MatterDecomposerBlock) + val MATTER_CAPACITOR_BANK = registry.coloredWithBase(MNames.MATTER_CAPACITOR_BANK, ::MatterCapacitorBankBlock) + val MATTER_CABLE by registry.register(MNames.MATTER_CABLE, ::MatterCableBlock) + val PATTERN_STORAGE by registry.register(MNames.PATTERN_STORAGE, ::PatternStorageBlock) + val MATTER_SCANNER = registry.coloredWithBase(MNames.MATTER_SCANNER, ::MatterScannerBlock) + val MATTER_PANEL = registry.coloredWithBase(MNames.MATTER_PANEL, ::MatterPanelBlock) + val MATTER_REPLICATOR = registry.coloredWithBase(MNames.MATTER_REPLICATOR, ::MatterReplicatorBlock) + val MATTER_BOTTLER = registry.coloredWithBase(MNames.MATTER_BOTTLER, ::MatterBottlerBlock) + val ENERGY_COUNTER by registry.register(MNames.ENERGY_COUNTER, ::EnergyCounterBlock) + val CHEMICAL_GENERATOR by registry.register(MNames.CHEMICAL_GENERATOR, ::ChemicalGeneratorBlock) + val PLATE_PRESS = registry.coloredWithBase(MNames.PLATE_PRESS, ::PlatePressBlock) + val TWIN_PLATE_PRESS = registry.coloredWithBase(MNames.TWIN_PLATE_PRESS) { color -> PlatePressBlock(color, isTwin = true) } + val POWERED_FURNACE = registry.coloredWithBase(MNames.POWERED_FURNACE, ::PoweredFurnaceBlock) + val POWERED_BLAST_FURNACE = registry.coloredWithBase(MNames.POWERED_BLAST_FURNACE, ::PoweredBlastFurnaceBlock) + val POWERED_SMOKER = registry.coloredWithBase(MNames.POWERED_SMOKER, ::PoweredSmokerBlock) + val MATTER_RECYCLER = registry.coloredWithBase(MNames.MATTER_RECYCLER, ::MatterRecyclerBlock) + val ENERGY_SERVO by registry.register(MNames.ENERGY_SERVO, ::EnergyServoBlock) + val COBBLESTONE_GENERATOR = registry.coloredWithBase(MNames.COBBLESTONE_GENERATOR, ::CobblerBlock) + val INFINITE_WATER_SOURCE by registry.register(MNames.INFINITE_WATER_SOURCE) { InfiniteWaterSourceBlock() } + val ESSENCE_STORAGE = registry.coloredWithBase(MNames.ESSENCE_STORAGE, ::EssenceStorageBlock) + val MATTER_RECONSTRUCTOR = registry.coloredWithBase(MNames.MATTER_RECONSTRUCTOR, ::MatterReconstructorBlock) + val PAINTER by registry.register(MNames.PAINTER, ::PainterBlock) val MATTER_ENTANGLER: MatterEntanglerBlock by registry.register(MNames.MATTER_ENTANGLER) { MatterEntanglerBlock() } val ENERGY_CABLES: Map = SupplierMap(CablesConfig.E.values().map { conf -> conf to registry.register("${conf.name.lowercase()}_energy_cable") { EnergyCableBlock { a, b -> MBlockEntities.ENERGY_CABLES[conf]!!.create(a, b)!! } } }) - val STORAGE_BUS: Block by registry.register(MNames.STORAGE_BUS) { StorageBusBlock() } - val STORAGE_IMPORTER: Block by registry.register(MNames.STORAGE_IMPORTER) { StorageImporterBlock() } - val STORAGE_EXPORTER: Block by registry.register(MNames.STORAGE_EXPORTER) { StorageExporterBlock() } + val STORAGE_BUS: Block by registry.register(MNames.STORAGE_BUS, ::StorageBusBlock) + val STORAGE_IMPORTER: Block by registry.register(MNames.STORAGE_IMPORTER, ::StorageImporterBlock) + val STORAGE_EXPORTER: Block by registry.register(MNames.STORAGE_EXPORTER, ::StorageExporterBlock) - val DRIVE_VIEWER: Block by registry.register(MNames.DRIVE_VIEWER) { DriveViewerBlock() } - val DRIVE_RACK: Block by registry.register(MNames.DRIVE_RACK) { DriveRackBlock() } - val ITEM_MONITOR = registry.coloredWithBase(MNames.ITEM_MONITOR) { color, _ -> ItemMonitorBlock(color) } - val STORAGE_CABLE: Block by registry.register(MNames.STORAGE_CABLE) { StorageCableBlock() } - val STORAGE_POWER_SUPPLIER: Block by registry.register(MNames.STORAGE_POWER_SUPPLIER) { StoragePowerSupplierBlock() } + val DRIVE_VIEWER = registry.coloredWithBase(MNames.DRIVE_VIEWER, ::DriveViewerBlock) + val DRIVE_RACK: Block by registry.register(MNames.DRIVE_RACK, ::DriveRackBlock) + val ITEM_MONITOR = registry.coloredWithBase(MNames.ITEM_MONITOR, ::ItemMonitorBlock) + val STORAGE_CABLE: Block by registry.register(MNames.STORAGE_CABLE, ::StorageCableBlock) + val STORAGE_POWER_SUPPLIER = registry.coloredWithBase(MNames.STORAGE_POWER_SUPPLIER, ::StoragePowerSupplierBlock) val DEBUG_EXPLOSION_SMALL: Block by registry.register(MNames.DEBUG_EXPLOSION_SMALL) { BlockExplosionDebugger() } val DEBUG_SPHERE_POINTS: Block by registry.register(MNames.DEBUG_SPHERE_POINTS) { BlockSphereDebugger() } @@ -211,13 +211,11 @@ object MBlocks { TRITANIUM_ANVIL = SupplierList(anvils) } - val TRITANIUM_DOOR: Map = registry.coloredWithBase(MNames.TRITANIUM_DOOR) { color, _ -> - TritaniumDoorBlock(color) } + val TRITANIUM_DOOR = registry.coloredWithBase(MNames.TRITANIUM_DOOR, ::TritaniumDoorBlock) - val TRITANIUM_TRAPDOOR: Map = registry.coloredWithBase(MNames.TRITANIUM_TRAPDOOR) { color, _ -> - TritaniumTrapdoorBlock(color) } + val TRITANIUM_TRAPDOOR = registry.coloredWithBase(MNames.TRITANIUM_TRAPDOOR, ::TritaniumTrapdoorBlock) - val TRITANIUM_STRIPED_BLOCK: Block by registry.register(MNames.TRITANIUM_STRIPED_BLOCK) { Block( + val TRITANIUM_STRIPED_BLOCK: Block by registry.register(MNames.TRITANIUM_STRIPED_BLOCK, true) { Block( BlockBehaviour.Properties.of(Material.METAL, DyeColor.LIGHT_BLUE) .sound(SoundType.BASALT) .requiresCorrectToolForDrops() diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MDeferredRegister.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MDeferredRegister.kt new file mode 100644 index 000000000..3cc38196e --- /dev/null +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MDeferredRegister.kt @@ -0,0 +1,157 @@ +package ru.dbotthepony.mc.otm.registry + +import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap +import net.minecraft.Util +import net.minecraft.core.Registry +import net.minecraft.resources.ResourceKey +import net.minecraft.resources.ResourceLocation +import net.minecraft.world.item.DyeColor +import net.minecraftforge.eventbus.api.IEventBus +import net.minecraftforge.registries.IForgeRegistry +import net.minecraftforge.registries.RegisterEvent +import org.apache.logging.log4j.LogManager +import ru.dbotthepony.mc.otm.OverdriveThatMatters +import ru.dbotthepony.mc.otm.SystemTime +import ru.dbotthepony.mc.otm.core.collect.SupplierMap +import java.util.LinkedList +import java.util.concurrent.FutureTask +import java.util.concurrent.locks.LockSupport +import java.util.function.Supplier +import kotlin.reflect.KProperty + +/** + * DeferredRegister which allows parallel initialization + */ +class MDeferredRegister(val registry: ResourceKey>, val modId: String = OverdriveThatMatters.MOD_ID) { + constructor(registry: IForgeRegistry, modId: String = OverdriveThatMatters.MOD_ID) : this(registry.registryKey, modId) + + private val entries = Object2ObjectLinkedOpenHashMap>() + private var allowRegistration = true + private var eventRegistered = false + private val stages = ArrayList() + + private inner class RegistrationStage(val serial: Boolean) { + private val entries = ArrayList>() + + fun add(entry: Entry) { + entries.add(entry) + } + + fun run(): List> { + if (serial) { + LOGGER.debug("Serial registration of {} entries from {} for {}...", entries.size, modId, registry.location()) + val t = SystemTime() + entries.forEach { it.initialize() } + LOGGER.debug("Serial registration of {} entries from {} for {} took {} ms", entries.size, modId, registry.location(), t.millis) + } else { + LOGGER.debug("Parallel registration of {} entries from {} for {}...", entries.size, modId, registry.location()) + val t = SystemTime() + val futures = LinkedList>() + entries.forEach { futures.add(FutureTask(it::initialize)) } + futures.forEach { Util.backgroundExecutor().submit(it) } + + while (futures.isNotEmpty()) { + futures.removeIf { it.run(); it.isDone } // help executor threads to minimize thread stalling + // especially true when executor threads are busy with work created by other mods + // so we keep worst-case scenario where every registry entry is initialized and registered serially as it was before + LockSupport.parkNanos(1_000_000L) + } + + // memory barrier to avoid specifying _value as @Volatile + LockSupport.parkNanos(1_000_000L) + + LOGGER.debug("Parallel registration of {} entries from {} for {} took {} ms", entries.size, modId, registry.location(), t.millis) + } + + return entries + } + } + + inner class Entry(val name: String, private val factory: Supplier, serial: Boolean) : Supplier<@UnsafeVariance T>, Lazy { + constructor(name: String, factory: Supplier) : this(name, factory, false) + + init { + check(allowRegistration) { "Unable to register new entries after RegisterEvent has been fired" } + require(entries.put(name, this) == null) { "Duplicate entry $name for registry $registry" } + + if (stages.isEmpty() || stages.last().serial != serial) { + val stage = RegistrationStage(serial) + stage.add(this) + stages.add(stage) + } else { + stages.last().add(this) + } + } + + val key = ResourceLocation(modId, name) + private var _value: T? = null + + override val value: T get() { + return _value ?: throw IllegalStateException("Trying to access $name of $registry before it is initialized") + } + + override fun isInitialized(): Boolean { + return _value != null + } + + override fun get(): T { + return value + } + + operator fun getValue(receiver: Any?, property: KProperty<*>): T { + return value + } + + fun initialize(): T { + check(_value == null) { "Already initialized $name of $registry!" } + + val getValue = try { + factory.get() + } catch (err: Throwable) { + throw RuntimeException("Unable to initialize registry entry $name of $registry", err) + } + + _value = getValue + return value + } + } + + fun colored(prefix: String, factory: (color: DyeColor) -> T): Map { + return SupplierMap(MRegistry.DYE_ORDER.map { it to Entry(prefix + "_" + it.name.lowercase()) { factory.invoke(it) } }) + } + + fun coloredWithBase(prefix: String, factory: (color: DyeColor?) -> T): Map { + val values = ArrayList>>() + + values.add(null to Entry(prefix) { factory.invoke(null) }) + MRegistry.DYE_ORDER.forEach { values.add(it to Entry(prefix + "_" + it.name.lowercase()) { factory.invoke(it) }) } + + return SupplierMap(values) + } + + fun register(name: String, factory: Supplier) = Entry(name, factory) + fun register(name: String, factory: Supplier, serial: Boolean) = Entry(name, factory, serial) + fun register(name: String, serial: Boolean, factory: Supplier) = Entry(name, factory, serial) + + private fun onRegisterEvent(event: RegisterEvent) { + if (event.registryKey == registry) { + allowRegistration = false + + for (stage in stages) { + stage.run().forEach { + event.register(registry, it.key, it) + } + } + } + } + + fun register(bus: IEventBus) { + check(!eventRegistered) { "Already registered!" } + eventRegistered = true + bus.addListener(this::onRegisterEvent) + } + + companion object { + private val LOGGER = LogManager.getLogger() + } +} diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MEntityTypes.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MEntityTypes.kt index 47cad1f74..237fa3885 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MEntityTypes.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MEntityTypes.kt @@ -17,14 +17,14 @@ import ru.dbotthepony.mc.otm.entity.MinecartCargoCrate import ru.dbotthepony.mc.otm.entity.PlasmaProjectile object MEntityTypes { - private val registry: DeferredRegister> = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, OverdriveThatMatters.MOD_ID) + private val registry = MDeferredRegister(ForgeRegistries.ENTITY_TYPES) val PLASMA: EntityType<*> by registry.register(MNames.PLASMA) { EntityType.Builder.of({ _, level -> PlasmaProjectile(level) }, MobCategory.MISC).sized(0.4f, 0.4f).build(MNames.PLASMA) } - val CARGO_CRATE_MINECARTS = registry.coloredWithBase(MNames.MINECART_CARGO_CRATE) { color, name -> - EntityType.Builder.of({ it, level -> MinecartCargoCrate(it, color, level)}, MobCategory.MISC).sized(0.98F, 0.7F).clientTrackingRange(8).build(name) + val CARGO_CRATE_MINECARTS = registry.coloredWithBase(MNames.MINECART_CARGO_CRATE) { color -> + EntityType.Builder.of({ it, level -> MinecartCargoCrate(it, color, level)}, MobCategory.MISC).sized(0.98F, 0.7F).clientTrackingRange(8).build("dfu doesn't works ✅") } internal fun register(bus: IEventBus) { diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MFluids.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MFluids.kt index ec50f1bdd..2212399a4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MFluids.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MFluids.kt @@ -15,8 +15,8 @@ import ru.dbotthepony.mc.otm.OverdriveThatMatters import java.util.function.Consumer object MFluids { - private val types: DeferredRegister = DeferredRegister.create(ForgeRegistries.Keys.FLUID_TYPES, OverdriveThatMatters.MOD_ID) - private val fluids: DeferredRegister = DeferredRegister.create(ForgeRegistries.FLUIDS, OverdriveThatMatters.MOD_ID) + private val types = MDeferredRegister(ForgeRegistries.Keys.FLUID_TYPES) + private val fluids = MDeferredRegister(ForgeRegistries.FLUIDS) internal fun register(bus: IEventBus) { types.register(bus) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItemFunctionTypes.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItemFunctionTypes.kt index c17228d89..70eeb5109 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItemFunctionTypes.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItemFunctionTypes.kt @@ -10,7 +10,7 @@ import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem import ru.dbotthepony.mc.otm.item.exopack.ProceduralExopackSlotUpgradeItem object MItemFunctionTypes { - private val registry = DeferredRegister.create(Registry.LOOT_FUNCTION_TYPE.key(), OverdriveThatMatters.MOD_ID) + private val registry = MDeferredRegister(Registry.LOOT_FUNCTION_TYPE.key(), OverdriveThatMatters.MOD_ID) val COPY_TILE_NBT: LootItemFunctionType by registry.register("copy_tile_nbt") { LootItemFunctionType(CopyTileNbtFunction.CODEC) } val PROCEDURAL_BATTERY: LootItemFunctionType by registry.register(MNames.PROCEDURAL_BATTERY) { LootItemFunctionType(ProceduralBatteryItem.Randomizer.CODEC) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt index 84237686c..e07f245cf 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MItems.kt @@ -7,13 +7,16 @@ import net.minecraft.resources.ResourceLocation import net.minecraft.world.entity.EquipmentSlot import net.minecraft.world.food.FoodProperties import net.minecraft.world.item.* +import net.minecraft.world.item.Item.Properties import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.level.Level +import net.minecraft.world.level.block.Block import net.minecraftforge.common.ForgeTier import net.minecraftforge.common.TierSortingRegistry import net.minecraftforge.eventbus.api.IEventBus import net.minecraftforge.registries.DeferredRegister import net.minecraftforge.registries.ForgeRegistries +import net.minecraftforge.registries.RegistryObject import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.capability.ITieredUpgradeSet import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability @@ -45,8 +48,12 @@ import ru.dbotthepony.mc.otm.item.weapon.PlasmaRifleItem import java.util.function.Supplier object MItems { - private val DEFAULT_PROPERTIES = Item.Properties() - private val registry: DeferredRegister = DeferredRegister.create(ForgeRegistries.ITEMS, OverdriveThatMatters.MOD_ID) + private val DEFAULT_PROPERTIES = Properties() + private val registry = MDeferredRegister(ForgeRegistries.ITEMS) + + private fun register(name: String, blocks: Map, properties: Properties = DEFAULT_PROPERTIES): Map { + return registry.coloredWithBase(name) { color -> BlockItem(blocks[color]!!, properties) } + } internal fun register(bus: IEventBus) { registry.register(bus) @@ -56,49 +63,49 @@ object MItems { conf to registry.register("${conf.name.lowercase()}_energy_cable") { BlockItem(MBlocks.ENERGY_CABLES[conf]!!, DEFAULT_PROPERTIES) } }) - val ANDROID_STATION = registry.coloredWithBase(MNames.ANDROID_STATION) { color, _ -> BlockItem(MBlocks.ANDROID_STATION[color]!!, DEFAULT_PROPERTIES) } - val ANDROID_CHARGER: BlockItem by registry.register(MNames.ANDROID_CHARGER) { BlockItem(MBlocks.ANDROID_CHARGER, DEFAULT_PROPERTIES) } - val BATTERY_BANK = registry.coloredWithBase(MNames.BATTERY_BANK) { color, _ -> BlockItem(MBlocks.BATTERY_BANK[color]!!, DEFAULT_PROPERTIES) } - val MATTER_DECOMPOSER = registry.coloredWithBase(MNames.MATTER_DECOMPOSER) { color, _ -> BlockItem(MBlocks.MATTER_DECOMPOSER[color]!!, DEFAULT_PROPERTIES) } - val MATTER_CAPACITOR_BANK = registry.coloredWithBase(MNames.MATTER_CAPACITOR_BANK) { color, _ -> BlockItem(MBlocks.MATTER_CAPACITOR_BANK[color]!!, DEFAULT_PROPERTIES) } + val ANDROID_STATION = register(MNames.ANDROID_STATION, MBlocks.ANDROID_STATION) + val ANDROID_CHARGER = register(MNames.ANDROID_CHARGER, MBlocks.ANDROID_CHARGER) + val BATTERY_BANK = register(MNames.BATTERY_BANK, MBlocks.BATTERY_BANK) + val MATTER_DECOMPOSER = register(MNames.MATTER_DECOMPOSER, MBlocks.MATTER_DECOMPOSER) + val MATTER_CAPACITOR_BANK = register(MNames.MATTER_CAPACITOR_BANK, MBlocks.MATTER_CAPACITOR_BANK) val MATTER_CABLE: BlockItem by registry.register(MNames.MATTER_CABLE) { BlockItem(MBlocks.MATTER_CABLE, DEFAULT_PROPERTIES) } val PATTERN_STORAGE: BlockItem by registry.register(MNames.PATTERN_STORAGE) { BlockItem(MBlocks.PATTERN_STORAGE, DEFAULT_PROPERTIES) } - val MATTER_SCANNER = registry.coloredWithBase(MNames.MATTER_SCANNER) { color, _ -> BlockItem(MBlocks.MATTER_SCANNER[color]!!, DEFAULT_PROPERTIES) } - val MATTER_PANEL: BlockItem by registry.register(MNames.MATTER_PANEL) { BlockItem(MBlocks.MATTER_PANEL, DEFAULT_PROPERTIES) } - val MATTER_REPLICATOR = registry.coloredWithBase(MNames.MATTER_REPLICATOR) { color, _ -> BlockItem(MBlocks.MATTER_REPLICATOR[color]!!, DEFAULT_PROPERTIES) } - val MATTER_BOTTLER = registry.coloredWithBase(MNames.MATTER_BOTTLER) { color, _ -> BlockItem(MBlocks.MATTER_BOTTLER[color]!!, DEFAULT_PROPERTIES) } + val MATTER_SCANNER = register(MNames.MATTER_SCANNER, MBlocks.MATTER_SCANNER) + val MATTER_PANEL = register(MNames.MATTER_PANEL, MBlocks.MATTER_PANEL) + val MATTER_REPLICATOR = register(MNames.MATTER_REPLICATOR, MBlocks.MATTER_REPLICATOR) + val MATTER_BOTTLER = register(MNames.MATTER_BOTTLER, MBlocks.MATTER_BOTTLER) val TRITANIUM_ORE: BlockItem by registry.register(MNames.TRITANIUM_ORE) { BlockItem(MBlocks.TRITANIUM_ORE, DEFAULT_PROPERTIES) } val DEEPSLATE_TRITANIUM_ORE: BlockItem by registry.register(MNames.DEEPSLATE_TRITANIUM_ORE) { BlockItem(MBlocks.DEEPSLATE_TRITANIUM_ORE, DEFAULT_PROPERTIES) } val TRITANIUM_RAW_BLOCK: BlockItem by registry.register(MNames.TRITANIUM_RAW_BLOCK) { BlockItem(MBlocks.TRITANIUM_RAW_BLOCK, DEFAULT_PROPERTIES) } val ENERGY_COUNTER: BlockItem by registry.register(MNames.ENERGY_COUNTER) { BlockItem(MBlocks.ENERGY_COUNTER, DEFAULT_PROPERTIES) } val CHEMICAL_GENERATOR: BlockItem by registry.register(MNames.CHEMICAL_GENERATOR) { BlockItem(MBlocks.CHEMICAL_GENERATOR, DEFAULT_PROPERTIES) } - val PLATE_PRESS = registry.coloredWithBase(MNames.PLATE_PRESS) { color, _ -> BlockItem(MBlocks.PLATE_PRESS[color]!!, DEFAULT_PROPERTIES) } - val TWIN_PLATE_PRESS = registry.coloredWithBase(MNames.TWIN_PLATE_PRESS) { color, _ -> BlockItem(MBlocks.TWIN_PLATE_PRESS[color]!!, DEFAULT_PROPERTIES) } - val MATTER_RECYCLER = registry.coloredWithBase(MNames.MATTER_RECYCLER) { color, _ -> BlockItem(MBlocks.MATTER_RECYCLER[color]!!, DEFAULT_PROPERTIES) } + val PLATE_PRESS = register(MNames.PLATE_PRESS, MBlocks.PLATE_PRESS) + val TWIN_PLATE_PRESS = register(MNames.TWIN_PLATE_PRESS, MBlocks.TWIN_PLATE_PRESS) + val MATTER_RECYCLER = register(MNames.MATTER_RECYCLER, MBlocks.MATTER_RECYCLER) - val POWERED_FURNACE = registry.coloredWithBase(MNames.POWERED_FURNACE) { color, _ -> BlockItem(MBlocks.POWERED_FURNACE[color]!!, DEFAULT_PROPERTIES) } - val POWERED_BLAST_FURNACE = registry.coloredWithBase(MNames.POWERED_BLAST_FURNACE) { color, _ -> BlockItem(MBlocks.POWERED_BLAST_FURNACE[color]!!, DEFAULT_PROPERTIES) } - val POWERED_SMOKER = registry.coloredWithBase(MNames.POWERED_SMOKER) { color, _ -> BlockItem(MBlocks.POWERED_SMOKER[color]!!, DEFAULT_PROPERTIES) } + val POWERED_FURNACE = register(MNames.POWERED_FURNACE, MBlocks.POWERED_FURNACE) + val POWERED_BLAST_FURNACE = register(MNames.POWERED_BLAST_FURNACE, MBlocks.POWERED_BLAST_FURNACE) + val POWERED_SMOKER = register(MNames.POWERED_SMOKER, MBlocks.POWERED_SMOKER) val STORAGE_BUS: BlockItem by registry.register(MNames.STORAGE_BUS) { BlockItem(MBlocks.STORAGE_BUS, DEFAULT_PROPERTIES) } val STORAGE_IMPORTER: BlockItem by registry.register(MNames.STORAGE_IMPORTER) { BlockItem(MBlocks.STORAGE_IMPORTER, DEFAULT_PROPERTIES) } val STORAGE_EXPORTER: BlockItem by registry.register(MNames.STORAGE_EXPORTER) { BlockItem(MBlocks.STORAGE_EXPORTER, DEFAULT_PROPERTIES) } - val DRIVE_VIEWER: BlockItem by registry.register(MNames.DRIVE_VIEWER) { BlockItem(MBlocks.DRIVE_VIEWER, DEFAULT_PROPERTIES) } + val DRIVE_VIEWER = register(MNames.DRIVE_VIEWER, MBlocks.DRIVE_VIEWER) val DRIVE_RACK: BlockItem by registry.register(MNames.DRIVE_RACK) { BlockItem(MBlocks.DRIVE_RACK, DEFAULT_PROPERTIES) } - val ITEM_MONITOR = registry.coloredWithBase(MNames.ITEM_MONITOR) { color, _ -> BlockItem(MBlocks.ITEM_MONITOR[color]!!, DEFAULT_PROPERTIES) } + val ITEM_MONITOR = register(MNames.ITEM_MONITOR, MBlocks.ITEM_MONITOR) val STORAGE_CABLE: BlockItem by registry.register(MNames.STORAGE_CABLE) { BlockItem(MBlocks.STORAGE_CABLE, DEFAULT_PROPERTIES) } - val STORAGE_POWER_SUPPLIER: BlockItem by registry.register(MNames.STORAGE_POWER_SUPPLIER) { BlockItem(MBlocks.STORAGE_POWER_SUPPLIER, DEFAULT_PROPERTIES) } + val STORAGE_POWER_SUPPLIER = register(MNames.STORAGE_POWER_SUPPLIER, MBlocks.STORAGE_POWER_SUPPLIER) val GRAVITATION_STABILIZER: BlockItem by registry.register(MNames.GRAVITATION_STABILIZER) { BlockItem(MBlocks.GRAVITATION_STABILIZER, DEFAULT_PROPERTIES) } val PHANTOM_ATTRACTOR: DoubleHighBlockItem by registry.register(MNames.PHANTOM_ATTRACTOR) { DoubleHighBlockItem(MBlocks.PHANTOM_ATTRACTOR, DEFAULT_PROPERTIES) } val ENERGY_SERVO: BlockItem by registry.register(MNames.ENERGY_SERVO) { BlockItem(MBlocks.ENERGY_SERVO, DEFAULT_PROPERTIES) } - val COBBLESTONE_GENERATOR: Map = registry.coloredWithBase(MNames.COBBLESTONE_GENERATOR) { color, _ -> BlockItem(MBlocks.COBBLESTONE_GENERATOR[color]!!, DEFAULT_PROPERTIES) } + val COBBLESTONE_GENERATOR = register(MNames.COBBLESTONE_GENERATOR, MBlocks.COBBLESTONE_GENERATOR) val INFINITE_WATER_SOURCE: BlockItem by registry.register(MNames.INFINITE_WATER_SOURCE) { BlockItem(MBlocks.INFINITE_WATER_SOURCE, DEFAULT_PROPERTIES) } - val ESSENCE_STORAGE: Map = registry.coloredWithBase(MNames.ESSENCE_STORAGE) { color, _ -> BlockItem(MBlocks.ESSENCE_STORAGE[color]!!, DEFAULT_PROPERTIES) } - val MATTER_RECONSTRUCTOR = registry.coloredWithBase(MNames.MATTER_RECONSTRUCTOR) { color, _ -> BlockItem(MBlocks.MATTER_RECONSTRUCTOR[color]!!, DEFAULT_PROPERTIES) } + val ESSENCE_STORAGE = register(MNames.ESSENCE_STORAGE, MBlocks.ESSENCE_STORAGE) + val MATTER_RECONSTRUCTOR = register(MNames.MATTER_RECONSTRUCTOR, MBlocks.MATTER_RECONSTRUCTOR) val DEV_CHEST: BlockItem by registry.register(MNames.DEV_CHEST) { BlockItem(MBlocks.DEV_CHEST, DEFAULT_PROPERTIES) } val PAINTER: BlockItem by registry.register(MNames.PAINTER) { BlockItem(MBlocks.PAINTER, DEFAULT_PROPERTIES) } @@ -116,7 +123,7 @@ object MItems { machines.addAll(POWERED_SMOKER.asSupplierArray()) machines.addAll(ANDROID_STATION.asSupplierArray().iterator()) - machines.add(::ANDROID_CHARGER) + machines.addAll(ANDROID_CHARGER.asSupplierArray().iterator()) machines.addAll(BATTERY_BANK.asSupplierArray().iterator()) machines.add(::ENERGY_COUNTER) machines.add(::CHEMICAL_GENERATOR) @@ -131,7 +138,7 @@ object MItems { machines.add(::MATTER_CABLE) machines.add(::PATTERN_STORAGE) machines.addAll(MATTER_SCANNER.asSupplierArray().iterator()) - machines.add(::MATTER_PANEL) + machines.addAll(MATTER_PANEL.asSupplierArray().iterator()) machines.addAll(MATTER_REPLICATOR.asSupplierArray().iterator()) machines.addAll(MATTER_BOTTLER.asSupplierArray().iterator()) machines.add(::MATTER_ENTANGLER) @@ -140,11 +147,11 @@ object MItems { machines.add(::STORAGE_BUS) machines.add(::STORAGE_IMPORTER) machines.add(::STORAGE_EXPORTER) - machines.add(::DRIVE_VIEWER) + machines.addAll(DRIVE_VIEWER.asSupplierArray().iterator()) machines.add(::DRIVE_RACK) machines.addAll(ITEM_MONITOR.asSupplierArray().iterator()) machines.add(::STORAGE_CABLE) - machines.add(::STORAGE_POWER_SUPPLIER) + machines.addAll(STORAGE_POWER_SUPPLIER.asSupplierArray().iterator()) MACHINES = SupplierList(machines) } @@ -439,8 +446,8 @@ object MItems { val ENGINE: Item by registry.register(MNames.ENGINE) { BlockItem(MBlocks.ENGINE, DEFAULT_PROPERTIES) } val HOLO_SIGN: Item by registry.register(MNames.HOLO_SIGN) { BlockItem(MBlocks.HOLO_SIGN, DEFAULT_PROPERTIES) } - val TRITANIUM_DOOR = registry.coloredWithBase(MNames.TRITANIUM_DOOR) { color, _ -> DoubleHighBlockItem(MBlocks.TRITANIUM_DOOR[color]!!, DEFAULT_PROPERTIES) } - val TRITANIUM_TRAPDOOR = registry.coloredWithBase(MNames.TRITANIUM_TRAPDOOR) { color, _ -> BlockItem(MBlocks.TRITANIUM_TRAPDOOR[color]!!, DEFAULT_PROPERTIES) } + val TRITANIUM_DOOR = register(MNames.TRITANIUM_DOOR, MBlocks.TRITANIUM_DOOR) + val TRITANIUM_TRAPDOOR = register(MNames.TRITANIUM_TRAPDOOR, MBlocks.TRITANIUM_TRAPDOOR) // components val MATTER_IO_PORT: Item by registry.register(MNames.MATTER_IO_PORT) { Item(DEFAULT_PROPERTIES) } @@ -530,7 +537,7 @@ object MItems { ::REINFORCED_TRITANIUM_PLATE, ) - val CARGO_CRATE_MINECARTS = registry.coloredWithBase(MNames.MINECART_CARGO_CRATE) { color, _ -> MinecartCargoCrateItem(color) } + val CARGO_CRATE_MINECARTS = registry.coloredWithBase(MNames.MINECART_CARGO_CRATE, ::MinecartCargoCrateItem) val EXOPACK_PROBE: Item by registry.register(MNames.EXOPACK_PROBE, ::ExopackProbeItem) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MLootItemConditions.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MLootItemConditions.kt index 3c93285aa..798f6c2ea 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MLootItemConditions.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MLootItemConditions.kt @@ -15,7 +15,7 @@ import ru.dbotthepony.mc.otm.data.condition.KilledByRealPlayerOrIndirectly import ru.dbotthepony.mc.otm.data.condition.ChanceCondition object MLootItemConditions { - private val registry = DeferredRegister.create(Registry.LOOT_CONDITION_TYPE.key(), OverdriveThatMatters.MOD_ID) + private val registry = MDeferredRegister(Registry.LOOT_CONDITION_TYPE.key(), OverdriveThatMatters.MOD_ID) val HAS_EXOPACK: LootItemConditionType by registry.register("has_exopack") { LootItemConditionType(Codec2Serializer(SingletonCodec(HasExoPackCondition))) } val CHANCE_WITH_PLAYTIME: LootItemConditionType by registry.register("chance_with_playtime") { LootItemConditionType(Codec2Serializer(ChanceWithPlaytimeCondition.CODEC)) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MMenus.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MMenus.kt index 4be7d38f3..e6a46b4e0 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MMenus.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MMenus.kt @@ -74,43 +74,43 @@ import ru.dbotthepony.mc.otm.menu.tech.PoweredFurnaceMenu import ru.dbotthepony.mc.otm.menu.tech.TwinPlatePressMenu object MMenus { - private val registry = DeferredRegister.create(ForgeRegistries.MENU_TYPES, OverdriveThatMatters.MOD_ID) + private val registry = MDeferredRegister(ForgeRegistries.MENU_TYPES) - val ANDROID_STATION: MenuType by registry.register(MNames.ANDROID_STATION) { MenuType(::AndroidStationMenu) } - val ANDROID_CHARGER: MenuType by registry.register(MNames.ANDROID_CHARGER) { MenuType({ a, b -> AndroidChargerMenu(a, b, null as AndroidChargerBlockEntity?) }) } - val BATTERY_BANK: MenuType by registry.register(MNames.BATTERY_BANK) { MenuType(::BatteryBankMenu) } - val MATTER_DECOMPOSER: MenuType by registry.register(MNames.MATTER_DECOMPOSER) { MenuType(::MatterDecomposerMenu) } - val MATTER_CAPACITOR_BANK: MenuType by registry.register(MNames.MATTER_CAPACITOR_BANK) { MenuType(::MatterCapacitorBankMenu) } - val PATTERN_STORAGE: MenuType by registry.register(MNames.PATTERN_STORAGE) { MenuType(::PatternStorageMenu) } - val MATTER_SCANNER: MenuType by registry.register(MNames.MATTER_SCANNER) { MenuType(::MatterScannerMenu) } - val MATTER_PANEL: MenuType by registry.register(MNames.MATTER_PANEL) { MenuType(::MatterPanelMenu) } - val MATTER_REPLICATOR: MenuType by registry.register(MNames.MATTER_REPLICATOR) { MenuType(::MatterReplicatorMenu) } - val MATTER_BOTTLER: MenuType by registry.register(MNames.MATTER_BOTTLER) { MenuType(::MatterBottlerMenu) } - val DRIVE_VIEWER: MenuType by registry.register(MNames.DRIVE_VIEWER) { MenuType(::DriveViewerMenu) } - val CARGO_CRATE: MenuType by registry.register(MNames.CARGO_CRATE) { MenuType(::CargoCrateMenu) } - val MINECART_CARGO_CRATE: MenuType by registry.register(MNames.MINECART_CARGO_CRATE) { MenuType(::MinecartCargoCrateMenu) } - val DRIVE_RACK: MenuType by registry.register(MNames.DRIVE_RACK) { MenuType(::DriveRackMenu) } - val ITEM_MONITOR: MenuType by registry.register(MNames.ITEM_MONITOR) { MenuType(::ItemMonitorMenu) } - val ENERGY_COUNTER: MenuType by registry.register(MNames.ENERGY_COUNTER) { MenuType(::EnergyCounterMenu) } - val CHEMICAL_GENERATOR: MenuType by registry.register(MNames.CHEMICAL_GENERATOR) { MenuType(::ChemicalGeneratorMenu) } - val PLATE_PRESS: MenuType by registry.register(MNames.PLATE_PRESS) { MenuType(::PlatePressMenu) } - val POWERED_FURNACE: MenuType by registry.register(MNames.POWERED_FURNACE) { MenuType(PoweredFurnaceMenu::furnace) } - val POWERED_BLAST_FURNACE: MenuType by registry.register(MNames.POWERED_BLAST_FURNACE) { MenuType(PoweredFurnaceMenu::blasting) } - val POWERED_SMOKER: MenuType by registry.register(MNames.POWERED_SMOKER) { MenuType(PoweredFurnaceMenu::smoking) } - val TWIN_PLATE_PRESS: MenuType by registry.register(MNames.TWIN_PLATE_PRESS) { MenuType(::TwinPlatePressMenu) } - val MATTER_RECYCLER: MenuType by registry.register(MNames.MATTER_RECYCLER) { MenuType(::MatterRecyclerMenu) } - val ENERGY_SERVO: MenuType by registry.register(MNames.ENERGY_SERVO) { MenuType(::EnergyServoMenu) } - val HOLO_SIGN: MenuType by registry.register(MNames.HOLO_SIGN) { MenuType(::HoloSignMenu) } - val COBBLESTONE_GENERATOR: MenuType by registry.register(MNames.COBBLESTONE_GENERATOR) { MenuType(::CobblerMenu) } - val ESSENCE_STORAGE: MenuType by registry.register(MNames.ESSENCE_STORAGE) { MenuType(::EssenceStorageMenu) } - val ITEM_REPAIER: MenuType by registry.register(MNames.MATTER_RECONSTRUCTOR) { MenuType(::MatterReconstructorMenu) } - val FLUID_TANK: MenuType by registry.register(MNames.FLUID_TANK) { MenuType(::FluidTankMenu) } - val PAINTER: MenuType by registry.register(MNames.PAINTER) { MenuType(::PainterMenu) } - val MATTER_ENTANGLER: MenuType by registry.register(MNames.MATTER_ENTANGLER) { MenuType(::MatterEntanglerMenu) } + val ANDROID_STATION by registry.register(MNames.ANDROID_STATION) { MenuType(::AndroidStationMenu) } + val ANDROID_CHARGER by registry.register(MNames.ANDROID_CHARGER) { MenuType({ a, b -> AndroidChargerMenu(a, b, null as AndroidChargerBlockEntity?) }) } + val BATTERY_BANK by registry.register(MNames.BATTERY_BANK) { MenuType(::BatteryBankMenu) } + val MATTER_DECOMPOSER by registry.register(MNames.MATTER_DECOMPOSER) { MenuType(::MatterDecomposerMenu) } + val MATTER_CAPACITOR_BANK by registry.register(MNames.MATTER_CAPACITOR_BANK) { MenuType(::MatterCapacitorBankMenu) } + val PATTERN_STORAGE by registry.register(MNames.PATTERN_STORAGE) { MenuType(::PatternStorageMenu) } + val MATTER_SCANNER by registry.register(MNames.MATTER_SCANNER) { MenuType(::MatterScannerMenu) } + val MATTER_PANEL by registry.register(MNames.MATTER_PANEL) { MenuType(::MatterPanelMenu) } + val MATTER_REPLICATOR by registry.register(MNames.MATTER_REPLICATOR) { MenuType(::MatterReplicatorMenu) } + val MATTER_BOTTLER by registry.register(MNames.MATTER_BOTTLER) { MenuType(::MatterBottlerMenu) } + val DRIVE_VIEWER by registry.register(MNames.DRIVE_VIEWER) { MenuType(::DriveViewerMenu) } + val CARGO_CRATE by registry.register(MNames.CARGO_CRATE) { MenuType(::CargoCrateMenu) } + val MINECART_CARGO_CRATE by registry.register(MNames.MINECART_CARGO_CRATE) { MenuType(::MinecartCargoCrateMenu) } + val DRIVE_RACK by registry.register(MNames.DRIVE_RACK) { MenuType(::DriveRackMenu) } + val ITEM_MONITOR by registry.register(MNames.ITEM_MONITOR) { MenuType(::ItemMonitorMenu) } + val ENERGY_COUNTER by registry.register(MNames.ENERGY_COUNTER) { MenuType(::EnergyCounterMenu) } + val CHEMICAL_GENERATOR by registry.register(MNames.CHEMICAL_GENERATOR) { MenuType(::ChemicalGeneratorMenu) } + val PLATE_PRESS by registry.register(MNames.PLATE_PRESS) { MenuType(::PlatePressMenu) } + val POWERED_FURNACE by registry.register(MNames.POWERED_FURNACE) { MenuType(PoweredFurnaceMenu::furnace) } + val POWERED_BLAST_FURNACE by registry.register(MNames.POWERED_BLAST_FURNACE) { MenuType(PoweredFurnaceMenu::blasting) } + val POWERED_SMOKER by registry.register(MNames.POWERED_SMOKER) { MenuType(PoweredFurnaceMenu::smoking) } + val TWIN_PLATE_PRESS by registry.register(MNames.TWIN_PLATE_PRESS) { MenuType(::TwinPlatePressMenu) } + val MATTER_RECYCLER by registry.register(MNames.MATTER_RECYCLER) { MenuType(::MatterRecyclerMenu) } + val ENERGY_SERVO by registry.register(MNames.ENERGY_SERVO) { MenuType(::EnergyServoMenu) } + val HOLO_SIGN by registry.register(MNames.HOLO_SIGN) { MenuType(::HoloSignMenu) } + val COBBLESTONE_GENERATOR by registry.register(MNames.COBBLESTONE_GENERATOR) { MenuType(::CobblerMenu) } + val ESSENCE_STORAGE by registry.register(MNames.ESSENCE_STORAGE) { MenuType(::EssenceStorageMenu) } + val ITEM_REPAIER by registry.register(MNames.MATTER_RECONSTRUCTOR) { MenuType(::MatterReconstructorMenu) } + val FLUID_TANK by registry.register(MNames.FLUID_TANK) { MenuType(::FluidTankMenu) } + val PAINTER by registry.register(MNames.PAINTER) { MenuType(::PainterMenu) } + val MATTER_ENTANGLER by registry.register(MNames.MATTER_ENTANGLER) { MenuType(::MatterEntanglerMenu) } - val STORAGE_BUS: MenuType by registry.register(MNames.STORAGE_BUS) { MenuType(::StorageBusMenu) } - val STORAGE_IMPORTER_EXPORTER: MenuType by registry.register(MNames.STORAGE_IMPORTER) { MenuType(::StorageImporterExporterMenu) } - val STORAGE_POWER_SUPPLIER: MenuType by registry.register(MNames.STORAGE_POWER_SUPPLIER) { MenuType(::StoragePowerSupplierMenu) } + val STORAGE_BUS by registry.register(MNames.STORAGE_BUS) { MenuType(::StorageBusMenu) } + val STORAGE_IMPORTER_EXPORTER by registry.register(MNames.STORAGE_IMPORTER) { MenuType(::StorageImporterExporterMenu) } + val STORAGE_POWER_SUPPLIER by registry.register(MNames.STORAGE_POWER_SUPPLIER) { MenuType(::StoragePowerSupplierMenu) } internal fun register(bus: IEventBus) { registry.register(bus) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRecipes.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRecipes.kt index db9109e31..48568dbf5 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRecipes.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRecipes.kt @@ -20,15 +20,15 @@ object MRecipes { } } - private val types = DeferredRegister.create(ForgeRegistries.RECIPE_TYPES, OverdriveThatMatters.MOD_ID) - private val serializers = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, OverdriveThatMatters.MOD_ID) + private val types = MDeferredRegister(ForgeRegistries.RECIPE_TYPES, OverdriveThatMatters.MOD_ID) + private val serializers = MDeferredRegister(ForgeRegistries.RECIPE_SERIALIZERS, OverdriveThatMatters.MOD_ID) internal fun register(bus: IEventBus) { types.register(bus) serializers.register(bus) } - private fun > register(name: String): RegistryObject> { + private fun > register(name: String): MDeferredRegister<*>.Entry> { return types.register(name) { Type(name) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt index a1fd8eb15..6cc6e29db 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MRegistry.kt @@ -119,11 +119,11 @@ object MRegistry : IBlockItemRegistryAcceptor { private val decorativeBlocks = ArrayList() - override fun registerItems(registry: DeferredRegister) { + override fun registerItems(registry: MDeferredRegister) { decorativeBlocks.forEach { it.registerItems(registry) } } - override fun registerBlocks(registry: DeferredRegister) { + override fun registerBlocks(registry: MDeferredRegister) { decorativeBlocks.forEach { it.registerBlocks(registry) } } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MSoundEvents.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MSoundEvents.kt index bacaa9fee..51eead28c 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MSoundEvents.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/MSoundEvents.kt @@ -11,19 +11,19 @@ import net.minecraftforge.registries.ForgeRegistries import ru.dbotthepony.mc.otm.OverdriveThatMatters object MSoundEvents { - private val registry: DeferredRegister = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, OverdriveThatMatters.MOD_ID) + private val registry: MDeferredRegister = MDeferredRegister(ForgeRegistries.SOUND_EVENTS, OverdriveThatMatters.MOD_ID) // TODO: 1.19.3 - private fun make(name: String) = registry.register(name) { SoundEvent(ResourceLocation(OverdriveThatMatters.MOD_ID, name)) } + private fun make(name: String): MDeferredRegister.Entry = registry.register(name) { SoundEvent(ResourceLocation(OverdriveThatMatters.MOD_ID, name)) } - val RIFLE_SHOT: SoundEvent by make("item.rifle_shot") - val PLASMA_WEAPON_OVERHEAT: SoundEvent by make("item.plasma_weapon_overheat") - val PLAYER_BECOME_ANDROID: SoundEvent by make("player_become_android") - val CARGO_CRATE_OPEN: SoundEvent by make("cargo_crate_open") + val RIFLE_SHOT by make("item.rifle_shot") + val PLASMA_WEAPON_OVERHEAT by make("item.plasma_weapon_overheat") + val PLAYER_BECOME_ANDROID by make("player_become_android") + val CARGO_CRATE_OPEN by make("cargo_crate_open") - val ANDROID_JUMP_BOOST: SoundEvent by make("android.jump_boost") - val ANDROID_SHOCKWAVE: SoundEvent by make("android.shockwave") - val ANDROID_PROJ_PARRY: SoundEvent by make("android.projectile_parry") + val ANDROID_JUMP_BOOST by make("android.jump_boost") + val ANDROID_SHOCKWAVE by make("android.shockwave") + val ANDROID_PROJ_PARRY by make("android.projectile_parry") internal fun register(bus: IEventBus) { registry.register(bus) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/ColoredDecorativeBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/ColoredDecorativeBlock.kt index a591fb49c..4416da20d 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/ColoredDecorativeBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/ColoredDecorativeBlock.kt @@ -8,8 +8,10 @@ import net.minecraft.world.level.block.state.BlockBehaviour import net.minecraftforge.registries.DeferredRegister import net.minecraftforge.registries.RegistryObject import ru.dbotthepony.mc.otm.core.collect.SupplierMap +import ru.dbotthepony.mc.otm.registry.MDeferredRegister import ru.dbotthepony.mc.otm.registry.MRegistry import java.util.EnumMap +import java.util.function.Supplier /** * Colored only @@ -25,8 +27,8 @@ open class ColoredDecorativeBlock( var registeredBlocks = false private set - protected val itemMap = EnumMap>(DyeColor::class.java) - protected val blockMap = EnumMap>(DyeColor::class.java) + protected val itemMap = EnumMap>(DyeColor::class.java) + protected val blockMap = EnumMap>(DyeColor::class.java) fun forEachItem(consumer: (String, DyeColor, Item) -> Unit) { MRegistry.DYE_ORDER.forEach { @@ -60,7 +62,7 @@ open class ColoredDecorativeBlock( SupplierMap(MRegistry.DYE_ORDER.map { it to itemMap[it]!! }) } - override fun registerBlocks(registry: DeferredRegister) { + override fun registerBlocks(registry: MDeferredRegister) { check(blockMap.isEmpty()) { "( ͡° ͜ʖ ͡°) No. \\(• ε •)/ ( ͠° ل͜ ͡°) ( ͠° ͟ ͟ʖ ͡°) (ง ͠° ͟ل͜ ͡°)ง ( ͡°︺͡°) ('ω')" } MRegistry.DYE_ORDER.forEach { @@ -72,7 +74,7 @@ open class ColoredDecorativeBlock( private val properties = Item.Properties().stacksTo(64) - override fun registerItems(registry: DeferredRegister) { + override fun registerItems(registry: MDeferredRegister) { check(itemMap.isEmpty()) { "( ͡° ͜ʖ ͡°) No. \\(• ε •)/ ( ͠° ل͜ ͡°) ( ͠° ͟ ͟ʖ ͡°) (ง ͠° ͟ل͜ ͡°)ง ( ͡°︺͡°) ('ω')" } check(registeredBlocks) { "wtffffff???????????" } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/DecorativeBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/DecorativeBlock.kt index 03a4dae6d..d9912d3d4 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/DecorativeBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/DecorativeBlock.kt @@ -11,17 +11,16 @@ import net.minecraft.world.level.block.state.BlockBehaviour import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.VoxelShape -import net.minecraftforge.registries.DeferredRegister -import net.minecraftforge.registries.RegistryObject import ru.dbotthepony.mc.otm.block.RotatableMatteryBlock import ru.dbotthepony.mc.otm.block.getShapeForEachState import ru.dbotthepony.mc.otm.core.collect.SupplierMap import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.core.util.WriteOnce +import ru.dbotthepony.mc.otm.registry.MDeferredRegister import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.shapes.BlockShape -import ru.dbotthepony.mc.otm.shapes.BlockShapes +import java.util.function.Supplier import java.util.stream.Stream /** @@ -31,8 +30,8 @@ class DecorativeBlock( baseName: String, private val provider: (DyeColor?) -> Block, ) : ColoredDecorativeBlock(baseName, provider) { - private var _block: RegistryObject by WriteOnce() - private var _item: RegistryObject by WriteOnce() + private var _block: Supplier by WriteOnce() + private var _item: Supplier by WriteOnce() val block: Block get() = _block.get() val item: Item get() = _item.get() @@ -47,12 +46,12 @@ class DecorativeBlock( SupplierMap(Streams.concat(MRegistry.DYE_ORDER.stream().map { it to itemMap[it]!! }, Stream.of(null to _item))) } - override fun registerBlocks(registry: DeferredRegister) { + override fun registerBlocks(registry: MDeferredRegister) { _block = registry.register(baseName) { provider.invoke(null) } super.registerBlocks(registry) } - override fun registerItems(registry: DeferredRegister) { + override fun registerItems(registry: MDeferredRegister) { _item = registry.register(baseName) { BlockItem(_block.get(), Item.Properties().stacksTo(64)) } super.registerItems(registry) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/IBlockItemRegistryAcceptor.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/IBlockItemRegistryAcceptor.kt index 5104597eb..70cf227d0 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/IBlockItemRegistryAcceptor.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/IBlockItemRegistryAcceptor.kt @@ -2,9 +2,9 @@ package ru.dbotthepony.mc.otm.registry.objects import net.minecraft.world.item.Item import net.minecraft.world.level.block.Block -import net.minecraftforge.registries.DeferredRegister +import ru.dbotthepony.mc.otm.registry.MDeferredRegister interface IBlockItemRegistryAcceptor { - fun registerItems(registry: DeferredRegister) - fun registerBlocks(registry: DeferredRegister) + fun registerItems(registry: MDeferredRegister) + fun registerBlocks(registry: MDeferredRegister) } diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/StripedColoredDecorativeBlock.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/StripedColoredDecorativeBlock.kt index 29dc357a1..2064719e1 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/StripedColoredDecorativeBlock.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/registry/objects/StripedColoredDecorativeBlock.kt @@ -10,6 +10,7 @@ import net.minecraftforge.registries.DeferredRegister import net.minecraftforge.registries.RegistryObject import ru.dbotthepony.mc.otm.core.collect.SupplierList import ru.dbotthepony.mc.otm.core.collect.SupplierMap +import ru.dbotthepony.mc.otm.registry.MDeferredRegister import java.util.EnumMap import java.util.function.Supplier @@ -21,8 +22,8 @@ class StripedColoredDecorativeBlock( BlockItem(block, Item.Properties().stacksTo(64)) } ) : IBlockItemRegistryAcceptor { - private val mapBlocks = EnumMap>>(DyeColor::class.java) - private val mapItems = EnumMap>>(DyeColor::class.java) + private val mapBlocks = EnumMap>>(DyeColor::class.java) + private val mapItems = EnumMap>>(DyeColor::class.java) fun getBlockNullable(base: DyeColor, stripe: DyeColor): Block? { check(registeredBlocks) { "Didn't register items yet" } @@ -82,7 +83,7 @@ class StripedColoredDecorativeBlock( SupplierList(mapBlocks.flatMap { it.value.values }) } - override fun registerItems(registry: DeferredRegister) { + override fun registerItems(registry: MDeferredRegister) { for (base in DyeColor.values()) { for (stripe in DyeColor.values()) { if (base == stripe) { @@ -97,7 +98,7 @@ class StripedColoredDecorativeBlock( registeredItems = true } - override fun registerBlocks(registry: DeferredRegister) { + override fun registerBlocks(registry: MDeferredRegister) { for (base in DyeColor.values()) { for (stripe in DyeColor.values()) { if (base == stripe) { diff --git a/src/main/resources/assets/overdrive_that_matters/blockstates/matter_panel.json b/src/main/resources/assets/overdrive_that_matters/blockstates/matter_panel.json deleted file mode 100644 index 781d76141..000000000 --- a/src/main/resources/assets/overdrive_that_matters/blockstates/matter_panel.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "variants": { - "facing=south": { - "model": "overdrive_that_matters:block/matter_panel" - }, - "facing=up": { - "model": "overdrive_that_matters:block/matter_panel", - "x": 90 - }, - "facing=down": { - "model": "overdrive_that_matters:block/matter_panel", - "x": 270 - }, - "facing=west": { - "model": "overdrive_that_matters:block/matter_panel", - "y": 90 - }, - "facing=north": { - "model": "overdrive_that_matters:block/matter_panel", - "y": 180 - }, - "facing=east": { - "model": "overdrive_that_matters:block/matter_panel", - "y": 270 - } - } -} diff --git a/src/main/resources/assets/overdrive_that_matters/models/block/holo_sign.json b/src/main/resources/assets/overdrive_that_matters/models/block/holo_sign.json index fb314ebd6..70537dc8e 100644 --- a/src/main/resources/assets/overdrive_that_matters/models/block/holo_sign.json +++ b/src/main/resources/assets/overdrive_that_matters/models/block/holo_sign.json @@ -1,7 +1,7 @@ { "credit": "Made with Blockbench", "parent": "block/cube_all", - "render_type": "translucent", + "render_type": "cutout", "textures": { "0": "overdrive_that_matters:block/holo_sign", "particle": "overdrive_that_matters:block/holo_sign" diff --git a/src/main/resources/assets/overdrive_that_matters/models/block/matter_panel.json b/src/main/resources/assets/overdrive_that_matters/models/block/matter_panel.json index 1cb704ba5..37a1363fb 100644 --- a/src/main/resources/assets/overdrive_that_matters/models/block/matter_panel.json +++ b/src/main/resources/assets/overdrive_that_matters/models/block/matter_panel.json @@ -1,22 +1,23 @@ { + "credit": "Made with Blockbench", "parent": "block/block", "texture_size": [32, 32], "textures": { - "texture": "overdrive_that_matters:block/matter_panel", - "particle": "overdrive_that_matters:block/matter_panel" + "particle": "overdrive_that_matters:block/matter_panel", + "texture": "overdrive_that_matters:block/matter_panel" }, -"elements": [ + "elements": [ { - "from": [ 0, 0, 0 ], - "to": [ 16, 16, 6 ], + "from": [0, 0, 10], + "to": [16, 16, 16], "faces": { - "down": {"uv": [ 8, 0, 16, 3 ], "texture": "#texture" }, - "up": {"uv": [ 8, 0, 16, 3 ], "rotation": 180, "texture": "#texture" }, - "north": {"uv": [ 0, 8, 8, 16 ], "texture": "#texture" }, - "south": {"uv": [ 0, 0, 8, 8 ], "texture": "#texture" }, - "west": {"uv": [ 8, 0, 16, 3 ], "rotation": 90, "texture": "#texture" }, - "east": {"uv": [ 8, 0, 16, 3 ], "rotation": 270, "texture": "#texture" } + "north": {"uv": [0, 0, 8, 8], "texture": "#texture"}, + "east": {"uv": [8, 0, 16, 3], "rotation": 90, "texture": "#texture"}, + "south": {"uv": [0, 8, 8, 16], "texture": "#texture"}, + "west": {"uv": [8, 0, 16, 3], "rotation": 270, "texture": "#texture"}, + "up": {"uv": [8, 0, 16, 3], "texture": "#texture"}, + "down": {"uv": [8, 0, 16, 3], "rotation": 180, "texture": "#texture"} } } ] -} +} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/models/block/matter_replicator.json b/src/main/resources/assets/overdrive_that_matters/models/block/matter_replicator.json index db7a07bee..c0608c9c9 100644 --- a/src/main/resources/assets/overdrive_that_matters/models/block/matter_replicator.json +++ b/src/main/resources/assets/overdrive_that_matters/models/block/matter_replicator.json @@ -1,7 +1,7 @@ { "credit": "Made with Blockbench", "parent": "block/block", - "render_type": "translucent", + "render_type": "cutout", "texture_size": [32, 32], "textures": { "1": "overdrive_that_matters:block/matter_replicator_base", diff --git a/src/main/resources/assets/overdrive_that_matters/models/item/drive_viewer.json b/src/main/resources/assets/overdrive_that_matters/models/item/drive_viewer.json deleted file mode 100644 index 94fab8fd3..000000000 --- a/src/main/resources/assets/overdrive_that_matters/models/item/drive_viewer.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "parent": "overdrive_that_matters:block/drive_viewer_idle" -} \ No newline at end of file diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/black.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/black.png new file mode 100644 index 000000000..ad3614c24 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/black.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/blue.png new file mode 100644 index 000000000..efcd42bf7 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/brown.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/brown.png new file mode 100644 index 000000000..c068ece71 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/brown.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/cyan.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/cyan.png new file mode 100644 index 000000000..266c7332e Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/cyan.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/gray.png new file mode 100644 index 000000000..673860086 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/green.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/green.png new file mode 100644 index 000000000..0a6710ef2 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/green.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/light_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/light_blue.png new file mode 100644 index 000000000..452a44a35 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/light_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/light_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/light_gray.png new file mode 100644 index 000000000..28fc028fc Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/light_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/lime.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/lime.png new file mode 100644 index 000000000..5e7e01e8a Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/lime.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/magenta.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/magenta.png new file mode 100644 index 000000000..de244e9a8 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/magenta.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/orange.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/orange.png new file mode 100644 index 000000000..87155d47e Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/orange.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/pink.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/pink.png new file mode 100644 index 000000000..39fbde8d3 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/pink.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/purple.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/purple.png new file mode 100644 index 000000000..ada4c8ef6 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/purple.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/red.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/red.png new file mode 100644 index 000000000..ae7103072 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/red.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/white.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/white.png new file mode 100644 index 000000000..2d787766f Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/white.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/yellow.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/yellow.png new file mode 100644 index 000000000..8ef177804 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger/yellow.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger_mask.png b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger_mask.png new file mode 100644 index 000000000..de67ffc42 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/android_charger_mask.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/black.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/black.png new file mode 100644 index 000000000..4809d12d9 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/black.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/blue.png new file mode 100644 index 000000000..9f37ea37c Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/brown.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/brown.png new file mode 100644 index 000000000..8c2e5bd76 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/brown.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/cyan.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/cyan.png new file mode 100644 index 000000000..b427647f0 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/cyan.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/gray.png new file mode 100644 index 000000000..e400ab1ed Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/green.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/green.png new file mode 100644 index 000000000..5fae921aa Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/green.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/light_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/light_blue.png new file mode 100644 index 000000000..5a00915f1 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/light_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/light_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/light_gray.png new file mode 100644 index 000000000..39b2653da Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/light_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/lime.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/lime.png new file mode 100644 index 000000000..521fbba8a Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/lime.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/magenta.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/magenta.png new file mode 100644 index 000000000..8cdbb6e79 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/magenta.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/orange.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/orange.png new file mode 100644 index 000000000..019b10c93 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/orange.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/pink.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/pink.png new file mode 100644 index 000000000..4b21f662c Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/pink.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/purple.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/purple.png new file mode 100644 index 000000000..d46ac1bb4 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/purple.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/red.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/red.png new file mode 100644 index 000000000..df58e67b0 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/red.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/white.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/white.png new file mode 100644 index 000000000..55e0f3c58 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/white.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/yellow.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/yellow.png new file mode 100644 index 000000000..15fe6c0bb Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer/yellow.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer_mask.png b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer_mask.png new file mode 100644 index 000000000..306715ad1 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/drive_viewer_mask.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/black.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/black.png index a43dd7d92..8ed5fa865 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/black.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/black.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/blue.png index c0046cb50..edddb6a75 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/blue.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/brown.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/brown.png index a88e41fa3..b6ff96d34 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/brown.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/brown.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/cyan.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/cyan.png index fe247efcc..5fdcc4afc 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/cyan.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/cyan.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/gray.png index 4c89b2e33..ac62beaea 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/gray.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/green.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/green.png index 9b92965b5..8c9dddc4b 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/green.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/green.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/light_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/light_blue.png index 5d0eddf84..a577ec153 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/light_blue.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/light_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/light_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/light_gray.png index d9f07c0bc..3113ab93e 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/light_gray.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/light_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/lime.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/lime.png index 0ddc8f23b..837d4aa9a 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/lime.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/lime.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/magenta.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/magenta.png index 921bc1938..51e4abe72 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/magenta.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/magenta.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/orange.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/orange.png index 40eb3fd83..59640f7a1 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/orange.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/orange.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/pink.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/pink.png index 23da7f9ff..dab0e2083 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/pink.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/pink.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/purple.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/purple.png index 48b69e966..c2e94fc65 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/purple.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/purple.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/red.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/red.png index 2b2972bd6..e2121aaaf 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/red.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/red.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/white.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/white.png index 5c18d9805..bbed3c6c7 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/white.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/white.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/yellow.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/yellow.png index 4c42c8fee..2f6557adc 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/yellow.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor/yellow.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor_mask.png b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor_mask.png index 0bf1c567f..f599b3a28 100644 Binary files a/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor_mask.png and b/src/main/resources/assets/overdrive_that_matters/textures/block/item_monitor_mask.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/black.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/black.png new file mode 100644 index 000000000..1862c9e8f Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/black.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/blue.png new file mode 100644 index 000000000..71ce394fa Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/brown.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/brown.png new file mode 100644 index 000000000..2ba0602cc Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/brown.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/cyan.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/cyan.png new file mode 100644 index 000000000..8d9460d2b Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/cyan.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/gray.png new file mode 100644 index 000000000..ccae696b7 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/green.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/green.png new file mode 100644 index 000000000..294737609 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/green.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/light_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/light_blue.png new file mode 100644 index 000000000..9d9fd8497 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/light_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/light_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/light_gray.png new file mode 100644 index 000000000..57f69fc22 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/light_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/lime.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/lime.png new file mode 100644 index 000000000..b02024d37 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/lime.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/magenta.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/magenta.png new file mode 100644 index 000000000..db330135c Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/magenta.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/orange.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/orange.png new file mode 100644 index 000000000..a880c1989 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/orange.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/pink.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/pink.png new file mode 100644 index 000000000..876bf206b Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/pink.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/purple.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/purple.png new file mode 100644 index 000000000..f7be420f2 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/purple.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/red.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/red.png new file mode 100644 index 000000000..7cef740f6 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/red.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/white.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/white.png new file mode 100644 index 000000000..d73ecd511 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/white.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/yellow.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/yellow.png new file mode 100644 index 000000000..0d8cabfd5 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel/yellow.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel_mask.png b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel_mask.png new file mode 100644 index 000000000..476fde21a Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/matter_panel_mask.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/black.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/black.png new file mode 100644 index 000000000..535c74237 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/black.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/blue.png new file mode 100644 index 000000000..82a8fd287 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/brown.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/brown.png new file mode 100644 index 000000000..bacf95324 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/brown.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/cyan.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/cyan.png new file mode 100644 index 000000000..1c2078f64 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/cyan.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/gray.png new file mode 100644 index 000000000..d0a0f6b5e Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/green.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/green.png new file mode 100644 index 000000000..5e684acc3 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/green.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/light_blue.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/light_blue.png new file mode 100644 index 000000000..2e65ce25e Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/light_blue.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/light_gray.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/light_gray.png new file mode 100644 index 000000000..f1b3ea6f9 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/light_gray.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/lime.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/lime.png new file mode 100644 index 000000000..20c5281a2 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/lime.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/magenta.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/magenta.png new file mode 100644 index 000000000..893bc4907 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/magenta.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/orange.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/orange.png new file mode 100644 index 000000000..99f66b2b9 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/orange.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/pink.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/pink.png new file mode 100644 index 000000000..69bf27583 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/pink.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/purple.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/purple.png new file mode 100644 index 000000000..db3cbab89 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/purple.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/red.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/red.png new file mode 100644 index 000000000..dfecc550d Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/red.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/white.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/white.png new file mode 100644 index 000000000..bf00c8adc Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/white.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/yellow.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/yellow.png new file mode 100644 index 000000000..1a1588e09 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier/yellow.png differ diff --git a/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier_mask.png b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier_mask.png new file mode 100644 index 000000000..717854576 Binary files /dev/null and b/src/main/resources/assets/overdrive_that_matters/textures/block/storage_power_supplier_mask.png differ