This commit is contained in:
DBotThePony 2024-01-05 21:47:04 +07:00
commit 74183f0982
Signed by: DBot
GPG Key ID: DCC23B5715498507
129 changed files with 577 additions and 317 deletions

View File

@ -108,7 +108,7 @@ fun addMachineAdvancements(serializer: Consumer<AdvancementHolder>, lang: Matter
russianName = "Сканируем вещи которые материальны") russianName = "Сканируем вещи которые материальны")
val decomposer = CraftEntry(MItems.MATTER_DECOMPOSER.values, "Decaying the Atoms", "Keep your limbs outside of the working chamber at all times", val decomposer = CraftEntry(MItems.MATTER_DECOMPOSER.values, "Decaying the Atoms", "Keep your limbs outside of the working chamber at all times",
russianName = "Разлагаем атомы", russianSuffix = "Во всех ситуациях держите свои конечности вне рабочей камеры") russianName = "Разлагаем атомы", russianSuffix = "Во всех ситуациях держите свои конечности вне рабочей камеры")
val panel = CraftEntry(MItems.MATTER_PANEL, "Indexing the Library", val panel = CraftEntry(MItems.MATTER_PANEL.values, "Indexing the Library",
russianName = "Индексируем библиотеку") russianName = "Индексируем библиотеку")
val replicator = CraftEntry(MItems.MATTER_REPLICATOR.values, "Cook with (Im)Perfection", "Now let's bake some perfect bread", val replicator = CraftEntry(MItems.MATTER_REPLICATOR.values, "Cook with (Im)Perfection", "Now let's bake some perfect bread",
russianName = "Повар с (не) идеальностями", russianSuffix = "А теперь давайте выпечем немного идеального хлеба") russianName = "Повар с (не) идеальностями", russianSuffix = "А теперь давайте выпечем немного идеального хлеба")
@ -184,7 +184,7 @@ fun addMachineAdvancements(serializer: Consumer<AdvancementHolder>, lang: Matter
russianSuffix = "Только пользоваться этим устройством могут вёдра с болтами", russianSuffix = "Только пользоваться этим устройством могут вёдра с болтами",
englishSuffix = "Except only buckets of bolts can use this thing") 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 = "Домашняя страница андроидов") russianName = "Домашняя страница андроидов")
station.make(serializer, press, translation).also { station.make(serializer, press, translation).also {

View File

@ -16,7 +16,16 @@ fun addBlockModels(provider: MatteryBlockModelProvider) {
colored(MBlocks.MATTER_RECONSTRUCTOR, listOf("0", "particle")) colored(MBlocks.MATTER_RECONSTRUCTOR, listOf("0", "particle"))
colored("matter_capacitor_bank", listOf("1", "particle"), "mattercapacitorbank_frame") 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("plate_press", "plate_press2", listOf("0", "particle"))
coloredMachineCombined("twin_plate_press", "plate_press2", listOf("0", "particle")) coloredMachineCombined("twin_plate_press", "plate_press2", listOf("0", "particle"))

View File

@ -46,15 +46,17 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
} }
} }
with(provider.getMultipartBuilder(MBlocks.ANDROID_CHARGER)) { for (block in MBlocks.ANDROID_CHARGER.values) {
for (dir in BlockRotationFreedom.HORIZONTAL.possibleValues) { with(provider.getMultipartBuilder(block)) {
for (part in AndroidChargerBlock.PART.possibleValues) { for (dir in BlockRotationFreedom.HORIZONTAL.possibleValues) {
part().modelFile(provider.models().getExistingFile(modLocation("block/${MNames.ANDROID_CHARGER}_${part.serializedName}"))) for (part in AndroidChargerBlock.PART.possibleValues) {
.rotationY(dir.front.yRotationBlockstateNorth()) part().modelFile(provider.models().getExistingFile(modLocation("block/${block.registryName!!.path}_${part.serializedName}")))
.addModel() .rotationY(dir.front.yRotationBlockstateNorth())
.condition(AndroidChargerBlock.PART, part) .addModel()
.condition(BlockRotationFreedom.HORIZONTAL.property, dir) .condition(AndroidChargerBlock.PART, part)
.end() .condition(BlockRotationFreedom.HORIZONTAL.property, dir)
.end()
}
} }
} }
} }
@ -104,7 +106,8 @@ fun addBlockStates(provider: MatteryBlockStateProvider) {
provider.block(MBlocks.POWERED_FURNACE.values) provider.block(MBlocks.POWERED_FURNACE.values)
provider.block(MBlocks.POWERED_SMOKER.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_RECYCLER.values)
provider.block(MBlocks.MATTER_RECONSTRUCTOR.values) provider.block(MBlocks.MATTER_RECONSTRUCTOR.values)
provider.block(MBlocks.ENERGY_SERVO) provider.block(MBlocks.ENERGY_SERVO)

View File

@ -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.block.storage.DriveViewerBlock
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.math.yRotationBlockstateNorth 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.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MBlocks import ru.dbotthepony.mc.otm.registry.MBlocks
fun addComplexBlockStates(provider: MatteryBlockStateProvider) { fun addComplexBlockStates(provider: MatteryBlockStateProvider) {
with(provider.getMultipartBuilder(MBlocks.DRIVE_VIEWER)) { for (block in MBlocks.DRIVE_VIEWER.values) {
for (facing in BlockRotationFreedom.HORIZONTAL.possibleValues) { with(provider.getMultipartBuilder(block)) {
part() for (facing in BlockRotationFreedom.HORIZONTAL.possibleValues) {
.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) {
part() 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()) .rotationY(facing.front.yRotationBlockstateNorth())
.addModel() .addModel()
.condition(WorkerState.SEMI_WORKER_STATE, workState)
.condition(BlockRotationFreedom.HORIZONTAL.property, facing) .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)
}
} }
} }
} }

View File

@ -171,6 +171,7 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.coloredWithBaseBlock(MItems.MATTER_BOTTLER, "matter_bottler", "_idle") provider.coloredWithBaseBlock(MItems.MATTER_BOTTLER, "matter_bottler", "_idle")
provider.coloredWithBaseBlock(MItems.MATTER_SCANNER, "matter_scanner", "_idle") provider.coloredWithBaseBlock(MItems.MATTER_SCANNER, "matter_scanner", "_idle")
provider.coloredWithBaseBlock(MItems.MATTER_REPLICATOR, "matter_replicator", "_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.block(MItems.MATTER_CABLE, "matter_cable_core")
provider.coloredWithBaseBlock(MItems.MATTER_DECOMPOSER, "matter_decomposer", "_idle") provider.coloredWithBaseBlock(MItems.MATTER_DECOMPOSER, "matter_decomposer", "_idle")
provider.block(MItems.ENERGY_SERVO, "energy_servo") 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.PLATE_PRESS, "plate_press", "_idle")
provider.coloredWithBaseBlock(MItems.TWIN_PLATE_PRESS, "twin_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.MATTER_RECYCLER, "matter_recycler", "_idle")
provider.coloredWithBaseBlock(MItems.COBBLESTONE_GENERATOR, "cobblestone_generator") 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_BUS)
provider.block(MItems.STORAGE_IMPORTER) provider.block(MItems.STORAGE_IMPORTER)
provider.block(MItems.STORAGE_EXPORTER) provider.block(MItems.STORAGE_EXPORTER)

View File

@ -417,18 +417,18 @@ private fun death(provider: MatteryLanguageProvider) {
private fun blocks(provider: MatteryLanguageProvider) { private fun blocks(provider: MatteryLanguageProvider) {
with(provider.english) { with(provider.english) {
addBlock(MBlocks.ANDROID_STATION.values, "Android Station") addBlock(MBlocks.ANDROID_STATION.values, "Android Station")
add(MBlocks.ANDROID_CHARGER, "Wireless Charger") addBlock(MBlocks.ANDROID_CHARGER.values, "Wireless Charger")
add(MBlocks.ANDROID_CHARGER, "desc", "Charges nearby androids and exopacks") addBlock(MBlocks.ANDROID_CHARGER.values, "desc", "Charges nearby androids and exopacks")
addBlock(MBlocks.BATTERY_BANK.values, "Battery Bank") addBlock(MBlocks.BATTERY_BANK.values, "Battery Bank")
addBlock(MBlocks.MATTER_DECOMPOSER.values, "Matter Decomposer") addBlock(MBlocks.MATTER_DECOMPOSER.values, "Matter Decomposer")
addBlock(MBlocks.MATTER_CAPACITOR_BANK.values, "Matter Capacitor Bank") addBlock(MBlocks.MATTER_CAPACITOR_BANK.values, "Matter Capacitor Bank")
add(MBlocks.MATTER_CABLE, "Matter Network Cable") add(MBlocks.MATTER_CABLE, "Matter Network Cable")
add(MBlocks.PATTERN_STORAGE, "Pattern Storage") add(MBlocks.PATTERN_STORAGE, "Pattern Storage")
addBlock(MBlocks.MATTER_SCANNER.values, "Matter Scanner") 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_REPLICATOR.values, "Matter Replicator")
addBlock(MBlocks.MATTER_BOTTLER.values, "Matter Bottler") 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") add(MBlocks.BLACK_HOLE, "Local Anomalous Spacetime Dilation Singular Point")
addBlock(MBlocks.COBBLESTONE_GENERATOR.values, "Cobblestone Generator") addBlock(MBlocks.COBBLESTONE_GENERATOR.values, "Cobblestone Generator")
add(MBlocks.INFINITE_WATER_SOURCE, "Infinite Water Source") 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.TRITANIUM_RAW_BLOCK, "Raw Tritanium Block")
add(MBlocks.STORAGE_CABLE, "Storage Cable") 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_BUS, "Storage Bus")
add(MBlocks.STORAGE_IMPORTER, "Storage Importer") add(MBlocks.STORAGE_IMPORTER, "Storage Importer")
add(MBlocks.STORAGE_EXPORTER, "Storage Exporter") add(MBlocks.STORAGE_EXPORTER, "Storage Exporter")

View File

@ -419,18 +419,18 @@ private fun death(provider: MatteryLanguageProvider) {
private fun blocks(provider: MatteryLanguageProvider) { private fun blocks(provider: MatteryLanguageProvider) {
with(provider.russian) { with(provider.russian) {
addBlock(MBlocks.ANDROID_STATION.values, "Станция андроидов") addBlock(MBlocks.ANDROID_STATION.values, "Станция андроидов")
add(MBlocks.ANDROID_CHARGER, "Беспроводной зарядник") addBlock(MBlocks.ANDROID_CHARGER.values, "Беспроводной зарядник")
add(MBlocks.ANDROID_CHARGER, "desc", "Заряжает ближайших андроидов и экзопаки") addBlock(MBlocks.ANDROID_CHARGER.values, "desc", "Заряжает ближайших андроидов и экзопаки")
addBlock(MBlocks.BATTERY_BANK.values, "Банк аккумуляторов") addBlock(MBlocks.BATTERY_BANK.values, "Банк аккумуляторов")
addBlock(MBlocks.MATTER_DECOMPOSER.values, "Декомпозитор материи") addBlock(MBlocks.MATTER_DECOMPOSER.values, "Декомпозитор материи")
addBlock(MBlocks.MATTER_CAPACITOR_BANK.values, "Банк накопителей материи") addBlock(MBlocks.MATTER_CAPACITOR_BANK.values, "Банк накопителей материи")
add(MBlocks.MATTER_CABLE, "Кабель сети материи") add(MBlocks.MATTER_CABLE, "Кабель сети материи")
add(MBlocks.PATTERN_STORAGE, "Хранилище шаблонов") add(MBlocks.PATTERN_STORAGE, "Хранилище шаблонов")
addBlock(MBlocks.MATTER_SCANNER.values, "Сканер материи") addBlock(MBlocks.MATTER_SCANNER.values, "Сканер материи")
add(MBlocks.MATTER_PANEL, "Монитор шаблонов") addBlock(MBlocks.MATTER_PANEL.values, "Монитор шаблонов")
addBlock(MBlocks.MATTER_REPLICATOR.values, "Репликатор материи") addBlock(MBlocks.MATTER_REPLICATOR.values, "Репликатор материи")
addBlock(MBlocks.MATTER_BOTTLER.values, "Бутилировщик материи") addBlock(MBlocks.MATTER_BOTTLER.values, "Бутилировщик материи")
add(MBlocks.DRIVE_VIEWER, "Просмотрщик дисков конденсации") addBlock(MBlocks.DRIVE_VIEWER.values, "Просмотрщик дисков конденсации")
add(MBlocks.BLACK_HOLE, "Локализированная сингулярная точка аномального искажения пространства-времени") add(MBlocks.BLACK_HOLE, "Локализированная сингулярная точка аномального искажения пространства-времени")
addBlock(MBlocks.COBBLESTONE_GENERATOR.values, "Генератор булыжника") addBlock(MBlocks.COBBLESTONE_GENERATOR.values, "Генератор булыжника")
add(MBlocks.INFINITE_WATER_SOURCE, "Неиссякаемый источник воды") add(MBlocks.INFINITE_WATER_SOURCE, "Неиссякаемый источник воды")
@ -488,7 +488,7 @@ private fun blocks(provider: MatteryLanguageProvider) {
add(MBlocks.TRITANIUM_RAW_BLOCK, "Блок рудного тритана") add(MBlocks.TRITANIUM_RAW_BLOCK, "Блок рудного тритана")
add(MBlocks.STORAGE_CABLE, "Кабель хранилища") add(MBlocks.STORAGE_CABLE, "Кабель хранилища")
add(MBlocks.STORAGE_POWER_SUPPLIER, "Подстанция сети хранилища") addBlock(MBlocks.STORAGE_POWER_SUPPLIER.values, "Подстанция сети хранилища")
add(MBlocks.STORAGE_BUS, "Шина хранилища") add(MBlocks.STORAGE_BUS, "Шина хранилища")
add(MBlocks.STORAGE_IMPORTER, "Импортер хранилища") add(MBlocks.STORAGE_IMPORTER, "Импортер хранилища")
add(MBlocks.STORAGE_EXPORTER, "Экспортер хранилища") add(MBlocks.STORAGE_EXPORTER, "Экспортер хранилища")

View File

@ -144,14 +144,14 @@ fun addLootTables(lootTables: LootTables) {
lootTables.tile(MBlocks.HOLO_SIGN, "isLocked") lootTables.tile(MBlocks.HOLO_SIGN, "isLocked")
lootTables.tile(MBlocks.STORAGE_CABLE) lootTables.tile(MBlocks.STORAGE_CABLE)
lootTables.tile(MBlocks.ANDROID_STATION.values) 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.BATTERY_BANK.values)
lootTables.tile(MBlocks.DRIVE_VIEWER) lootTables.tile(MBlocks.DRIVE_VIEWER.values)
lootTables.tile(MBlocks.STORAGE_BUS) lootTables.tile(MBlocks.STORAGE_BUS)
lootTables.tile(MBlocks.STORAGE_IMPORTER) lootTables.tile(MBlocks.STORAGE_IMPORTER)
lootTables.tile(MBlocks.STORAGE_EXPORTER) 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.DRIVE_RACK)
lootTables.tile(MBlocks.MATTER_DECOMPOSER.values) lootTables.tile(MBlocks.MATTER_DECOMPOSER.values)
@ -165,7 +165,7 @@ fun addLootTables(lootTables: LootTables) {
lootTables.tile(MBlocks.POWERED_SMOKER.values) lootTables.tile(MBlocks.POWERED_SMOKER.values)
lootTables.tile(MBlocks.POWERED_BLAST_FURNACE.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.PATTERN_STORAGE)
lootTables.tile(MBlocks.MATTER_CAPACITOR_BANK.values) lootTables.tile(MBlocks.MATTER_CAPACITOR_BANK.values)
lootTables.tile(MBlocks.MATTER_BOTTLER.values) lootTables.tile(MBlocks.MATTER_BOTTLER.values)

View File

@ -127,6 +127,10 @@ class MatteryBlockModelProvider(event: GatherDataEvent) : BlockModelProvider(eve
return colored(modelName, "", textureKeys.associateWith { modelName }) return colored(modelName, "", textureKeys.associateWith { modelName })
} }
fun colored(modelName: String, suffix: String, textureKeys: Collection<String>) {
return colored(modelName, suffix, textureKeys.associateWith { modelName })
}
fun coloredMachineCombined(modelName: String, textureName: String, textureKeys: Collection<String>) { fun coloredMachineCombined(modelName: String, textureName: String, textureKeys: Collection<String>) {
for (state in listOf("_idle", "_error", "_working")) { for (state in listOf("_idle", "_error", "_working")) {
colored(modelName, state, textureKeys.associateWith { textureName }) colored(modelName, state, textureKeys.associateWith { textureName })

View File

@ -325,7 +325,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.build(consumer) .build(consumer)
// беспроводной зарядник андроидов // беспроводной зарядник андроидов
MatteryRecipe(MItems.ANDROID_CHARGER, category = machinesCategory) MatteryRecipe(MItems.ANDROID_CHARGER[null]!!, category = machinesCategory)
.row(MItems.ELECTRIC_PARTS, MItems.QUANTUM_TRANSCEIVER, MItems.ELECTRIC_PARTS) .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)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES) .row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)

View File

@ -289,6 +289,10 @@ fun addPainterRecipes(consumer: RecipeOutput) {
MItems.POWERED_BLAST_FURNACE, MItems.POWERED_BLAST_FURNACE,
MItems.MATTER_RECYCLER, MItems.MATTER_RECYCLER,
MItems.ANDROID_STATION, MItems.ANDROID_STATION,
MItems.STORAGE_POWER_SUPPLIER,
MItems.DRIVE_VIEWER,
MItems.ANDROID_CHARGER,
MItems.MATTER_PANEL,
) )
for (list in blocks) { for (list in blocks) {

View File

@ -186,7 +186,7 @@ fun addTags(tagsProvider: TagsProvider) {
*MBlocks.MATTER_CAPACITOR_BANK.values.toTypedArray(), *MBlocks.MATTER_CAPACITOR_BANK.values.toTypedArray(),
MBlocks.PATTERN_STORAGE, MBlocks.PATTERN_STORAGE,
*MBlocks.MATTER_SCANNER.values.toTypedArray(), *MBlocks.MATTER_SCANNER.values.toTypedArray(),
MBlocks.MATTER_PANEL, *MBlocks.MATTER_PANEL.values.toTypedArray(),
*MBlocks.MATTER_REPLICATOR.values.toTypedArray(), *MBlocks.MATTER_REPLICATOR.values.toTypedArray(),
*MBlocks.MATTER_BOTTLER.values.toTypedArray(), *MBlocks.MATTER_BOTTLER.values.toTypedArray(),
MBlocks.ENERGY_COUNTER, MBlocks.ENERGY_COUNTER,
@ -204,10 +204,10 @@ fun addTags(tagsProvider: TagsProvider) {
MBlocks.STORAGE_IMPORTER, MBlocks.STORAGE_IMPORTER,
MBlocks.STORAGE_EXPORTER, MBlocks.STORAGE_EXPORTER,
MBlocks.DRIVE_VIEWER, *MBlocks.DRIVE_VIEWER.values.toTypedArray(),
MBlocks.DRIVE_RACK, MBlocks.DRIVE_RACK,
*MBlocks.ITEM_MONITOR.values.toTypedArray(), *MBlocks.ITEM_MONITOR.values.toTypedArray(),
MBlocks.STORAGE_POWER_SUPPLIER, *MBlocks.STORAGE_POWER_SUPPLIER.values.toTypedArray(),
MBlocks.PHANTOM_ATTRACTOR, MBlocks.PHANTOM_ATTRACTOR,
MBlocks.ENERGY_SERVO, MBlocks.ENERGY_SERVO,
@ -223,7 +223,7 @@ fun addTags(tagsProvider: TagsProvider) {
*MBlocks.ESSENCE_STORAGE.values.toTypedArray(), *MBlocks.ESSENCE_STORAGE.values.toTypedArray(),
*MBlocks.MATTER_RECONSTRUCTOR.values.toTypedArray(), *MBlocks.MATTER_RECONSTRUCTOR.values.toTypedArray(),
MBlocks.FLUID_TANK, MBlocks.FLUID_TANK,
MBlocks.ANDROID_CHARGER, *MBlocks.ANDROID_CHARGER.values.toTypedArray(),
), Tiers.IRON) ), Tiers.IRON)
tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ANVIL, Tiers.IRON) tagsProvider.requiresPickaxe(MBlocks.TRITANIUM_ANVIL, Tiers.IRON)

View File

@ -5,6 +5,7 @@ import net.minecraft.server.level.ServerLevel
import net.minecraft.world.entity.player.Inventory import net.minecraft.world.entity.player.Inventory
import net.minecraft.world.entity.player.Player import net.minecraft.world.entity.player.Player
import net.minecraft.world.inventory.AbstractContainerMenu 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.AbstractCookingRecipe
import net.minecraft.world.item.crafting.BlastingRecipe import net.minecraft.world.item.crafting.BlastingRecipe
import net.minecraft.world.item.crafting.RecipeType import net.minecraft.world.item.crafting.RecipeType
@ -45,19 +46,31 @@ sealed class AbstractPoweredFurnaceBlockEntity<P : AbstractCookingRecipe, S : Ma
blockState: BlockState, blockState: BlockState,
val recipeType: RecipeType<P>, val recipeType: RecipeType<P>,
val secondaryRecipeType: RecipeType<S>?, val secondaryRecipeType: RecipeType<S>?,
val config: WorkerBalanceValues val config: WorkerBalanceValues,
) : MatteryWorkerBlockEntity<ItemJob>(type, blockPos, blockState, ItemJob.CODEC, 2) { maxJobs: Int = 2
) : MatteryWorkerBlockEntity<ItemJob>(type, blockPos, blockState, ItemJob.CODEC, maxJobs) {
final override val upgrades = UpgradeContainer(this::markDirtyFast, 2, UpgradeType.BASIC_PROCESSING) final override val upgrades = UpgradeContainer(this::markDirtyFast, 2, UpgradeType.BASIC_PROCESSING)
final override val energy = ProfiledEnergyStorage(WorkerEnergyStorage(this::energyLevelUpdated, upgrades.transform(config))) final override val energy = ProfiledEnergyStorage(WorkerEnergyStorage(this::energyLevelUpdated, upgrades.transform(config)))
val inputs = immutableList(2) { MatteryContainer(this::itemContainerUpdated, 1) } val inputs = immutableList(maxJobs) { MatteryContainer(this::itemContainerUpdated, 1) }
val outputs = immutableList(2) { MatteryContainer(this::itemContainerUpdated, 1) } val outputs = immutableList(maxJobs) { MatteryContainer(this::itemContainerUpdated, 1) }
init { init {
inputs.forEach { addDroppableContainer(it) } inputs.forEach { addDroppableContainer(it) }
outputs.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 experience = ExperienceStorage(config::maxExperienceStored).also(::addNeighbourListener)
val energyConfig = ConfigurableEnergy(energy) val energyConfig = ConfigurableEnergy(energy)
val itemConfig = ConfigurableItemHandler( val itemConfig = ConfigurableItemHandler(
@ -91,11 +104,19 @@ sealed class AbstractPoweredFurnaceBlockEntity<P : AbstractCookingRecipe, S : Ma
override fun onJobFinish(status: JobStatus<ItemJob>, id: Int) { override fun onJobFinish(status: JobStatus<ItemJob>, id: Int) {
if (outputs[id].fullyAddItem(status.job.itemStack)) { if (outputs[id].fullyAddItem(status.job.itemStack)) {
experience.storeExperience(status.experience, this) experience.storeExperience(status.experience, this)
syncSlots[id].inputItem = ItemStack.EMPTY
syncSlots[id].outputItem = ItemStack.EMPTY
syncSlots[id].progress = 0f
} else { } else {
status.noItem() status.noItem()
} }
} }
override fun onJobTick(status: JobStatus<ItemJob>, id: Int) {
super.onJobTick(status, id)
syncSlots[id].progress = status.workProgress
}
override fun computeNextJob(id: Int): JobContainer<ItemJob> { override fun computeNextJob(id: Int): JobContainer<ItemJob> {
if (!energy.batteryLevel.isPositive) if (!energy.batteryLevel.isPositive)
return JobContainer.noEnergy() return JobContainer.noEnergy()
@ -130,9 +151,14 @@ sealed class AbstractPoweredFurnaceBlockEntity<P : AbstractCookingRecipe, S : Ma
return level.recipeManager.getRecipeFor(recipeType, inputs[id], level).map { return level.recipeManager.getRecipeFor(recipeType, inputs[id], level).map {
val output = it.value.assemble(inputs[id], level.registryAccess()) val output = it.value.assemble(inputs[id], level.registryAccess())
val inputItem = inputs[id][0].copyWithCount(1)
val toProcess = inputs[id][0].count.coerceAtMost(upgrades.processingItems + 1) val toProcess = inputs[id][0].count.coerceAtMost(upgrades.processingItems + 1)
inputs[id][0].shrink(toProcess) inputs[id][0].shrink(toProcess)
syncSlots[id].inputItem = inputItem
syncSlots[id].outputItem = output.copy()
syncSlots[id].progress = 0f
JobContainer.success(ItemJob( JobContainer.success(ItemJob(
output.copyWithCount(toProcess), it.value.cookingTime * config.workTimeMultiplier, config.energyConsumption * toProcess, it.value.experience * toProcess output.copyWithCount(toProcess), it.value.cookingTime * config.workTimeMultiplier, config.energyConsumption * toProcess, it.value.experience * toProcess
)) ))

View File

@ -4,6 +4,7 @@ import com.google.common.collect.ImmutableMap
import net.minecraft.world.level.block.EntityBlock import net.minecraft.world.level.block.EntityBlock
import net.minecraft.core.BlockPos import net.minecraft.core.BlockPos
import net.minecraft.core.Direction import net.minecraft.core.Direction
import net.minecraft.world.item.DyeColor
import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.level.block.entity.BlockEntity import net.minecraft.world.level.block.entity.BlockEntity
import ru.dbotthepony.mc.otm.block.entity.matter.MatterPanelBlockEntity import ru.dbotthepony.mc.otm.block.entity.matter.MatterPanelBlockEntity
@ -17,7 +18,7 @@ import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotation import ru.dbotthepony.mc.otm.core.math.BlockRotation
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
class MatterPanelBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { class MatterPanelBlock(val color: DyeColor?) : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock {
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
return MatterPanelBlockEntity(blockPos, blockState) return MatterPanelBlockEntity(blockPos, blockState)
} }

View File

@ -2,6 +2,7 @@ package ru.dbotthepony.mc.otm.block.storage
import net.minecraft.core.BlockPos import net.minecraft.core.BlockPos
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.TooltipFlag import net.minecraft.world.item.TooltipFlag
import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.item.context.BlockPlaceContext
@ -27,7 +28,7 @@ import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.registry.MBlockEntities
import ru.dbotthepony.mc.otm.shapes.BlockShapes import ru.dbotthepony.mc.otm.shapes.BlockShapes
class DriveViewerBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { class DriveViewerBlock(val color: DyeColor?) : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock {
override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity { override fun newBlockEntity(blockPos: BlockPos, blockState: BlockState): BlockEntity {
return DriveViewerBlockEntity(blockPos, blockState) return DriveViewerBlockEntity(blockPos, blockState)
} }

View File

@ -2,6 +2,7 @@ package ru.dbotthepony.mc.otm.block.storage
import net.minecraft.core.BlockPos import net.minecraft.core.BlockPos
import net.minecraft.network.chat.Component import net.minecraft.network.chat.Component
import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.TooltipFlag import net.minecraft.world.item.TooltipFlag
import net.minecraft.world.level.BlockGetter import net.minecraft.world.level.BlockGetter
@ -22,7 +23,7 @@ import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.registry.MBlockEntities import ru.dbotthepony.mc.otm.registry.MBlockEntities
import ru.dbotthepony.mc.otm.shapes.BlockShapes import ru.dbotthepony.mc.otm.shapes.BlockShapes
class StoragePowerSupplierBlock : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock { class StoragePowerSupplierBlock(val color: DyeColor?) : RotatableMatteryBlock(DEFAULT_MACHINE_PROPERTIES), EntityBlock {
override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity { override fun newBlockEntity(p_153215_: BlockPos, p_153216_: BlockState): BlockEntity {
return StoragePowerSupplierBlockEntity(p_153215_, p_153216_) return StoragePowerSupplierBlockEntity(p_153215_, p_153216_)
} }

View File

@ -6,6 +6,7 @@ import net.minecraft.network.chat.Component
import net.minecraft.util.StringRepresentable import net.minecraft.util.StringRepresentable
import net.minecraft.world.entity.LivingEntity import net.minecraft.world.entity.LivingEntity
import net.minecraft.world.entity.player.Player import net.minecraft.world.entity.player.Player
import net.minecraft.world.item.DyeColor
import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.TooltipFlag import net.minecraft.world.item.TooltipFlag
import net.minecraft.world.item.context.BlockPlaceContext import net.minecraft.world.item.context.BlockPlaceContext
@ -38,7 +39,7 @@ import ru.dbotthepony.mc.otm.core.math.plus
import ru.dbotthepony.mc.otm.oncePre import ru.dbotthepony.mc.otm.oncePre
import ru.dbotthepony.mc.otm.shapes.BlockShapes import ru.dbotthepony.mc.otm.shapes.BlockShapes
class AndroidChargerBlock : RotatableMatteryBlock(Properties.of(Material.METAL).destroyTime(2.5f).explosionResistance(40f).requiresCorrectToolForDrops()), EntityBlock { class AndroidChargerBlock(val color: DyeColor?) : RotatableMatteryBlock(Properties.of(Material.METAL).destroyTime(2.5f).explosionResistance(40f).requiresCorrectToolForDrops()), EntityBlock {
enum class Type : StringRepresentable { enum class Type : StringRepresentable {
BASE, BASE,
MIDDLE, MIDDLE,

View File

@ -58,7 +58,7 @@ class MatterReplicatorRenderer(private val context: BlockEntityRendererProvider.
tile.particleRenderScore += diff tile.particleRenderScore += diff
if (tile.particleRenderScore > 30_000_000L) { if (tile.particleRenderScore > 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) { if (rand.nextDouble() > 0.75 && !isPaused && tile.blockState[WorkerState.WORKER_STATE] == WorkerState.WORKING) {
val (x, y, z) = tile.blockPos val (x, y, z) = tile.blockPos

View File

@ -0,0 +1,69 @@
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.blockentity.BlockEntityRenderer
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider
import net.minecraft.world.item.ItemDisplayContext
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
class PoweredSmokerRenderer(private val context: BlockEntityRendererProvider.Context) : BlockEntityRenderer<AbstractPoweredFurnaceBlockEntity<*, *>> {
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.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,
ItemDisplayContext.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,
ItemDisplayContext.NONE,
false,
pose,
buffers,
packedLight,
packedOverlay,
model
)
}
pose.popPose()
break
}
}
}

View File

@ -52,9 +52,10 @@ class Savetables : INBTSerializable<CompoundTag?> {
return stateful(getter, name, T::class.java) return stateful(getter, name, T::class.java)
} }
inline fun <V : INBTSerializable<T?>, reified T : Tag> stateful(values: List<V>, name: String): ImmutableList<Stateful<V, T>> { inline fun <V : INBTSerializable<T?>, reified T : Tag> stateful(values: Collection<V>, name: String): ImmutableList<Stateful<V, T>> {
val iterator = values.iterator()
return immutableList(values.size) { return immutableList(values.size) {
stateful(values[it], "${name}_$it", T::class.java) stateful(iterator.next(), "${name}_$it", T::class.java)
} }
} }

View File

@ -1611,6 +1611,22 @@ object MatterManager {
val stream2 = stream.map { it to get(it.value) } val stream2 = stream.map { it to get(it.value) }
fun writeValue(a: String, b: String, c: String, commentary: Collection<String>) {
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)) { for ((entry, value) in filter.filter(stream2)) {
val (key, item) = entry val (key, item) = entry
val isBlacklisted: Boolean val isBlacklisted: Boolean
@ -1624,16 +1640,14 @@ object MatterManager {
} }
if (isBlacklisted) { 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 { } else {
if (!value.hasMatterValue) { 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 { } 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() writer.close()

View File

@ -8,22 +8,22 @@ import ru.dbotthepony.mc.otm.android.DummyAndroidFeature
import ru.dbotthepony.mc.otm.android.feature.* import ru.dbotthepony.mc.otm.android.feature.*
object AndroidFeatures { 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<DummyAndroidFeature> by registry.register(MNames.AIR_BAGS) { AndroidFeatureType(::DummyAndroidFeature) } val AIR_BAGS by registry.register(MNames.AIR_BAGS) { AndroidFeatureType(::DummyAndroidFeature) }
val STEP_ASSIST: AndroidFeatureType<StepAssistFeature> by registry.register(MNames.STEP_ASSIST) { AndroidFeatureType(::StepAssistFeature) } val STEP_ASSIST by registry.register(MNames.STEP_ASSIST) { AndroidFeatureType(::StepAssistFeature) }
val SWIM_BOOSTERS: AndroidFeatureType<SwimBoostersFeature> by registry.register(MNames.SWIM_BOOSTERS) { AndroidFeatureType(::SwimBoostersFeature) } val SWIM_BOOSTERS by registry.register(MNames.SWIM_BOOSTERS) { AndroidFeatureType(::SwimBoostersFeature) }
val LIMB_OVERCLOCKING: AndroidFeatureType<LimbOverclockingFeature> by registry.register(MNames.LIMB_OVERCLOCKING) { AndroidFeatureType(::LimbOverclockingFeature) } val LIMB_OVERCLOCKING by registry.register(MNames.LIMB_OVERCLOCKING) { AndroidFeatureType(::LimbOverclockingFeature) }
val ATTACK_BOOST: AndroidFeatureType<AttackBoostFeature> by registry.register(MNames.ATTACK_BOOST) { AndroidFeatureType(::AttackBoostFeature) } val ATTACK_BOOST by registry.register(MNames.ATTACK_BOOST) { AndroidFeatureType(::AttackBoostFeature) }
val NANOBOTS_REGENERATION: AndroidFeatureType<NanobotsRegenerationFeature> by registry.register(MNames.NANOBOTS_REGENERATION) { AndroidFeatureType(::NanobotsRegenerationFeature) } val NANOBOTS_REGENERATION by registry.register(MNames.NANOBOTS_REGENERATION) { AndroidFeatureType(::NanobotsRegenerationFeature) }
val NANOBOTS_ARMOR: AndroidFeatureType<NanobotsArmorFeature> by registry.register(MNames.NANOBOTS_ARMOR) { AndroidFeatureType(::NanobotsArmorFeature) } val NANOBOTS_ARMOR by registry.register(MNames.NANOBOTS_ARMOR) { AndroidFeatureType(::NanobotsArmorFeature) }
val EXTENDED_REACH: AndroidFeatureType<ExtendedReachFeature> by registry.register(MNames.EXTENDED_REACH) { AndroidFeatureType(::ExtendedReachFeature) } val EXTENDED_REACH by registry.register(MNames.EXTENDED_REACH) { AndroidFeatureType(::ExtendedReachFeature) }
val NIGHT_VISION: AndroidFeatureType<NightVisionFeature> by registry.register(MNames.NIGHT_VISION) { AndroidFeatureType(::NightVisionFeature) } val NIGHT_VISION by registry.register(MNames.NIGHT_VISION) { AndroidFeatureType(::NightVisionFeature) }
val SHOCKWAVE: AndroidFeatureType<ShockwaveFeature> by registry.register(MNames.SHOCKWAVE) { AndroidFeatureType(::ShockwaveFeature) } val SHOCKWAVE by registry.register(MNames.SHOCKWAVE) { AndroidFeatureType(::ShockwaveFeature) }
val ITEM_MAGNET: AndroidFeatureType<ItemMagnetFeature> by registry.register(MNames.ITEM_MAGNET) { AndroidFeatureType(::ItemMagnetFeature) } val ITEM_MAGNET by registry.register(MNames.ITEM_MAGNET) { AndroidFeatureType(::ItemMagnetFeature) }
val FALL_DAMPENERS: AndroidFeatureType<FallDampenersFeature> by registry.register(MNames.FALL_DAMPENERS) { AndroidFeatureType(::FallDampenersFeature) } val FALL_DAMPENERS by registry.register(MNames.FALL_DAMPENERS) { AndroidFeatureType(::FallDampenersFeature) }
val JUMP_BOOST: AndroidFeatureType<JumpBoostFeature> by registry.register(MNames.JUMP_BOOST) { AndroidFeatureType(::JumpBoostFeature) } val JUMP_BOOST by registry.register(MNames.JUMP_BOOST) { AndroidFeatureType(::JumpBoostFeature) }
val ENDER_TELEPORTER: AndroidFeatureType<EnderTeleporterFeature> by registry.register(MNames.ENDER_TELEPORTER) { AndroidFeatureType(::EnderTeleporterFeature) } val ENDER_TELEPORTER by registry.register(MNames.ENDER_TELEPORTER) { AndroidFeatureType(::EnderTeleporterFeature) }
internal fun register(bus: IEventBus) { internal fun register(bus: IEventBus) {
registry.register(bus) registry.register(bus)

View File

@ -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 <T : Any> RegistryObject<T>.getValue(thisRef: Any, property: KProperty<*>): T {
return get()
}
internal fun <T, R : T> DeferredRegister<T>.colored(prefix: String, factory: (color: DyeColor, name: String) -> R): Map<DyeColor, R> {
return SupplierMap(MRegistry.DYE_ORDER.map { it to register(prefix + "_" + it.name.lowercase()) { factory.invoke(it, prefix + "_" + it.name.lowercase()) } })
}
internal fun <T, R : T> DeferredRegister<T>.coloredWithBase(prefix: String, factory: (color: DyeColor?, name: String) -> R): Map<DyeColor?, R> {
val values = ArrayList<Pair<DyeColor?, Supplier<R>>>()
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)
}

View File

@ -38,50 +38,54 @@ import java.util.function.Supplier
@Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") // Type<*> is unused in BlockEntityType.Builder @Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") // Type<*> is unused in BlockEntityType.Builder
object MBlockEntities { object MBlockEntities {
private val registry = DeferredRegister.create(ForgeRegistries.BLOCK_ENTITY_TYPES, OverdriveThatMatters.MOD_ID) private val registry = MDeferredRegister(ForgeRegistries.BLOCK_ENTITY_TYPES)
private fun <T : BlockEntity> register(name: String, factory: BlockEntityType.BlockEntitySupplier<T>, vararg blocks: Supplier<Block>): RegistryObject<BlockEntityType<T>> { private fun <T : BlockEntity> register(name: String, factory: BlockEntityType.BlockEntitySupplier<T>, vararg blocks: Supplier<Block>): MDeferredRegister<*>.Entry<BlockEntityType<T>> {
return registry.register(name) { BlockEntityType.Builder.of(factory, *blocks.map { it.get() }.toTypedArray()).build(null) } 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()) private fun <T : BlockEntity> register(name: String, factory: BlockEntityType.BlockEntitySupplier<T>, blocks: Map<*, Block>): MDeferredRegister<*>.Entry<BlockEntityType<T>> {
val BATTERY_BANK by register(MNames.BATTERY_BANK, ::BatteryBankBlockEntity, *MBlocks.BATTERY_BANK.asSupplierArray()) return registry.register(name) { BlockEntityType.Builder.of(factory, *blocks.values.toTypedArray()).build(null) }
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())
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 MATTER_CABLE by register(MNames.MATTER_CABLE, ::MatterCableBlockEntity, MBlocks::MATTER_CABLE)
val STORAGE_CABLE by register(MNames.STORAGE_CABLE, ::StorageCableBlockEntity, MBlocks::STORAGE_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 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_SCANNER by register(MNames.MATTER_SCANNER, ::MatterScannerBlockEntity, MBlocks.MATTER_SCANNER)
val MATTER_PANEL by register(MNames.MATTER_PANEL, ::MatterPanelBlockEntity, MBlocks::MATTER_PANEL) 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_REPLICATOR by register(MNames.MATTER_REPLICATOR, ::MatterReplicatorBlockEntity, MBlocks.MATTER_REPLICATOR)
val MATTER_BOTTLER by register(MNames.MATTER_BOTTLER, ::MatterBottlerBlockEntity, *MBlocks.MATTER_BOTTLER.asSupplierArray()) 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 DRIVE_VIEWER by register(MNames.DRIVE_VIEWER, ::DriveViewerBlockEntity, MBlocks.DRIVE_VIEWER)
val BLACK_HOLE by register(MNames.BLACK_HOLE, ::BlackHoleBlockEntity, MBlocks::BLACK_HOLE) 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 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 ENERGY_COUNTER by register(MNames.ENERGY_COUNTER, ::EnergyCounterBlockEntity, MBlocks::ENERGY_COUNTER)
val CHEMICAL_GENERATOR by register(MNames.CHEMICAL_GENERATOR, ::ChemicalGeneratorBlockEntity, MBlocks::CHEMICAL_GENERATOR) 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 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.asSupplierArray()) 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 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 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 COBBLESTONE_GENERATOR by register(MNames.COBBLESTONE_GENERATOR, ::CobblerBlockEntity, MBlocks.COBBLESTONE_GENERATOR)
val ESSENCE_STORAGE by register(MNames.ESSENCE_STORAGE, ::EssenceStorageBlockEntity, *MBlocks.ESSENCE_STORAGE.asSupplierArray()) val ESSENCE_STORAGE by register(MNames.ESSENCE_STORAGE, ::EssenceStorageBlockEntity, MBlocks.ESSENCE_STORAGE)
val MATTER_RECONSTRUCTOR by register(MNames.MATTER_RECONSTRUCTOR, ::MatterReconstructorBlockEntity, *MBlocks.MATTER_RECONSTRUCTOR.asSupplierArray()) 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 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 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_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_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 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 DEV_CHEST by register(MNames.DEV_CHEST, ::DevChestBlockEntity, MBlocks::DEV_CHEST)
val PAINTER by register(MNames.PAINTER, ::PainterBlockEntity, MBlocks::PAINTER) val PAINTER by register(MNames.PAINTER, ::PainterBlockEntity, MBlocks::PAINTER)
val MATTER_ENTANGLER by register(MNames.MATTER_ENTANGLER, ::MatterEntanglerBlockEntity, MBlocks::MATTER_ENTANGLER) 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_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.asSupplierArray()) 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.asSupplierArray()) val POWERED_SMOKER by register(MNames.POWERED_SMOKER, ::PoweredSmokerBlockEntity, MBlocks.POWERED_SMOKER)
val ENERGY_CABLES: Map<CablesConfig.E, BlockEntityType<*>> = SupplierMap(CablesConfig.E.entries.map { conf -> val ENERGY_CABLES: Map<CablesConfig.E, BlockEntityType<*>> = SupplierMap(CablesConfig.E.entries.map { conf ->
var selfFeed: Supplier<BlockEntityType<*>> = Supplier { TODO() } var selfFeed: Supplier<BlockEntityType<*>> = Supplier { TODO() }
@ -89,10 +93,10 @@ object MBlockEntities {
conf to selfFeed conf to selfFeed
}) })
val STORAGE_BUS: BlockEntityType<StorageBusBlockEntity> by registry.register(MNames.STORAGE_BUS) { BlockEntityType.Builder.of(::StorageBusBlockEntity, MBlocks.STORAGE_BUS).build(null) } val STORAGE_BUS by register(MNames.STORAGE_BUS, ::StorageBusBlockEntity, MBlocks::STORAGE_BUS)
val STORAGE_IMPORTER: BlockEntityType<StorageImporterBlockEntity> by registry.register(MNames.STORAGE_IMPORTER) { BlockEntityType.Builder.of(::StorageImporterBlockEntity, MBlocks.STORAGE_IMPORTER).build(null) } val STORAGE_IMPORTER by register(MNames.STORAGE_IMPORTER, ::StorageImporterBlockEntity, MBlocks::STORAGE_IMPORTER)
val STORAGE_EXPORTER: BlockEntityType<StorageExporterBlockEntity> by registry.register(MNames.STORAGE_EXPORTER) { BlockEntityType.Builder.of(::StorageExporterBlockEntity, MBlocks.STORAGE_EXPORTER).build(null) } val STORAGE_EXPORTER by register(MNames.STORAGE_EXPORTER, ::StorageExporterBlockEntity, MBlocks::STORAGE_EXPORTER)
val STORAGE_POWER_SUPPLIER: BlockEntityType<StoragePowerSupplierBlockEntity> by registry.register(MNames.STORAGE_POWER_SUPPLIER) { BlockEntityType.Builder.of(::StoragePowerSupplierBlockEntity, MBlocks.STORAGE_POWER_SUPPLIER).build(null) } val STORAGE_POWER_SUPPLIER by register(MNames.STORAGE_POWER_SUPPLIER, ::StoragePowerSupplierBlockEntity, MBlocks.STORAGE_POWER_SUPPLIER)
val HOLO_SIGN: BlockEntityType<HoloSignBlockEntity> by registry.register(MNames.HOLO_SIGN) { BlockEntityType.Builder.of(::HoloSignBlockEntity, MBlocks.HOLO_SIGN).build(null) } val HOLO_SIGN: BlockEntityType<HoloSignBlockEntity> 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_RECONSTRUCTOR, ::MatterReconstructorRenderer)
BlockEntityRenderers.register(MATTER_REPLICATOR, ::MatterReplicatorRenderer) BlockEntityRenderers.register(MATTER_REPLICATOR, ::MatterReplicatorRenderer)
BlockEntityRenderers.register(MATTER_SCANNER, ::MatterScannerRenderer) BlockEntityRenderers.register(MATTER_SCANNER, ::MatterScannerRenderer)
BlockEntityRenderers.register(POWERED_SMOKER, ::PoweredSmokerRenderer)
BlockEntityRenderers.register(HOLO_SIGN, ::HoloSignRenderer) BlockEntityRenderers.register(HOLO_SIGN, ::HoloSignRenderer)
BlockEntityRenderers.register(FLUID_TANK, ::FluidTankRenderer) BlockEntityRenderers.register(FLUID_TANK, ::FluidTankRenderer)
} }

View File

@ -81,52 +81,52 @@ import ru.dbotthepony.mc.otm.shapes.BlockShapes
import java.util.function.Supplier import java.util.function.Supplier
object MBlocks { object MBlocks {
private val registry = DeferredRegister.create(ForgeRegistries.BLOCKS, OverdriveThatMatters.MOD_ID) private val registry = MDeferredRegister(ForgeRegistries.BLOCKS)
internal fun register(bus: IEventBus) { internal fun register(bus: IEventBus) {
registry.register(bus) registry.register(bus)
} }
val ANDROID_STATION = registry.coloredWithBase(MNames.ANDROID_STATION) { color, _ -> AndroidStationBlock(color) } val ANDROID_STATION = registry.coloredWithBase(MNames.ANDROID_STATION, ::AndroidStationBlock)
val ANDROID_CHARGER: Block by registry.register(MNames.ANDROID_CHARGER) { AndroidChargerBlock() } val ANDROID_CHARGER = registry.coloredWithBase(MNames.ANDROID_CHARGER, ::AndroidChargerBlock)
val BATTERY_BANK = registry.coloredWithBase(MNames.BATTERY_BANK) { color, _ -> BatteryBankBlock(color) } val BATTERY_BANK = registry.coloredWithBase(MNames.BATTERY_BANK, ::BatteryBankBlock)
val MATTER_DECOMPOSER = registry.coloredWithBase(MNames.MATTER_DECOMPOSER) { color, _ -> MatterDecomposerBlock(color) } val MATTER_DECOMPOSER = registry.coloredWithBase(MNames.MATTER_DECOMPOSER, ::MatterDecomposerBlock)
val MATTER_CAPACITOR_BANK = registry.coloredWithBase(MNames.MATTER_CAPACITOR_BANK) { color, _ -> MatterCapacitorBankBlock(color) } val MATTER_CAPACITOR_BANK = registry.coloredWithBase(MNames.MATTER_CAPACITOR_BANK, ::MatterCapacitorBankBlock)
val MATTER_CABLE: Block by registry.register(MNames.MATTER_CABLE) { MatterCableBlock() } val MATTER_CABLE by registry.register(MNames.MATTER_CABLE, ::MatterCableBlock)
val PATTERN_STORAGE: Block by registry.register(MNames.PATTERN_STORAGE) { PatternStorageBlock() } val PATTERN_STORAGE by registry.register(MNames.PATTERN_STORAGE, ::PatternStorageBlock)
val MATTER_SCANNER = registry.coloredWithBase(MNames.MATTER_SCANNER) { color, _ -> MatterScannerBlock(color) } val MATTER_SCANNER = registry.coloredWithBase(MNames.MATTER_SCANNER, ::MatterScannerBlock)
val MATTER_PANEL: Block by registry.register(MNames.MATTER_PANEL) { MatterPanelBlock() } val MATTER_PANEL = registry.coloredWithBase(MNames.MATTER_PANEL, ::MatterPanelBlock)
val MATTER_REPLICATOR = registry.coloredWithBase(MNames.MATTER_REPLICATOR) { color, _ -> MatterReplicatorBlock(color) } val MATTER_REPLICATOR = registry.coloredWithBase(MNames.MATTER_REPLICATOR, ::MatterReplicatorBlock)
val MATTER_BOTTLER = registry.coloredWithBase(MNames.MATTER_BOTTLER) { color, _ -> MatterBottlerBlock(color) } val MATTER_BOTTLER = registry.coloredWithBase(MNames.MATTER_BOTTLER, ::MatterBottlerBlock)
val ENERGY_COUNTER: Block by registry.register(MNames.ENERGY_COUNTER) { EnergyCounterBlock() } val ENERGY_COUNTER by registry.register(MNames.ENERGY_COUNTER, ::EnergyCounterBlock)
val CHEMICAL_GENERATOR: Block by registry.register(MNames.CHEMICAL_GENERATOR) { ChemicalGeneratorBlock() } val CHEMICAL_GENERATOR by registry.register(MNames.CHEMICAL_GENERATOR, ::ChemicalGeneratorBlock)
val PLATE_PRESS = registry.coloredWithBase(MNames.PLATE_PRESS) { color, _ -> PlatePressBlock(color) } 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 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_FURNACE = registry.coloredWithBase(MNames.POWERED_FURNACE, ::PoweredFurnaceBlock)
val POWERED_BLAST_FURNACE = registry.coloredWithBase(MNames.POWERED_BLAST_FURNACE) { color, _ -> PoweredBlastFurnaceBlock(color) } val POWERED_BLAST_FURNACE = registry.coloredWithBase(MNames.POWERED_BLAST_FURNACE, ::PoweredBlastFurnaceBlock)
val POWERED_SMOKER = registry.coloredWithBase(MNames.POWERED_SMOKER) { color, _ -> PoweredSmokerBlock(color) } val POWERED_SMOKER = registry.coloredWithBase(MNames.POWERED_SMOKER, ::PoweredSmokerBlock)
val MATTER_RECYCLER = registry.coloredWithBase(MNames.MATTER_RECYCLER) { color, _ -> MatterRecyclerBlock(color) } val MATTER_RECYCLER = registry.coloredWithBase(MNames.MATTER_RECYCLER, ::MatterRecyclerBlock)
val ENERGY_SERVO: Block by registry.register(MNames.ENERGY_SERVO) { EnergyServoBlock() } val ENERGY_SERVO by registry.register(MNames.ENERGY_SERVO, ::EnergyServoBlock)
val COBBLESTONE_GENERATOR = registry.coloredWithBase(MNames.COBBLESTONE_GENERATOR) { color, _ -> CobblerBlock(color) } val COBBLESTONE_GENERATOR = registry.coloredWithBase(MNames.COBBLESTONE_GENERATOR, ::CobblerBlock)
val INFINITE_WATER_SOURCE: Block by registry.register(MNames.INFINITE_WATER_SOURCE) { InfiniteWaterSourceBlock() } val INFINITE_WATER_SOURCE by registry.register(MNames.INFINITE_WATER_SOURCE) { InfiniteWaterSourceBlock() }
val ESSENCE_STORAGE = registry.coloredWithBase(MNames.ESSENCE_STORAGE) { color, _ -> EssenceStorageBlock(color) } val ESSENCE_STORAGE = registry.coloredWithBase(MNames.ESSENCE_STORAGE, ::EssenceStorageBlock)
val MATTER_RECONSTRUCTOR = registry.coloredWithBase(MNames.MATTER_RECONSTRUCTOR) { color, _ -> MatterReconstructorBlock(color) } val MATTER_RECONSTRUCTOR = registry.coloredWithBase(MNames.MATTER_RECONSTRUCTOR, ::MatterReconstructorBlock)
val PAINTER: PainterBlock by registry.register(MNames.PAINTER) { PainterBlock() } val PAINTER by registry.register(MNames.PAINTER, ::PainterBlock)
val MATTER_ENTANGLER: MatterEntanglerBlock by registry.register(MNames.MATTER_ENTANGLER) { MatterEntanglerBlock() } val MATTER_ENTANGLER: MatterEntanglerBlock by registry.register(MNames.MATTER_ENTANGLER) { MatterEntanglerBlock() }
val ENERGY_CABLES: Map<CablesConfig.E, EnergyCableBlock> = SupplierMap(CablesConfig.E.entries.map { conf -> val ENERGY_CABLES: Map<CablesConfig.E, EnergyCableBlock> = SupplierMap(CablesConfig.E.entries.map { conf ->
conf to registry.register("${conf.name.lowercase()}_energy_cable") { EnergyCableBlock { a, b -> MBlockEntities.ENERGY_CABLES[conf]!!.create(a, b)!! } } 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_BUS: Block by registry.register(MNames.STORAGE_BUS, ::StorageBusBlock)
val STORAGE_IMPORTER: Block by registry.register(MNames.STORAGE_IMPORTER) { StorageImporterBlock() } val STORAGE_IMPORTER: Block by registry.register(MNames.STORAGE_IMPORTER, ::StorageImporterBlock)
val STORAGE_EXPORTER: Block by registry.register(MNames.STORAGE_EXPORTER) { StorageExporterBlock() } val STORAGE_EXPORTER: Block by registry.register(MNames.STORAGE_EXPORTER, ::StorageExporterBlock)
val DRIVE_VIEWER: Block by registry.register(MNames.DRIVE_VIEWER) { DriveViewerBlock() } val DRIVE_VIEWER = registry.coloredWithBase(MNames.DRIVE_VIEWER, ::DriveViewerBlock)
val DRIVE_RACK: Block by registry.register(MNames.DRIVE_RACK) { DriveRackBlock() } val DRIVE_RACK: Block by registry.register(MNames.DRIVE_RACK, ::DriveRackBlock)
val ITEM_MONITOR = registry.coloredWithBase(MNames.ITEM_MONITOR) { color, _ -> ItemMonitorBlock(color) } val ITEM_MONITOR = registry.coloredWithBase(MNames.ITEM_MONITOR, ::ItemMonitorBlock)
val STORAGE_CABLE: Block by registry.register(MNames.STORAGE_CABLE) { StorageCableBlock() } 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 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_EXPLOSION_SMALL: Block by registry.register(MNames.DEBUG_EXPLOSION_SMALL) { BlockExplosionDebugger() }
val DEBUG_SPHERE_POINTS: Block by registry.register(MNames.DEBUG_SPHERE_POINTS) { BlockSphereDebugger() } val DEBUG_SPHERE_POINTS: Block by registry.register(MNames.DEBUG_SPHERE_POINTS) { BlockSphereDebugger() }
@ -208,13 +208,11 @@ object MBlocks {
TRITANIUM_ANVIL = SupplierList(anvils) TRITANIUM_ANVIL = SupplierList(anvils)
} }
val TRITANIUM_DOOR: Map<DyeColor?, TritaniumDoorBlock> = registry.coloredWithBase(MNames.TRITANIUM_DOOR) { color, _ -> val TRITANIUM_DOOR = registry.coloredWithBase(MNames.TRITANIUM_DOOR, ::TritaniumDoorBlock)
TritaniumDoorBlock(color) }
val TRITANIUM_TRAPDOOR: Map<DyeColor?, TritaniumTrapdoorBlock> = registry.coloredWithBase(MNames.TRITANIUM_TRAPDOOR) { color, _ -> val TRITANIUM_TRAPDOOR = registry.coloredWithBase(MNames.TRITANIUM_TRAPDOOR, ::TritaniumTrapdoorBlock)
TritaniumTrapdoorBlock(color) }
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) BlockBehaviour.Properties.of(Material.METAL, DyeColor.LIGHT_BLUE)
.sound(SoundType.BASALT) .sound(SoundType.BASALT)
.requiresCorrectToolForDrops() .requiresCorrectToolForDrops()

View File

@ -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<R : Any>(val registry: ResourceKey<Registry<R>>, val modId: String = OverdriveThatMatters.MOD_ID) {
constructor(registry: IForgeRegistry<R>, modId: String = OverdriveThatMatters.MOD_ID) : this(registry.registryKey, modId)
private val entries = Object2ObjectLinkedOpenHashMap<String, Entry<R>>()
private var allowRegistration = true
private var eventRegistered = false
private val stages = ArrayList<RegistrationStage>()
private inner class RegistrationStage(val serial: Boolean) {
private val entries = ArrayList<Entry<R>>()
fun add(entry: Entry<R>) {
entries.add(entry)
}
fun run(): List<Entry<R>> {
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<FutureTask<R>>()
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<out T : R>(val name: String, private val factory: Supplier<T>, serial: Boolean) : Supplier<@UnsafeVariance T>, Lazy<T> {
constructor(name: String, factory: Supplier<T>) : 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 <T : R> colored(prefix: String, factory: (color: DyeColor) -> T): Map<DyeColor, T> {
return SupplierMap(MRegistry.DYE_ORDER.map { it to Entry(prefix + "_" + it.name.lowercase()) { factory.invoke(it) } })
}
fun <T : R> coloredWithBase(prefix: String, factory: (color: DyeColor?) -> T): Map<DyeColor?, T> {
val values = ArrayList<Pair<DyeColor?, Supplier<T>>>()
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 <T : R> register(name: String, factory: Supplier<T>) = Entry(name, factory)
fun <T : R> register(name: String, factory: Supplier<T>, serial: Boolean) = Entry(name, factory, serial)
fun <T : R> register(name: String, serial: Boolean, factory: Supplier<T>) = 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()
}
}

View File

@ -17,14 +17,14 @@ import ru.dbotthepony.mc.otm.entity.MinecartCargoCrate
import ru.dbotthepony.mc.otm.entity.PlasmaProjectile import ru.dbotthepony.mc.otm.entity.PlasmaProjectile
object MEntityTypes { object MEntityTypes {
private val registry: DeferredRegister<EntityType<*>> = DeferredRegister.create(ForgeRegistries.ENTITY_TYPES, OverdriveThatMatters.MOD_ID) private val registry = MDeferredRegister(ForgeRegistries.ENTITY_TYPES)
val PLASMA: EntityType<*> by registry.register(MNames.PLASMA) { val PLASMA: EntityType<*> by registry.register(MNames.PLASMA) {
EntityType.Builder.of<PlasmaProjectile>({ _, level -> PlasmaProjectile(level) }, MobCategory.MISC).sized(0.4f, 0.4f).build(MNames.PLASMA) EntityType.Builder.of<PlasmaProjectile>({ _, 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 -> val CARGO_CRATE_MINECARTS = registry.coloredWithBase(MNames.MINECART_CARGO_CRATE) { color ->
EntityType.Builder.of<MinecartCargoCrate>({ it, level -> MinecartCargoCrate(it, color, level)}, MobCategory.MISC).sized(0.98F, 0.7F).clientTrackingRange(8).build(name) EntityType.Builder.of<MinecartCargoCrate>({ 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) { internal fun register(bus: IEventBus) {

View File

@ -15,8 +15,8 @@ import ru.dbotthepony.mc.otm.OverdriveThatMatters
import java.util.function.Consumer import java.util.function.Consumer
object MFluids { object MFluids {
private val types: DeferredRegister<FluidType> = DeferredRegister.create(ForgeRegistries.Keys.FLUID_TYPES, OverdriveThatMatters.MOD_ID) private val types = MDeferredRegister(ForgeRegistries.Keys.FLUID_TYPES)
private val fluids: DeferredRegister<Fluid> = DeferredRegister.create(ForgeRegistries.FLUIDS, OverdriveThatMatters.MOD_ID) private val fluids = MDeferredRegister(ForgeRegistries.FLUIDS)
internal fun register(bus: IEventBus) { internal fun register(bus: IEventBus) {
types.register(bus) types.register(bus)

View File

@ -10,7 +10,7 @@ import ru.dbotthepony.mc.otm.item.ProceduralBatteryItem
import ru.dbotthepony.mc.otm.item.exopack.ProceduralExopackSlotUpgradeItem import ru.dbotthepony.mc.otm.item.exopack.ProceduralExopackSlotUpgradeItem
object MItemFunctionTypes { object MItemFunctionTypes {
private val registry = DeferredRegister.create(Registries.LOOT_FUNCTION_TYPE, OverdriveThatMatters.MOD_ID) private val registry = MDeferredRegister(Registries.LOOT_FUNCTION_TYPE, OverdriveThatMatters.MOD_ID)
val COPY_TILE_NBT: LootItemFunctionType by registry.register("copy_tile_nbt") { LootItemFunctionType(CopyTileNbtFunction.CODEC) } 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) } val PROCEDURAL_BATTERY: LootItemFunctionType by registry.register(MNames.PROCEDURAL_BATTERY) { LootItemFunctionType(ProceduralBatteryItem.Randomizer.CODEC) }

View File

@ -6,13 +6,16 @@ import net.minecraft.network.chat.Component
import net.minecraft.resources.ResourceLocation import net.minecraft.resources.ResourceLocation
import net.minecraft.world.food.FoodProperties import net.minecraft.world.food.FoodProperties
import net.minecraft.world.item.* import net.minecraft.world.item.*
import net.minecraft.world.item.Item.Properties
import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.item.crafting.Ingredient
import net.minecraft.world.level.Level import net.minecraft.world.level.Level
import net.minecraft.world.level.block.Block
import net.minecraftforge.common.ForgeTier import net.minecraftforge.common.ForgeTier
import net.minecraftforge.common.TierSortingRegistry import net.minecraftforge.common.TierSortingRegistry
import net.minecraftforge.eventbus.api.IEventBus import net.minecraftforge.eventbus.api.IEventBus
import net.minecraftforge.registries.DeferredRegister import net.minecraftforge.registries.DeferredRegister
import net.minecraftforge.registries.ForgeRegistries import net.minecraftforge.registries.ForgeRegistries
import net.minecraftforge.registries.RegistryObject
import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.OverdriveThatMatters
import ru.dbotthepony.mc.otm.capability.ITieredUpgradeSet import ru.dbotthepony.mc.otm.capability.ITieredUpgradeSet
import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability import ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability
@ -44,8 +47,12 @@ import ru.dbotthepony.mc.otm.item.weapon.PlasmaRifleItem
import java.util.function.Supplier import java.util.function.Supplier
object MItems { object MItems {
private val DEFAULT_PROPERTIES = Item.Properties() private val DEFAULT_PROPERTIES = Properties()
private val registry: DeferredRegister<Item> = DeferredRegister.create(ForgeRegistries.ITEMS, OverdriveThatMatters.MOD_ID) private val registry = MDeferredRegister(ForgeRegistries.ITEMS)
private fun register(name: String, blocks: Map<DyeColor?, Block>, properties: Properties = DEFAULT_PROPERTIES): Map<DyeColor?, BlockItem> {
return registry.coloredWithBase(name) { color -> BlockItem(blocks[color]!!, properties) }
}
internal fun register(bus: IEventBus) { internal fun register(bus: IEventBus) {
registry.register(bus) registry.register(bus)
@ -55,49 +62,49 @@ object MItems {
conf to registry.register("${conf.name.lowercase()}_energy_cable") { BlockItem(MBlocks.ENERGY_CABLES[conf]!!, DEFAULT_PROPERTIES) } 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_STATION = register(MNames.ANDROID_STATION, MBlocks.ANDROID_STATION)
val ANDROID_CHARGER: BlockItem by registry.register(MNames.ANDROID_CHARGER) { BlockItem(MBlocks.ANDROID_CHARGER, DEFAULT_PROPERTIES) } val ANDROID_CHARGER = register(MNames.ANDROID_CHARGER, MBlocks.ANDROID_CHARGER)
val BATTERY_BANK = registry.coloredWithBase(MNames.BATTERY_BANK) { color, _ -> BlockItem(MBlocks.BATTERY_BANK[color]!!, DEFAULT_PROPERTIES) } val BATTERY_BANK = register(MNames.BATTERY_BANK, MBlocks.BATTERY_BANK)
val MATTER_DECOMPOSER = registry.coloredWithBase(MNames.MATTER_DECOMPOSER) { color, _ -> BlockItem(MBlocks.MATTER_DECOMPOSER[color]!!, DEFAULT_PROPERTIES) } val MATTER_DECOMPOSER = register(MNames.MATTER_DECOMPOSER, MBlocks.MATTER_DECOMPOSER)
val MATTER_CAPACITOR_BANK = registry.coloredWithBase(MNames.MATTER_CAPACITOR_BANK) { color, _ -> BlockItem(MBlocks.MATTER_CAPACITOR_BANK[color]!!, DEFAULT_PROPERTIES) } 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 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 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_SCANNER = register(MNames.MATTER_SCANNER, MBlocks.MATTER_SCANNER)
val MATTER_PANEL: BlockItem by registry.register(MNames.MATTER_PANEL) { BlockItem(MBlocks.MATTER_PANEL, DEFAULT_PROPERTIES) } val MATTER_PANEL = register(MNames.MATTER_PANEL, MBlocks.MATTER_PANEL)
val MATTER_REPLICATOR = registry.coloredWithBase(MNames.MATTER_REPLICATOR) { color, _ -> BlockItem(MBlocks.MATTER_REPLICATOR[color]!!, DEFAULT_PROPERTIES) } val MATTER_REPLICATOR = register(MNames.MATTER_REPLICATOR, MBlocks.MATTER_REPLICATOR)
val MATTER_BOTTLER = registry.coloredWithBase(MNames.MATTER_BOTTLER) { color, _ -> BlockItem(MBlocks.MATTER_BOTTLER[color]!!, DEFAULT_PROPERTIES) } 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 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 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 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 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 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 PLATE_PRESS = register(MNames.PLATE_PRESS, MBlocks.PLATE_PRESS)
val TWIN_PLATE_PRESS = registry.coloredWithBase(MNames.TWIN_PLATE_PRESS) { color, _ -> BlockItem(MBlocks.TWIN_PLATE_PRESS[color]!!, DEFAULT_PROPERTIES) } val TWIN_PLATE_PRESS = register(MNames.TWIN_PLATE_PRESS, MBlocks.TWIN_PLATE_PRESS)
val MATTER_RECYCLER = registry.coloredWithBase(MNames.MATTER_RECYCLER) { color, _ -> BlockItem(MBlocks.MATTER_RECYCLER[color]!!, DEFAULT_PROPERTIES) } 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_FURNACE = register(MNames.POWERED_FURNACE, MBlocks.POWERED_FURNACE)
val POWERED_BLAST_FURNACE = registry.coloredWithBase(MNames.POWERED_BLAST_FURNACE) { color, _ -> BlockItem(MBlocks.POWERED_BLAST_FURNACE[color]!!, DEFAULT_PROPERTIES) } val POWERED_BLAST_FURNACE = register(MNames.POWERED_BLAST_FURNACE, MBlocks.POWERED_BLAST_FURNACE)
val POWERED_SMOKER = registry.coloredWithBase(MNames.POWERED_SMOKER) { color, _ -> BlockItem(MBlocks.POWERED_SMOKER[color]!!, DEFAULT_PROPERTIES) } 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_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_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 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 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_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 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 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 ENERGY_SERVO: BlockItem by registry.register(MNames.ENERGY_SERVO) { BlockItem(MBlocks.ENERGY_SERVO, DEFAULT_PROPERTIES) }
val COBBLESTONE_GENERATOR: Map<DyeColor?, BlockItem> = 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 INFINITE_WATER_SOURCE: BlockItem by registry.register(MNames.INFINITE_WATER_SOURCE) { BlockItem(MBlocks.INFINITE_WATER_SOURCE, DEFAULT_PROPERTIES) }
val ESSENCE_STORAGE: Map<DyeColor?, BlockItem> = registry.coloredWithBase(MNames.ESSENCE_STORAGE) { color, _ -> BlockItem(MBlocks.ESSENCE_STORAGE[color]!!, DEFAULT_PROPERTIES) } val ESSENCE_STORAGE = register(MNames.ESSENCE_STORAGE, MBlocks.ESSENCE_STORAGE)
val MATTER_RECONSTRUCTOR = registry.coloredWithBase(MNames.MATTER_RECONSTRUCTOR) { color, _ -> BlockItem(MBlocks.MATTER_RECONSTRUCTOR[color]!!, DEFAULT_PROPERTIES) } 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 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) } val PAINTER: BlockItem by registry.register(MNames.PAINTER) { BlockItem(MBlocks.PAINTER, DEFAULT_PROPERTIES) }
@ -115,7 +122,7 @@ object MItems {
machines.addAll(POWERED_SMOKER.asSupplierArray()) machines.addAll(POWERED_SMOKER.asSupplierArray())
machines.addAll(ANDROID_STATION.asSupplierArray().iterator()) machines.addAll(ANDROID_STATION.asSupplierArray().iterator())
machines.add(::ANDROID_CHARGER) machines.addAll(ANDROID_CHARGER.asSupplierArray().iterator())
machines.addAll(BATTERY_BANK.asSupplierArray().iterator()) machines.addAll(BATTERY_BANK.asSupplierArray().iterator())
machines.add(::ENERGY_COUNTER) machines.add(::ENERGY_COUNTER)
machines.add(::CHEMICAL_GENERATOR) machines.add(::CHEMICAL_GENERATOR)
@ -130,7 +137,7 @@ object MItems {
machines.add(::MATTER_CABLE) machines.add(::MATTER_CABLE)
machines.add(::PATTERN_STORAGE) machines.add(::PATTERN_STORAGE)
machines.addAll(MATTER_SCANNER.asSupplierArray().iterator()) 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_REPLICATOR.asSupplierArray().iterator())
machines.addAll(MATTER_BOTTLER.asSupplierArray().iterator()) machines.addAll(MATTER_BOTTLER.asSupplierArray().iterator())
machines.add(::MATTER_ENTANGLER) machines.add(::MATTER_ENTANGLER)
@ -139,11 +146,11 @@ object MItems {
machines.add(::STORAGE_BUS) machines.add(::STORAGE_BUS)
machines.add(::STORAGE_IMPORTER) machines.add(::STORAGE_IMPORTER)
machines.add(::STORAGE_EXPORTER) machines.add(::STORAGE_EXPORTER)
machines.add(::DRIVE_VIEWER) machines.addAll(DRIVE_VIEWER.asSupplierArray().iterator())
machines.add(::DRIVE_RACK) machines.add(::DRIVE_RACK)
machines.addAll(ITEM_MONITOR.asSupplierArray().iterator()) machines.addAll(ITEM_MONITOR.asSupplierArray().iterator())
machines.add(::STORAGE_CABLE) machines.add(::STORAGE_CABLE)
machines.add(::STORAGE_POWER_SUPPLIER) machines.addAll(STORAGE_POWER_SUPPLIER.asSupplierArray().iterator())
MACHINES = SupplierList(machines) MACHINES = SupplierList(machines)
} }
@ -438,8 +445,8 @@ object MItems {
val ENGINE: Item by registry.register(MNames.ENGINE) { BlockItem(MBlocks.ENGINE, DEFAULT_PROPERTIES) } 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 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_DOOR = register(MNames.TRITANIUM_DOOR, MBlocks.TRITANIUM_DOOR)
val TRITANIUM_TRAPDOOR = registry.coloredWithBase(MNames.TRITANIUM_TRAPDOOR) { color, _ -> BlockItem(MBlocks.TRITANIUM_TRAPDOOR[color]!!, DEFAULT_PROPERTIES) } val TRITANIUM_TRAPDOOR = register(MNames.TRITANIUM_TRAPDOOR, MBlocks.TRITANIUM_TRAPDOOR)
// components // components
val MATTER_IO_PORT: Item by registry.register(MNames.MATTER_IO_PORT) { Item(DEFAULT_PROPERTIES) } val MATTER_IO_PORT: Item by registry.register(MNames.MATTER_IO_PORT) { Item(DEFAULT_PROPERTIES) }
@ -529,7 +536,7 @@ object MItems {
::REINFORCED_TRITANIUM_PLATE, ::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) val EXOPACK_PROBE: Item by registry.register(MNames.EXOPACK_PROBE, ::ExopackProbeItem)

View File

@ -16,7 +16,7 @@ import ru.dbotthepony.mc.otm.data.condition.KilledByRealPlayerOrIndirectly
import ru.dbotthepony.mc.otm.data.condition.ChanceCondition import ru.dbotthepony.mc.otm.data.condition.ChanceCondition
object MLootItemConditions { object MLootItemConditions {
private val registry = DeferredRegister.create(Registries.LOOT_CONDITION_TYPE, OverdriveThatMatters.MOD_ID) private val registry = MDeferredRegister(Registries.LOOT_CONDITION_TYPE, OverdriveThatMatters.MOD_ID)
val HAS_EXOPACK: LootItemConditionType by registry.register("has_exopack") { LootItemConditionType(Codec2Serializer(SingletonCodec(HasExoPackCondition))) } 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)) } val CHANCE_WITH_PLAYTIME: LootItemConditionType by registry.register("chance_with_playtime") { LootItemConditionType(Codec2Serializer(ChanceWithPlaytimeCondition.CODEC)) }

View File

@ -75,43 +75,43 @@ import ru.dbotthepony.mc.otm.menu.tech.PoweredFurnaceMenu
import ru.dbotthepony.mc.otm.menu.tech.TwinPlatePressMenu import ru.dbotthepony.mc.otm.menu.tech.TwinPlatePressMenu
object MMenus { object MMenus {
private val registry = DeferredRegister.create(ForgeRegistries.MENU_TYPES, OverdriveThatMatters.MOD_ID) private val registry = MDeferredRegister(ForgeRegistries.MENU_TYPES)
val ANDROID_STATION: MenuType<AndroidStationMenu> by registry.register(MNames.ANDROID_STATION) { MenuType(::AndroidStationMenu, FeatureFlags.VANILLA_SET) } val ANDROID_STATION by registry.register(MNames.ANDROID_STATION) { MenuType(::AndroidStationMenu, FeatureFlags.VANILLA_SET) }
val ANDROID_CHARGER: MenuType<AndroidChargerMenu> by registry.register(MNames.ANDROID_CHARGER) { MenuType({ a, b -> AndroidChargerMenu(a, b, null as AndroidChargerBlockEntity?) }, FeatureFlags.VANILLA_SET) } val ANDROID_CHARGER by registry.register(MNames.ANDROID_CHARGER) { MenuType({ a, b -> AndroidChargerMenu(a, b, null as AndroidChargerBlockEntity?) }, FeatureFlags.VANILLA_SET) }
val BATTERY_BANK: MenuType<BatteryBankMenu> by registry.register(MNames.BATTERY_BANK) { MenuType(::BatteryBankMenu, FeatureFlags.VANILLA_SET) } val BATTERY_BANK by registry.register(MNames.BATTERY_BANK) { MenuType(::BatteryBankMenu, FeatureFlags.VANILLA_SET) }
val MATTER_DECOMPOSER: MenuType<MatterDecomposerMenu> by registry.register(MNames.MATTER_DECOMPOSER) { MenuType(::MatterDecomposerMenu, FeatureFlags.VANILLA_SET) } val MATTER_DECOMPOSER by registry.register(MNames.MATTER_DECOMPOSER) { MenuType(::MatterDecomposerMenu, FeatureFlags.VANILLA_SET) }
val MATTER_CAPACITOR_BANK: MenuType<MatterCapacitorBankMenu> by registry.register(MNames.MATTER_CAPACITOR_BANK) { MenuType(::MatterCapacitorBankMenu, FeatureFlags.VANILLA_SET) } val MATTER_CAPACITOR_BANK by registry.register(MNames.MATTER_CAPACITOR_BANK) { MenuType(::MatterCapacitorBankMenu, FeatureFlags.VANILLA_SET) }
val PATTERN_STORAGE: MenuType<PatternStorageMenu> by registry.register(MNames.PATTERN_STORAGE) { MenuType(::PatternStorageMenu, FeatureFlags.VANILLA_SET) } val PATTERN_STORAGE by registry.register(MNames.PATTERN_STORAGE) { MenuType(::PatternStorageMenu, FeatureFlags.VANILLA_SET) }
val MATTER_SCANNER: MenuType<MatterScannerMenu> by registry.register(MNames.MATTER_SCANNER) { MenuType(::MatterScannerMenu, FeatureFlags.VANILLA_SET) } val MATTER_SCANNER by registry.register(MNames.MATTER_SCANNER) { MenuType(::MatterScannerMenu, FeatureFlags.VANILLA_SET) }
val MATTER_PANEL: MenuType<MatterPanelMenu> by registry.register(MNames.MATTER_PANEL) { MenuType(::MatterPanelMenu, FeatureFlags.VANILLA_SET) } val MATTER_PANEL by registry.register(MNames.MATTER_PANEL) { MenuType(::MatterPanelMenu, FeatureFlags.VANILLA_SET) }
val MATTER_REPLICATOR: MenuType<MatterReplicatorMenu> by registry.register(MNames.MATTER_REPLICATOR) { MenuType(::MatterReplicatorMenu, FeatureFlags.VANILLA_SET) } val MATTER_REPLICATOR by registry.register(MNames.MATTER_REPLICATOR) { MenuType(::MatterReplicatorMenu, FeatureFlags.VANILLA_SET) }
val MATTER_BOTTLER: MenuType<MatterBottlerMenu> by registry.register(MNames.MATTER_BOTTLER) { MenuType(::MatterBottlerMenu, FeatureFlags.VANILLA_SET) } val MATTER_BOTTLER by registry.register(MNames.MATTER_BOTTLER) { MenuType(::MatterBottlerMenu, FeatureFlags.VANILLA_SET) }
val DRIVE_VIEWER: MenuType<DriveViewerMenu> by registry.register(MNames.DRIVE_VIEWER) { MenuType(::DriveViewerMenu, FeatureFlags.VANILLA_SET) } val DRIVE_VIEWER by registry.register(MNames.DRIVE_VIEWER) { MenuType(::DriveViewerMenu, FeatureFlags.VANILLA_SET) }
val CARGO_CRATE: MenuType<CargoCrateMenu> by registry.register(MNames.CARGO_CRATE) { MenuType(::CargoCrateMenu, FeatureFlags.VANILLA_SET) } val CARGO_CRATE by registry.register(MNames.CARGO_CRATE) { MenuType(::CargoCrateMenu, FeatureFlags.VANILLA_SET) }
val MINECART_CARGO_CRATE: MenuType<MinecartCargoCrateMenu> by registry.register(MNames.MINECART_CARGO_CRATE) { MenuType(::MinecartCargoCrateMenu, FeatureFlags.VANILLA_SET) } val MINECART_CARGO_CRATE by registry.register(MNames.MINECART_CARGO_CRATE) { MenuType(::MinecartCargoCrateMenu, FeatureFlags.VANILLA_SET) }
val DRIVE_RACK: MenuType<DriveRackMenu> by registry.register(MNames.DRIVE_RACK) { MenuType(::DriveRackMenu, FeatureFlags.VANILLA_SET) } val DRIVE_RACK by registry.register(MNames.DRIVE_RACK) { MenuType(::DriveRackMenu, FeatureFlags.VANILLA_SET) }
val ITEM_MONITOR: MenuType<ItemMonitorMenu> by registry.register(MNames.ITEM_MONITOR) { MenuType(::ItemMonitorMenu, FeatureFlags.VANILLA_SET) } val ITEM_MONITOR by registry.register(MNames.ITEM_MONITOR) { MenuType(::ItemMonitorMenu, FeatureFlags.VANILLA_SET) }
val ENERGY_COUNTER: MenuType<EnergyCounterMenu> by registry.register(MNames.ENERGY_COUNTER) { MenuType(::EnergyCounterMenu, FeatureFlags.VANILLA_SET) } val ENERGY_COUNTER by registry.register(MNames.ENERGY_COUNTER) { MenuType(::EnergyCounterMenu, FeatureFlags.VANILLA_SET) }
val CHEMICAL_GENERATOR: MenuType<ChemicalGeneratorMenu> by registry.register(MNames.CHEMICAL_GENERATOR) { MenuType(::ChemicalGeneratorMenu, FeatureFlags.VANILLA_SET) } val CHEMICAL_GENERATOR by registry.register(MNames.CHEMICAL_GENERATOR) { MenuType(::ChemicalGeneratorMenu, FeatureFlags.VANILLA_SET) }
val PLATE_PRESS: MenuType<PlatePressMenu> by registry.register(MNames.PLATE_PRESS) { MenuType(::PlatePressMenu, FeatureFlags.VANILLA_SET) } val PLATE_PRESS by registry.register(MNames.PLATE_PRESS) { MenuType(::PlatePressMenu, FeatureFlags.VANILLA_SET) }
val POWERED_FURNACE: MenuType<PoweredFurnaceMenu> by registry.register(MNames.POWERED_FURNACE) { MenuType(PoweredFurnaceMenu::furnace, FeatureFlags.VANILLA_SET) } val POWERED_FURNACE by registry.register(MNames.POWERED_FURNACE) { MenuType(PoweredFurnaceMenu::furnace, FeatureFlags.VANILLA_SET) }
val POWERED_BLAST_FURNACE: MenuType<PoweredFurnaceMenu> by registry.register(MNames.POWERED_BLAST_FURNACE) { MenuType(PoweredFurnaceMenu::blasting, FeatureFlags.VANILLA_SET) } val POWERED_BLAST_FURNACE by registry.register(MNames.POWERED_BLAST_FURNACE) { MenuType(PoweredFurnaceMenu::blasting, FeatureFlags.VANILLA_SET) }
val POWERED_SMOKER: MenuType<PoweredFurnaceMenu> by registry.register(MNames.POWERED_SMOKER) { MenuType(PoweredFurnaceMenu::smoking, FeatureFlags.VANILLA_SET) } val POWERED_SMOKER by registry.register(MNames.POWERED_SMOKER) { MenuType(PoweredFurnaceMenu::smoking, FeatureFlags.VANILLA_SET) }
val TWIN_PLATE_PRESS: MenuType<TwinPlatePressMenu> by registry.register(MNames.TWIN_PLATE_PRESS) { MenuType(::TwinPlatePressMenu, FeatureFlags.VANILLA_SET) } val TWIN_PLATE_PRESS by registry.register(MNames.TWIN_PLATE_PRESS) { MenuType(::TwinPlatePressMenu, FeatureFlags.VANILLA_SET) }
val MATTER_RECYCLER: MenuType<MatterRecyclerMenu> by registry.register(MNames.MATTER_RECYCLER) { MenuType(::MatterRecyclerMenu, FeatureFlags.VANILLA_SET) } val MATTER_RECYCLER by registry.register(MNames.MATTER_RECYCLER) { MenuType(::MatterRecyclerMenu, FeatureFlags.VANILLA_SET) }
val ENERGY_SERVO: MenuType<EnergyServoMenu> by registry.register(MNames.ENERGY_SERVO) { MenuType(::EnergyServoMenu, FeatureFlags.VANILLA_SET) } val ENERGY_SERVO by registry.register(MNames.ENERGY_SERVO) { MenuType(::EnergyServoMenu, FeatureFlags.VANILLA_SET) }
val HOLO_SIGN: MenuType<HoloSignMenu> by registry.register(MNames.HOLO_SIGN) { MenuType(::HoloSignMenu, FeatureFlags.VANILLA_SET) } val HOLO_SIGN by registry.register(MNames.HOLO_SIGN) { MenuType(::HoloSignMenu, FeatureFlags.VANILLA_SET) }
val COBBLESTONE_GENERATOR: MenuType<CobblerMenu> by registry.register(MNames.COBBLESTONE_GENERATOR) { MenuType(::CobblerMenu, FeatureFlags.VANILLA_SET) } val COBBLESTONE_GENERATOR by registry.register(MNames.COBBLESTONE_GENERATOR) { MenuType(::CobblerMenu, FeatureFlags.VANILLA_SET) }
val ESSENCE_STORAGE: MenuType<EssenceStorageMenu> by registry.register(MNames.ESSENCE_STORAGE) { MenuType(::EssenceStorageMenu, FeatureFlags.VANILLA_SET) } val ESSENCE_STORAGE by registry.register(MNames.ESSENCE_STORAGE) { MenuType(::EssenceStorageMenu, FeatureFlags.VANILLA_SET) }
val ITEM_REPAIER: MenuType<MatterReconstructorMenu> by registry.register(MNames.MATTER_RECONSTRUCTOR) { MenuType(::MatterReconstructorMenu, FeatureFlags.VANILLA_SET) } val ITEM_REPAIER by registry.register(MNames.MATTER_RECONSTRUCTOR) { MenuType(::MatterReconstructorMenu, FeatureFlags.VANILLA_SET) }
val FLUID_TANK: MenuType<FluidTankMenu> by registry.register(MNames.FLUID_TANK) { MenuType(::FluidTankMenu, FeatureFlags.VANILLA_SET) } val FLUID_TANK by registry.register(MNames.FLUID_TANK) { MenuType(::FluidTankMenu, FeatureFlags.VANILLA_SET) }
val PAINTER: MenuType<PainterMenu> by registry.register(MNames.PAINTER) { MenuType(::PainterMenu, FeatureFlags.VANILLA_SET) } val PAINTER by registry.register(MNames.PAINTER) { MenuType(::PainterMenu, FeatureFlags.VANILLA_SET) }
val MATTER_ENTANGLER: MenuType<MatterEntanglerMenu> by registry.register(MNames.MATTER_ENTANGLER) { MenuType(::MatterEntanglerMenu, FeatureFlags.VANILLA_SET) } val MATTER_ENTANGLER by registry.register(MNames.MATTER_ENTANGLER) { MenuType(::MatterEntanglerMenu, FeatureFlags.VANILLA_SET) }
val STORAGE_BUS: MenuType<StorageBusMenu> by registry.register(MNames.STORAGE_BUS) { MenuType(::StorageBusMenu, FeatureFlags.VANILLA_SET) } val STORAGE_BUS by registry.register(MNames.STORAGE_BUS) { MenuType(::StorageBusMenu, FeatureFlags.VANILLA_SET) }
val STORAGE_IMPORTER_EXPORTER: MenuType<StorageImporterExporterMenu> by registry.register(MNames.STORAGE_IMPORTER) { MenuType(::StorageImporterExporterMenu, FeatureFlags.VANILLA_SET) } val STORAGE_IMPORTER_EXPORTER by registry.register(MNames.STORAGE_IMPORTER) { MenuType(::StorageImporterExporterMenu, FeatureFlags.VANILLA_SET) }
val STORAGE_POWER_SUPPLIER: MenuType<StoragePowerSupplierMenu> by registry.register(MNames.STORAGE_POWER_SUPPLIER) { MenuType(::StoragePowerSupplierMenu, FeatureFlags.VANILLA_SET) } val STORAGE_POWER_SUPPLIER by registry.register(MNames.STORAGE_POWER_SUPPLIER) { MenuType(::StoragePowerSupplierMenu, FeatureFlags.VANILLA_SET) }
internal fun register(bus: IEventBus) { internal fun register(bus: IEventBus) {
registry.register(bus) registry.register(bus)

View File

@ -20,15 +20,15 @@ object MRecipes {
} }
} }
private val types = DeferredRegister.create(ForgeRegistries.RECIPE_TYPES, OverdriveThatMatters.MOD_ID) private val types = MDeferredRegister(ForgeRegistries.RECIPE_TYPES, OverdriveThatMatters.MOD_ID)
private val serializers = DeferredRegister.create(ForgeRegistries.RECIPE_SERIALIZERS, OverdriveThatMatters.MOD_ID) private val serializers = MDeferredRegister(ForgeRegistries.RECIPE_SERIALIZERS, OverdriveThatMatters.MOD_ID)
internal fun register(bus: IEventBus) { internal fun register(bus: IEventBus) {
types.register(bus) types.register(bus)
serializers.register(bus) serializers.register(bus)
} }
private fun <T : Recipe<*>> register(name: String): RegistryObject<Type<T>> { private fun <T : Recipe<*>> register(name: String): MDeferredRegister<*>.Entry<Type<T>> {
return types.register(name) { Type(name) } return types.register(name) { Type(name) }
} }

View File

@ -119,11 +119,11 @@ object MRegistry : IBlockItemRegistryAcceptor {
private val decorativeBlocks = ArrayList<IBlockItemRegistryAcceptor>() private val decorativeBlocks = ArrayList<IBlockItemRegistryAcceptor>()
override fun registerItems(registry: DeferredRegister<Item>) { override fun registerItems(registry: MDeferredRegister<Item>) {
decorativeBlocks.forEach { it.registerItems(registry) } decorativeBlocks.forEach { it.registerItems(registry) }
} }
override fun registerBlocks(registry: DeferredRegister<Block>) { override fun registerBlocks(registry: MDeferredRegister<Block>) {
decorativeBlocks.forEach { it.registerBlocks(registry) } decorativeBlocks.forEach { it.registerBlocks(registry) }
} }

View File

@ -11,19 +11,19 @@ import net.minecraftforge.registries.ForgeRegistries
import ru.dbotthepony.mc.otm.OverdriveThatMatters import ru.dbotthepony.mc.otm.OverdriveThatMatters
object MSoundEvents { object MSoundEvents {
private val registry: DeferredRegister<SoundEvent> = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, OverdriveThatMatters.MOD_ID) private val registry: MDeferredRegister<SoundEvent> = MDeferredRegister(ForgeRegistries.SOUND_EVENTS, OverdriveThatMatters.MOD_ID)
// TODO: 1.19.3 // TODO: 1.19.3
private fun make(name: String) = registry.register(name) { SoundEvent.createVariableRangeEvent(ResourceLocation(OverdriveThatMatters.MOD_ID, name)) } private fun make(name: String): MDeferredRegister<SoundEvent>.Entry<SoundEvent> = registry.register(name) { SoundEvent.createVariableRangeEvent(ResourceLocation(OverdriveThatMatters.MOD_ID, name)) }
val RIFLE_SHOT: SoundEvent by make("item.rifle_shot") val RIFLE_SHOT by make("item.rifle_shot")
val PLASMA_WEAPON_OVERHEAT: SoundEvent by make("item.plasma_weapon_overheat") val PLASMA_WEAPON_OVERHEAT by make("item.plasma_weapon_overheat")
val PLAYER_BECOME_ANDROID: SoundEvent by make("player_become_android") val PLAYER_BECOME_ANDROID by make("player_become_android")
val CARGO_CRATE_OPEN: SoundEvent by make("cargo_crate_open") val CARGO_CRATE_OPEN by make("cargo_crate_open")
val ANDROID_JUMP_BOOST: SoundEvent by make("android.jump_boost") val ANDROID_JUMP_BOOST by make("android.jump_boost")
val ANDROID_SHOCKWAVE: SoundEvent by make("android.shockwave") val ANDROID_SHOCKWAVE by make("android.shockwave")
val ANDROID_PROJ_PARRY: SoundEvent by make("android.projectile_parry") val ANDROID_PROJ_PARRY by make("android.projectile_parry")
internal fun register(bus: IEventBus) { internal fun register(bus: IEventBus) {
registry.register(bus) registry.register(bus)

View File

@ -8,8 +8,10 @@ import net.minecraft.world.level.block.state.BlockBehaviour
import net.minecraftforge.registries.DeferredRegister import net.minecraftforge.registries.DeferredRegister
import net.minecraftforge.registries.RegistryObject import net.minecraftforge.registries.RegistryObject
import ru.dbotthepony.mc.otm.core.collect.SupplierMap import ru.dbotthepony.mc.otm.core.collect.SupplierMap
import ru.dbotthepony.mc.otm.registry.MDeferredRegister
import ru.dbotthepony.mc.otm.registry.MRegistry import ru.dbotthepony.mc.otm.registry.MRegistry
import java.util.EnumMap import java.util.EnumMap
import java.util.function.Supplier
/** /**
* Colored only * Colored only
@ -25,8 +27,8 @@ open class ColoredDecorativeBlock(
var registeredBlocks = false var registeredBlocks = false
private set private set
protected val itemMap = EnumMap<DyeColor, RegistryObject<Item>>(DyeColor::class.java) protected val itemMap = EnumMap<DyeColor, Supplier<Item>>(DyeColor::class.java)
protected val blockMap = EnumMap<DyeColor, RegistryObject<Block>>(DyeColor::class.java) protected val blockMap = EnumMap<DyeColor, Supplier<Block>>(DyeColor::class.java)
fun forEachItem(consumer: (String, DyeColor, Item) -> Unit) { fun forEachItem(consumer: (String, DyeColor, Item) -> Unit) {
MRegistry.DYE_ORDER.forEach { MRegistry.DYE_ORDER.forEach {
@ -60,7 +62,7 @@ open class ColoredDecorativeBlock(
SupplierMap(MRegistry.DYE_ORDER.map { it to itemMap[it]!! }) SupplierMap(MRegistry.DYE_ORDER.map { it to itemMap[it]!! })
} }
override fun registerBlocks(registry: DeferredRegister<Block>) { override fun registerBlocks(registry: MDeferredRegister<Block>) {
check(blockMap.isEmpty()) { "( ͡° ͜ʖ ͡°) No. \\(• ε •)/ ( ͠° ل͜ ͡°) ( ͠° ͟ ͟ʖ ͡°) (ง ͠° ͟ل͜ ͡°)ง ( ͡°︺͡°) ('ω')" } check(blockMap.isEmpty()) { "( ͡° ͜ʖ ͡°) No. \\(• ε •)/ ( ͠° ل͜ ͡°) ( ͠° ͟ ͟ʖ ͡°) (ง ͠° ͟ل͜ ͡°)ง ( ͡°︺͡°) ('ω')" }
MRegistry.DYE_ORDER.forEach { MRegistry.DYE_ORDER.forEach {
@ -72,7 +74,7 @@ open class ColoredDecorativeBlock(
private val properties = Item.Properties().stacksTo(64) private val properties = Item.Properties().stacksTo(64)
override fun registerItems(registry: DeferredRegister<Item>) { override fun registerItems(registry: MDeferredRegister<Item>) {
check(itemMap.isEmpty()) { "( ͡° ͜ʖ ͡°) No. \\(• ε •)/ ( ͠° ل͜ ͡°) ( ͠° ͟ ͟ʖ ͡°) (ง ͠° ͟ل͜ ͡°)ง ( ͡°︺͡°) ('ω')" } check(itemMap.isEmpty()) { "( ͡° ͜ʖ ͡°) No. \\(• ε •)/ ( ͠° ل͜ ͡°) ( ͠° ͟ ͟ʖ ͡°) (ง ͠° ͟ل͜ ͡°)ง ( ͡°︺͡°) ('ω')" }
check(registeredBlocks) { "wtffffff???????????" } check(registeredBlocks) { "wtffffff???????????" }

View File

@ -11,17 +11,16 @@ import net.minecraft.world.level.block.state.BlockBehaviour
import net.minecraft.world.level.block.state.BlockState import net.minecraft.world.level.block.state.BlockState
import net.minecraft.world.phys.shapes.CollisionContext import net.minecraft.world.phys.shapes.CollisionContext
import net.minecraft.world.phys.shapes.VoxelShape 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.RotatableMatteryBlock
import ru.dbotthepony.mc.otm.block.getShapeForEachState import ru.dbotthepony.mc.otm.block.getShapeForEachState
import ru.dbotthepony.mc.otm.core.collect.SupplierMap import ru.dbotthepony.mc.otm.core.collect.SupplierMap
import ru.dbotthepony.mc.otm.core.get import ru.dbotthepony.mc.otm.core.get
import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom import ru.dbotthepony.mc.otm.core.math.BlockRotationFreedom
import ru.dbotthepony.mc.otm.core.util.WriteOnce 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.registry.MRegistry
import ru.dbotthepony.mc.otm.shapes.BlockShape import ru.dbotthepony.mc.otm.shapes.BlockShape
import ru.dbotthepony.mc.otm.shapes.BlockShapes import java.util.function.Supplier
import java.util.stream.Stream import java.util.stream.Stream
/** /**
@ -31,8 +30,8 @@ class DecorativeBlock(
baseName: String, baseName: String,
private val provider: (DyeColor?) -> Block, private val provider: (DyeColor?) -> Block,
) : ColoredDecorativeBlock(baseName, provider) { ) : ColoredDecorativeBlock(baseName, provider) {
private var _block: RegistryObject<Block> by WriteOnce() private var _block: Supplier<Block> by WriteOnce()
private var _item: RegistryObject<Item> by WriteOnce() private var _item: Supplier<Item> by WriteOnce()
val block: Block get() = _block.get() val block: Block get() = _block.get()
val item: Item get() = _item.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))) SupplierMap(Streams.concat(MRegistry.DYE_ORDER.stream().map { it to itemMap[it]!! }, Stream.of(null to _item)))
} }
override fun registerBlocks(registry: DeferredRegister<Block>) { override fun registerBlocks(registry: MDeferredRegister<Block>) {
_block = registry.register(baseName) { provider.invoke(null) } _block = registry.register(baseName) { provider.invoke(null) }
super.registerBlocks(registry) super.registerBlocks(registry)
} }
override fun registerItems(registry: DeferredRegister<Item>) { override fun registerItems(registry: MDeferredRegister<Item>) {
_item = registry.register(baseName) { BlockItem(_block.get(), Item.Properties().stacksTo(64)) } _item = registry.register(baseName) { BlockItem(_block.get(), Item.Properties().stacksTo(64)) }
super.registerItems(registry) super.registerItems(registry)
} }

View File

@ -2,9 +2,9 @@ package ru.dbotthepony.mc.otm.registry.objects
import net.minecraft.world.item.Item import net.minecraft.world.item.Item
import net.minecraft.world.level.block.Block import net.minecraft.world.level.block.Block
import net.minecraftforge.registries.DeferredRegister import ru.dbotthepony.mc.otm.registry.MDeferredRegister
interface IBlockItemRegistryAcceptor { interface IBlockItemRegistryAcceptor {
fun registerItems(registry: DeferredRegister<Item>) fun registerItems(registry: MDeferredRegister<Item>)
fun registerBlocks(registry: DeferredRegister<Block>) fun registerBlocks(registry: MDeferredRegister<Block>)
} }

View File

@ -10,6 +10,7 @@ import net.minecraftforge.registries.DeferredRegister
import net.minecraftforge.registries.RegistryObject import net.minecraftforge.registries.RegistryObject
import ru.dbotthepony.mc.otm.core.collect.SupplierList import ru.dbotthepony.mc.otm.core.collect.SupplierList
import ru.dbotthepony.mc.otm.core.collect.SupplierMap import ru.dbotthepony.mc.otm.core.collect.SupplierMap
import ru.dbotthepony.mc.otm.registry.MDeferredRegister
import java.util.EnumMap import java.util.EnumMap
import java.util.function.Supplier import java.util.function.Supplier
@ -21,8 +22,8 @@ class StripedColoredDecorativeBlock(
BlockItem(block, Item.Properties().stacksTo(64)) BlockItem(block, Item.Properties().stacksTo(64))
} }
) : IBlockItemRegistryAcceptor { ) : IBlockItemRegistryAcceptor {
private val mapBlocks = EnumMap<DyeColor, EnumMap<DyeColor, RegistryObject<Block>>>(DyeColor::class.java) private val mapBlocks = EnumMap<DyeColor, EnumMap<DyeColor, Supplier<Block>>>(DyeColor::class.java)
private val mapItems = EnumMap<DyeColor, EnumMap<DyeColor, RegistryObject<Item>>>(DyeColor::class.java) private val mapItems = EnumMap<DyeColor, EnumMap<DyeColor, Supplier<Item>>>(DyeColor::class.java)
fun getBlockNullable(base: DyeColor, stripe: DyeColor): Block? { fun getBlockNullable(base: DyeColor, stripe: DyeColor): Block? {
check(registeredBlocks) { "Didn't register items yet" } check(registeredBlocks) { "Didn't register items yet" }
@ -82,7 +83,7 @@ class StripedColoredDecorativeBlock(
SupplierList(mapBlocks.flatMap { it.value.values }) SupplierList(mapBlocks.flatMap { it.value.values })
} }
override fun registerItems(registry: DeferredRegister<Item>) { override fun registerItems(registry: MDeferredRegister<Item>) {
for (base in DyeColor.entries) { for (base in DyeColor.entries) {
for (stripe in DyeColor.entries) { for (stripe in DyeColor.entries) {
if (base == stripe) { if (base == stripe) {
@ -97,7 +98,7 @@ class StripedColoredDecorativeBlock(
registeredItems = true registeredItems = true
} }
override fun registerBlocks(registry: DeferredRegister<Block>) { override fun registerBlocks(registry: MDeferredRegister<Block>) {
for (base in DyeColor.entries) { for (base in DyeColor.entries) {
for (stripe in DyeColor.entries) { for (stripe in DyeColor.entries) {
if (base == stripe) { if (base == stripe) {

View File

@ -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
}
}
}

View File

@ -1,7 +1,7 @@
{ {
"credit": "Made with Blockbench", "credit": "Made with Blockbench",
"parent": "block/cube_all", "parent": "block/cube_all",
"render_type": "translucent", "render_type": "cutout",
"textures": { "textures": {
"0": "overdrive_that_matters:block/holo_sign", "0": "overdrive_that_matters:block/holo_sign",
"particle": "overdrive_that_matters:block/holo_sign" "particle": "overdrive_that_matters:block/holo_sign"

View File

@ -1,22 +1,23 @@
{ {
"credit": "Made with Blockbench",
"parent": "block/block", "parent": "block/block",
"texture_size": [32, 32], "texture_size": [32, 32],
"textures": { "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 ], "from": [0, 0, 10],
"to": [ 16, 16, 6 ], "to": [16, 16, 16],
"faces": { "faces": {
"down": {"uv": [ 8, 0, 16, 3 ], "texture": "#texture" }, "north": {"uv": [0, 0, 8, 8], "texture": "#texture"},
"up": {"uv": [ 8, 0, 16, 3 ], "rotation": 180, "texture": "#texture" }, "east": {"uv": [8, 0, 16, 3], "rotation": 90, "texture": "#texture"},
"north": {"uv": [ 0, 8, 8, 16 ], "texture": "#texture" }, "south": {"uv": [0, 8, 8, 16], "texture": "#texture"},
"south": {"uv": [ 0, 0, 8, 8 ], "texture": "#texture" }, "west": {"uv": [8, 0, 16, 3], "rotation": 270, "texture": "#texture"},
"west": {"uv": [ 8, 0, 16, 3 ], "rotation": 90, "texture": "#texture" }, "up": {"uv": [8, 0, 16, 3], "texture": "#texture"},
"east": {"uv": [ 8, 0, 16, 3 ], "rotation": 270, "texture": "#texture" } "down": {"uv": [8, 0, 16, 3], "rotation": 180, "texture": "#texture"}
} }
} }
] ]
} }

View File

@ -1,7 +1,7 @@
{ {
"credit": "Made with Blockbench", "credit": "Made with Blockbench",
"parent": "block/block", "parent": "block/block",
"render_type": "translucent", "render_type": "cutout",
"texture_size": [32, 32], "texture_size": [32, 32],
"textures": { "textures": {
"1": "overdrive_that_matters:block/matter_replicator_base", "1": "overdrive_that_matters:block/matter_replicator_base",

View File

@ -1,3 +0,0 @@
{
"parent": "overdrive_that_matters:block/drive_viewer_idle"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 702 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 607 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 580 B

After

Width:  |  Height:  |  Size: 580 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 956 B

After

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 635 B

Some files were not shown because too many files have changed in this diff Show More