More backporting

This commit is contained in:
DBotThePony 2024-01-02 01:03:09 +07:00
parent 11e66d50a4
commit 1fa988e5fd
Signed by: DBot
GPG Key ID: DCC23B5715498507
12 changed files with 134 additions and 144 deletions

View File

@ -11,7 +11,7 @@ fun SoundDefinition.subtitle(value: SoundEvent): SoundDefinition {
return subtitle("otm.sound." + value.location.path)
}
class SoundDataProvider(event: GatherDataEvent) : SoundDefinitionsProvider(event.generator.packOutput, DataGen.MOD_ID, event.existingFileHelper) {
class SoundDataProvider(event: GatherDataEvent) : SoundDefinitionsProvider(event.generator, DataGen.MOD_ID, event.existingFileHelper) {
override fun registerSounds() {
add(MSoundEvents.PLASMA_WEAPON_OVERHEAT,
definition().subtitle("otm.sound.plasma_weapon_overheat")

View File

@ -46,7 +46,7 @@ private fun initialTransform(it: BlockState, modelPath: String, builder: Configu
return modelPath
}
class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(event.generator.packOutput, DataGen.MOD_ID, event.existingFileHelper) {
class MatteryBlockStateProvider(event: GatherDataEvent) : BlockStateProvider(event.generator, DataGen.MOD_ID, event.existingFileHelper) {
private val callbacks = LinkedList<() -> Unit>()
fun exec(lambda: () -> Unit): MatteryBlockStateProvider {

View File

@ -14,7 +14,7 @@ import ru.dbotthepony.mc.otm.datagen.DataGen
import ru.dbotthepony.mc.otm.datagen.modLocation
import java.util.LinkedList
class MatteryItemModelProvider(event: GatherDataEvent) : ItemModelProvider(event.generator.packOutput, DataGen.MOD_ID, event.existingFileHelper) {
class MatteryItemModelProvider(event: GatherDataEvent) : ItemModelProvider(event.generator, DataGen.MOD_ID, event.existingFileHelper) {
private val callbacks = LinkedList<() -> Unit>()
fun exec(func: () -> Unit): MatteryItemModelProvider {

View File

@ -39,7 +39,7 @@ private fun researchString(key: AndroidResearchType): String {
}
class MatteryLanguageProvider(private val gen: DataGenerator) {
private inner class Slave(language: String) : LanguageProvider(gen.packOutput, OverdriveThatMatters.MOD_ID, language) {
private inner class Slave(language: String) : LanguageProvider(gen, OverdriveThatMatters.MOD_ID, language) {
override fun addTranslations() {}
}

View File

@ -1,6 +1,5 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.SimpleCookingRecipeBuilder
import net.minecraft.util.valueproviders.ConstantFloat
import net.minecraft.world.item.Item
@ -16,22 +15,22 @@ private fun RecipeOutput.addRecyclingRecipe(inputs: Collection<ItemLike>, result
SimpleCookingRecipeBuilder.smelting(
Ingredient.of(inputStacks.stream()),
RecipeCategory.MISC, result, 0f, 200
result, 0f, 200
).also { r -> inputs.forEach { r.unlockedBy(it) } }.save(this, modLocation("smelting/${name}"))
SimpleCookingRecipeBuilder.blasting(
Ingredient.of(inputStacks.stream()),
RecipeCategory.MISC, result, 0f, 100
result, 0f, 100
).also { r -> inputs.forEach { r.unlockedBy(it) } }.save(this, modLocation("blasting/${name}"))
}
fun addBlastingRecipes(consumer: RecipeOutput) {
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItems.MIRROR_COMPOUND), RecipeCategory.MISC, MItems.MIRROR, 0.1f, 100).unlockedBy(
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItems.MIRROR_COMPOUND), MItems.MIRROR, 0.1f, 100).unlockedBy(
MItems.MIRROR_COMPOUND).save(consumer)
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_PLATES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 100).unlockedBy(
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_PLATES), MItems.TRITANIUM_INGOT, 0f, 100).unlockedBy(
MItemTags.TRITANIUM_PLATES).save(consumer, modLocation("tritanium_ingot_from_plates"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_PLATES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 50).unlockedBy(
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_PLATES), MItems.TRITANIUM_INGOT, 0f, 50).unlockedBy(
MItemTags.TRITANIUM_PLATES).save(consumer, modLocation("tritanium_ingot_from_plates_blasting"))
consumer.addRecyclingRecipe(MItems.TRITANIUM_TOOLS, MItems.TRITANIUM_NUGGET, "tritanium_nugget_from_tools")
@ -39,14 +38,14 @@ fun addBlastingRecipes(consumer: RecipeOutput) {
}
fun addOreSmeltingRecipes(consumer: RecipeOutput) {
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_ORES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 200).unlockedBy(MItemTags.TRITANIUM_ORES).save(consumer, modLocation("smelting/tritanium_ingot_from_ore_block"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_ORES), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 100).unlockedBy(MItemTags.TRITANIUM_ORES).save(consumer, modLocation("blasting/tritanium_ingot_from_ore_block"))
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_ORES), MItems.TRITANIUM_INGOT, 1f, 200).unlockedBy(MItemTags.TRITANIUM_ORES).save(consumer, modLocation("smelting/tritanium_ingot_from_ore_block"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_ORES), MItems.TRITANIUM_INGOT, 1f, 100).unlockedBy(MItemTags.TRITANIUM_ORES).save(consumer, modLocation("blasting/tritanium_ingot_from_ore_block"))
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_ORE_CLUMPS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 200).unlockedBy(MItemTags.TRITANIUM_ORE_CLUMPS).save(consumer, modLocation("smelting/tritanium_ingot_from_raw_ore"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_ORE_CLUMPS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1f, 100).unlockedBy(MItemTags.TRITANIUM_ORE_CLUMPS).save(consumer, modLocation("blasting/tritanium_ingot_from_raw_ore"))
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_ORE_CLUMPS), MItems.TRITANIUM_INGOT, 1f, 200).unlockedBy(MItemTags.TRITANIUM_ORE_CLUMPS).save(consumer, modLocation("smelting/tritanium_ingot_from_raw_ore"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_ORE_CLUMPS), MItems.TRITANIUM_INGOT, 1f, 100).unlockedBy(MItemTags.TRITANIUM_ORE_CLUMPS).save(consumer, modLocation("blasting/tritanium_ingot_from_raw_ore"))
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_DUSTS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 200).unlockedBy(MItemTags.TRITANIUM_DUSTS).save(consumer, modLocation("smelting/tritanium_ingot_from_dust"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_DUSTS), RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 0f, 100).unlockedBy(MItemTags.TRITANIUM_DUSTS).save(consumer, modLocation("blasting/tritanium_ingot_from_dust"))
SimpleCookingRecipeBuilder.smelting(Ingredient.of(MItemTags.TRITANIUM_DUSTS), MItems.TRITANIUM_INGOT, 0f, 200).unlockedBy(MItemTags.TRITANIUM_DUSTS).save(consumer, modLocation("smelting/tritanium_ingot_from_dust"))
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItemTags.TRITANIUM_DUSTS), MItems.TRITANIUM_INGOT, 0f, 100).unlockedBy(MItemTags.TRITANIUM_DUSTS).save(consumer, modLocation("blasting/tritanium_ingot_from_dust"))
}
fun addMicrowaveRecipes(provider: MatteryRecipeProvider) {

View File

@ -1,6 +1,5 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.ShapelessRecipeBuilder
import net.minecraft.tags.ItemTags
import net.minecraft.world.item.ItemStack
@ -18,43 +17,41 @@ import ru.dbotthepony.mc.otm.recipe.ExplosiveHammerPrimingRecipe
import ru.dbotthepony.mc.otm.recipe.UpgradeRecipe
fun addCraftingTableRecipes(consumer: RecipeOutput) {
val machinesCategory = RecipeCategory.DECORATIONS
MatteryRecipe(MRegistry.CARGO_CRATES.item, category = RecipeCategory.DECORATIONS)
MatteryRecipe(MRegistry.CARGO_CRATES.item)
.row(MItemTags.TRITANIUM_PLATES, multiIngredient(Tags.Items.CHESTS_WOODEN, Tags.Items.BARRELS_WOODEN), MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItemTags.TRITANIUM_PLATES)
.unlockedBy(Tags.Items.CHESTS)
.build(consumer)
for ((dye, crate) in MRegistry.CARGO_CRATES.blocks) {
ShapelessRecipeBuilder(RecipeCategory.DECORATIONS, crate, 1)
ShapelessRecipeBuilder(crate, 1)
.requires(Ingredient.of(MRegistry.CARGO_CRATES.allItems.entries.stream().filter { it.key != dye }.map { ItemStack(it.value) }))
.requires(dye.tag)
.unlockedBy(MRegistry.CARGO_CRATES.allItems.entries.stream().filter { it.key != dye }.map { it.value })
.save(consumer, "${crate.registryName}_alt")
}
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MItems.TRITANIUM_INGOT_BLOCK, 1)
ShapelessRecipeBuilder(MItems.TRITANIUM_INGOT_BLOCK, 1)
.requires(Ingredient.of(MItemTags.TRITANIUM_INGOTS), 9)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 9)
ShapelessRecipeBuilder(MItems.TRITANIUM_INGOT, 9)
.requires(Ingredient.of(MItemTags.TRITANIUM_INGOTS_STORAGE))
.unlockedBy(MItemTags.TRITANIUM_INGOTS_STORAGE)
.save(consumer, modLocation("tritanium_ingot_from_storage"))
ShapelessRecipeBuilder(machinesCategory, MItems.ENERGY_COUNTER, 1)
ShapelessRecipeBuilder(MItems.ENERGY_COUNTER, 1)
.requires(MItems.ENERGY_COUNTER)
.unlockedBy(MItems.ENERGY_COUNTER)
.save(consumer, modLocation("energy_counter_reset"))
ShapelessRecipeBuilder(machinesCategory, MItems.HOLO_SIGN, 1)
ShapelessRecipeBuilder(MItems.HOLO_SIGN, 1)
.requires(MItems.HOLO_SIGN)
.unlockedBy(MItems.HOLO_SIGN)
.save(consumer, modLocation("holo_sign_reset"))
MatteryRecipe(MBlocks.PLATE_PRESS, category = machinesCategory)
MatteryRecipe(MBlocks.PLATE_PRESS)
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS)
.row(MItemTags.TRITANIUM_INGOTS, Items.BLAST_FURNACE, MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.PISTONS, MItemTags.TRITANIUM_INGOTS, MItemTags.PISTONS)
@ -62,14 +59,14 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.unlockedBy(MItems.ELECTRIC_PARTS)
.build(consumer)
MatteryRecipe(MBlocks.PLATE_PRESS, category = machinesCategory)
MatteryRecipe(MBlocks.PLATE_PRESS)
.rowB(MItemTags.PISTONS)
.rowB(MItems.MACHINE_FRAME)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItems.ELECTRIC_PARTS)
.build(consumer, "advanced")
MatteryRecipe(MBlocks.TWIN_PLATE_PRESS, category = machinesCategory)
MatteryRecipe(MBlocks.TWIN_PLATE_PRESS)
.setUpgradeSource(MItems.PLATE_PRESS)
.addUpgradeOps(UpgradeRecipe.Direct("BlockEntityTag"))
.rowB(MItemTags.PISTONS)
@ -78,7 +75,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.unlockedBy(MItems.PLATE_PRESS)
.build(consumer)
MatteryRecipe(MItems.PATTERN_DRIVE_NORMAL, category = machinesCategory)
MatteryRecipe(MItems.PATTERN_DRIVE_NORMAL)
.rowAC(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
.row(MItemTags.ADVANCED_CIRCUIT, MItemTags.TRITANIUM_PLATES, MItemTags.ADVANCED_CIRCUIT)
.rowAC(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
@ -86,7 +83,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.build(consumer)
// Машины
MatteryRecipe(MItems.MATTER_RECYCLER, category = machinesCategory)
MatteryRecipe(MItems.MATTER_RECYCLER)
.row(MItems.MATTER_CAPACITOR_PARTS, Items.HOPPER, MItemTags.BASIC_CIRCUIT)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItems.MATTER_CABLE, MItems.MATTER_IO_PORT, MItems.MATTER_CABLE)
@ -94,21 +91,21 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.build(consumer)
// Блоки
MatteryRecipe(MItems.MATTER_CAPACITOR_BANK, category = machinesCategory)
MatteryRecipe(MItems.MATTER_CAPACITOR_BANK)
.row(Tags.Items.GLASS, MItemTags.IRON_PLATES, Tags.Items.GLASS)
.row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES)
.row(MItems.MATTER_CABLE, MItems.MATTER_IO_PORT, MItems.MATTER_CABLE)
.unlockedBy(MItems.MATTER_CABLE)
.build(consumer)
MatteryRecipe(MItems.BATTERY_BANK, category = machinesCategory)
MatteryRecipe(MItems.BATTERY_BANK)
.row(Tags.Items.GLASS, MItemTags.IRON_PLATES, Tags.Items.GLASS)
.row(MItemTags.IRON_PLATES, MItems.MACHINE_FRAME, MItemTags.IRON_PLATES)
.row(MItems.ELECTRIC_PARTS, MItems.ENERGY_BUS, MItems.ELECTRIC_PARTS)
.unlockedBy(MItems.ENERGY_BUS)
.build(consumer)
MatteryRecipe(MItems.GRAVITATION_STABILIZER, category = machinesCategory)
MatteryRecipe(MItems.GRAVITATION_STABILIZER)
.row(MItemTags.ADVANCED_CIRCUIT, MItems.GRAVITATION_FIELD_SENSOR, MItemTags.ADVANCED_CIRCUIT)
.row(MItems.MATTER_TRANSFORM_MATRIX, MItems.MACHINE_FRAME, MItems.MATTER_TRANSFORM_MATRIX)
.row(MItemTags.TRITANIUM_PLATES, MItems.GRAVITATION_FIELD_LIMITER, MItemTags.TRITANIUM_PLATES)
@ -116,7 +113,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.unlockedBy(MItems.GRAVITATION_FIELD_SENSOR)
.build(consumer)
MatteryRecipe(MItems.PORTABLE_GRAVITATION_STABILIZER, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.PORTABLE_GRAVITATION_STABILIZER)
.rowB(MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItems.GRAVITATION_FIELD_SENSOR, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItems.GRAVITATION_FIELD_LIMITER, MItemTags.TRITANIUM_PLATES)
@ -124,87 +121,87 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.unlockedBy(MItems.GRAVITATION_FIELD_SENSOR)
.build(consumer)
MatteryRecipe(MItems.GRAVITATION_FIELD_SENSOR, category = RecipeCategory.MISC)
MatteryRecipe(MItems.GRAVITATION_FIELD_SENSOR)
.rowB(MItemTags.BASIC_CIRCUIT)
.row(MItemTags.TRITANIUM_PLATES, MItems.ELECTROMAGNET, MItemTags.TRITANIUM_PLATES)
.rowB(MItemTags.IRON_PLATES)
.unlockedBy(MItems.ELECTROMAGNET)
.build(consumer)
MatteryRecipe(MItems.GRAVITATION_FIELD_LIMITER, category = RecipeCategory.MISC)
MatteryRecipe(MItems.GRAVITATION_FIELD_LIMITER)
.row(Tags.Items.ENDER_PEARLS, MItemTags.ADVANCED_CIRCUIT, Tags.Items.ENDER_PEARLS)
.row(MItemTags.GOLD_WIRES, MItems.QUANTUM_TRANSCEIVER, MItemTags.GOLD_WIRES)
.rowB(MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.QUANTUM_TRANSCEIVER)
.build(consumer)
MatteryRecipe(MItems.BLACK_HOLE_SCANNER, category = RecipeCategory.TOOLS)
MatteryRecipe(MItems.BLACK_HOLE_SCANNER)
.row(MItemTags.IRON_PLATES, Tags.Items.GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES)
.row(MItemTags.GOLD_WIRES, MItems.GRAVITATION_FIELD_SENSOR, MItemTags.ADVANCED_CIRCUIT)
.rowAC(Tags.Items.DUSTS_GLOWSTONE, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.GRAVITATION_FIELD_SENSOR)
.build(consumer)
MatteryRecipe(MItems.PHANTOM_ATTRACTOR, category = machinesCategory)
MatteryRecipe(MItems.PHANTOM_ATTRACTOR)
.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.GLASS_COLORLESS, Tags.Items.DUSTS_REDSTONE)
.row(MItemTags.TRITANIUM_PLATES, MItems.QUANTUM_TRANSCEIVER, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, ItemTags.BEDS, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.QUANTUM_TRANSCEIVER)
.build(consumer)
MatteryRecipe(MItems.QUANTUM_TRANSCEIVER, 2, category = RecipeCategory.MISC)
MatteryRecipe(MItems.QUANTUM_TRANSCEIVER, 2)
.rowAC(MItemTags.COPPER_WIRES, MItemTags.COPPER_WIRES)
.row(MItemTags.GOLD_WIRES, Tags.Items.ENDER_PEARLS, MItemTags.GOLD_WIRES)
.row(MItemTags.GOLD_WIRES, MItems.ELECTROMAGNET, MItemTags.GOLD_WIRES)
.unlockedBy(Tags.Items.ENDER_PEARLS)
.build(consumer)
MatteryRecipe(MItems.ELECTROMAGNET, category = RecipeCategory.MISC)
MatteryRecipe(MItems.ELECTROMAGNET)
.row(MItemTags.COPPER_WIRES, Tags.Items.INGOTS_IRON, MItemTags.COPPER_WIRES)
.unlockedBy(Tags.Items.INGOTS_IRON)
.build(consumer)
MatteryRecipe(MItems.ELECTROMOTOR, category = RecipeCategory.MISC)
MatteryRecipe(MItems.ELECTROMOTOR)
.rowB(MItems.ELECTROMAGNET)
.row(MItems.ELECTROMAGNET, Tags.Items.INGOTS_IRON, MItems.ELECTROMAGNET)
.row(MItemTags.COPPER_WIRES, Tags.Items.INGOTS_IRON, MItemTags.COPPER_WIRES)
.unlockedBy(MItems.ELECTROMAGNET)
.build(consumer)
MatteryRecipe(MItems.ENERGY_SERVO, category = RecipeCategory.MISC)
MatteryRecipe(MItems.ENERGY_SERVO)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItems.ENERGY_BUS, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItems.ENERGY_BUS)
.build(consumer)
MatteryRecipe(MItems.MIRROR_COMPOUND, 3, category = RecipeCategory.MISC)
MatteryRecipe(MItems.MIRROR_COMPOUND, 3)
.row(Tags.Items.GLASS_PANES_COLORLESS, Tags.Items.GLASS_PANES_COLORLESS, Tags.Items.GLASS_PANES_COLORLESS)
.row(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES, MItemTags.IRON_PLATES)
.unlockedBy(MItemTags.IRON_PLATES)
.unlockedBy(Tags.Items.GLASS_PANES_COLORLESS)
.build(consumer)
MatteryRecipe(MItems.REINFORCED_TRITANIUM_PLATE, category = RecipeCategory.MISC)
MatteryRecipe(MItems.REINFORCED_TRITANIUM_PLATE)
.rowB(MItemTags.CARBON_PLATES)
.row(MItemTags.CARBON_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.CARBON_PLATES)
.rowB(MItemTags.CARBON_PLATES)
.unlockedBy(MItemTags.TRITANIUM_PLATES)
.build(consumer)
MatteryRecipe(MItems.CARBON_FIBRE_BLOCK, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MItems.CARBON_FIBRE_BLOCK)
.rowAB(MItemTags.CARBON_PLATES, MItemTags.CARBON_PLATES)
.rowAB(MItemTags.CARBON_PLATES, MItemTags.CARBON_PLATES)
.unlockedBy(MItemTags.CARBON_PLATES)
.build(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.CARBON_MESH, 4)
ShapelessRecipeBuilder(MItems.CARBON_MESH, 4)
.requires(Ingredient.of(MItems.CARBON_FIBRE_BLOCK))
.unlockedBy(MItemTags.CARBON_PLATES)
.unlockedBy(MItems.CARBON_FIBRE_BLOCK)
.save(consumer, modLocation("carbon_mesh_from_block"))
// броня
MatteryRecipe(MItems.TRITANIUM_HELMET, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.TRITANIUM_HELMET)
.setUpgradeSource(Items.LEATHER_HELMET)
.addUpgradeOps(
UpgradeRecipe.Direct("display"),
@ -215,7 +212,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_PANTS, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.TRITANIUM_PANTS)
.setUpgradeSource(Items.LEATHER_LEGGINGS)
.addUpgradeOps(
UpgradeRecipe.Direct("display"),
@ -227,7 +224,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_CHESTPLATE, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.TRITANIUM_CHESTPLATE)
.setUpgradeSource(Items.LEATHER_CHESTPLATE)
.addUpgradeOps(
UpgradeRecipe.Direct("display"),
@ -239,7 +236,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.unlockedBy(MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_BOOTS, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.TRITANIUM_BOOTS)
.setUpgradeSource(Items.LEATHER_BOOTS)
.addUpgradeOps(
UpgradeRecipe.Direct("display"),
@ -251,86 +248,86 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.build(consumer)
// простая броня
MatteryRecipe(MItems.SIMPLE_TRITANIUM_HELMET, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.SIMPLE_TRITANIUM_HELMET)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.SIMPLE_TRITANIUM_PANTS, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.SIMPLE_TRITANIUM_PANTS)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.SIMPLE_TRITANIUM_CHESTPLATE, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.SIMPLE_TRITANIUM_CHESTPLATE)
.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.SIMPLE_TRITANIUM_BOOTS, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.SIMPLE_TRITANIUM_BOOTS)
.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
// простые батарейки
MatteryRecipe(MItems.BATTERY_CRUDE, category = RecipeCategory.MISC)
MatteryRecipe(MItems.BATTERY_CRUDE)
.rowB(Tags.Items.DUSTS_REDSTONE)
.rowB(Tags.Items.CROPS_POTATO)
.rowB(Tags.Items.INGOTS_IRON)
.build(consumer)
MatteryRecipe(MItems.BATTERY_BASIC, category = RecipeCategory.MISC)
MatteryRecipe(MItems.BATTERY_BASIC)
.rowAC(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
.rowB(MItems.ELECTRIC_PARTS)
.rowB(MItemTags.IRON_PLATES)
.build(consumer)
MatteryRecipe(MItems.BATTERY_NORMAL, category = RecipeCategory.MISC)
MatteryRecipe(MItems.BATTERY_NORMAL)
.rowB(MItems.ELECTRIC_PARTS)
.row(MItemTags.COPPER_WIRES, MItemTags.IRON_PLATES, MItemTags.COPPER_WIRES)
.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
.build(consumer)
MatteryRecipe(MItems.BATTERY_DENSE, category = RecipeCategory.MISC)
MatteryRecipe(MItems.BATTERY_DENSE)
.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
.row(MItemTags.GOLD_WIRES, MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
.row(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_REDSTONE)
.build(consumer)
MatteryRecipe(MItems.BATTERY_CAPACITOR, category = RecipeCategory.MISC)
MatteryRecipe(MItems.BATTERY_CAPACITOR)
.row(Tags.Items.DUSTS_REDSTONE, MItems.ENERGY_BUS, Tags.Items.DUSTS_REDSTONE)
.row(MItemTags.GOLD_WIRES, MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
.row(MItemTags.GOLD_WIRES, Tags.Items.DUSTS_REDSTONE, MItemTags.GOLD_WIRES)
.build(consumer)
// накопители материи
MatteryRecipe(MItems.MATTER_CAPACITOR_DENSE, category = RecipeCategory.MISC)
MatteryRecipe(MItems.MATTER_CAPACITOR_DENSE)
.row(MItems.MATTER_CAPACITOR_PARTS, Tags.Items.GLASS, MItems.MATTER_CAPACITOR_PARTS)
.row(MItemTags.TRITANIUM_PLATES, Tags.Items.ENDER_PEARLS, MItemTags.TRITANIUM_PLATES)
.rowAC(Tags.Items.GEMS_DIAMOND, Tags.Items.GEMS_DIAMOND)
.build(consumer)
// станция андроида
MatteryRecipe(MItems.ANDROID_STATION, category = machinesCategory)
MatteryRecipe(MItems.ANDROID_STATION)
.row(MItems.ELECTRIC_PARTS, MItemTags.ADVANCED_CIRCUIT, MItems.ELECTRIC_PARTS)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.TRITANIUM_PLATES, MItems.ELECTRIC_PARTS, MItemTags.TRITANIUM_PLATES)
.build(consumer)
// беспроводной зарядник андроидов
MatteryRecipe(MItems.ANDROID_CHARGER, category = machinesCategory)
MatteryRecipe(MItems.ANDROID_CHARGER)
.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)
.build(consumer)
// Энерго меч
MatteryRecipe(MItems.ENERGY_SWORD, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.ENERGY_SWORD)
.rowBC(MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
.rowBC(MItemTags.TRITANIUM_PLATES, MItemTags.GOLD_WIRES)
.row(MItems.BATTERY_CAPACITOR, MItems.TRITANIUM_SWORD, MItemTags.ADVANCED_CIRCUIT)
@ -338,69 +335,69 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.buildEnergetic(consumer)
// апгрейд на сетку крафта
MatteryRecipe(MItems.ExopackUpgrades.CRAFTING_UPGRADE, category = RecipeCategory.TOOLS)
MatteryRecipe(MItems.ExopackUpgrades.CRAFTING_UPGRADE)
.row(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
.row(MItemTags.CRAFTING_TABLES, MItems.QUANTUM_TRANSCEIVER, MItemTags.CRAFTING_TABLES)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES, MItemTags.TRITANIUM_PLATES)
.build(consumer)
// апгрейд на переплавку
MatteryRecipe(MItems.ExopackUpgrades.SMELTING_UPGRADE, category = RecipeCategory.TOOLS)
MatteryRecipe(MItems.ExopackUpgrades.SMELTING_UPGRADE)
.row(MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT, MItemTags.ADVANCED_CIRCUIT)
.row(Items.FURNACE, MItems.QUANTUM_TRANSCEIVER, Items.FURNACE)
.row(MItemTags.TRITANIUM_PLATES, Items.FURNACE, MItemTags.TRITANIUM_PLATES)
.build(consumer)
// апгрейд на эндер сундук
MatteryRecipe(MItems.ExopackUpgrades.ENDER_UPGRADE, category = RecipeCategory.TOOLS)
MatteryRecipe(MItems.ExopackUpgrades.ENDER_UPGRADE)
.row(MItemTags.ADVANCED_CIRCUIT, MItems.ELECTROMAGNET, MItemTags.ADVANCED_CIRCUIT)
.row(MItems.ELECTROMAGNET, Items.ENDER_CHEST, MItems.ELECTROMAGNET)
.row(MItemTags.TRITANIUM_PLATES, MItems.ELECTROMAGNET, MItemTags.TRITANIUM_PLATES)
.build(consumer)
// генератор коблы
MatteryRecipe(MItems.COBBLESTONE_GENERATOR, category = machinesCategory)
MatteryRecipe(MItems.COBBLESTONE_GENERATOR)
.row(MItemTags.HARDENED_GLASS_COLORLESS, MItems.TRITANIUM_PICKAXE, MItemTags.HARDENED_GLASS_COLORLESS)
.row(Items.LAVA_BUCKET, Items.HOPPER, Items.WATER_BUCKET)
.rowB(Tags.Items.CHESTS)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_SHEARS, category = RecipeCategory.TOOLS)
MatteryRecipe(MItems.TRITANIUM_SHEARS)
.rowB(MItemTags.TRITANIUM_INGOTS)
.rowA(MItemTags.TRITANIUM_INGOTS)
.build(consumer)
MatteryRecipe(MItems.TRITANIUM_SHIELD, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.TRITANIUM_SHIELD)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, Items.SHIELD, MItemTags.REINFORCED_TRITANIUM_PLATES)
.row(MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES, MItemTags.REINFORCED_TRITANIUM_PLATES)
.rowB(MItemTags.REINFORCED_TRITANIUM_PLATES)
.build(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_NUGGET, 9)
ShapelessRecipeBuilder(MItems.TRITANIUM_NUGGET, 9)
.requires(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.MISC, MItems.TRITANIUM_INGOT, 1)
ShapelessRecipeBuilder(MItems.TRITANIUM_INGOT, 1)
.requires(Ingredient.of(MItemTags.TRITANIUM_NUGGETS), 9)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
.save(consumer, modLocation("ingot_from_nuggets"))
MatteryRecipe(MItems.ESSENCE_STORAGE, category = machinesCategory)
MatteryRecipe(MItems.ESSENCE_STORAGE)
.row(MItems.MATTER_CAPACITOR_PARTS, Items.ENDER_EYE, MItemTags.ADVANCED_CIRCUIT)
.row(MItemTags.TRITANIUM_PLATES, MItems.MACHINE_FRAME, MItemTags.TRITANIUM_PLATES)
.row(MItemTags.GOLD_WIRES, MItemTags.HARDENED_GLASS, MItemTags.HARDENED_GLASS)
.build(consumer)
MatteryRecipe(MItems.ESSENCE_SERVO, category = RecipeCategory.TOOLS)
MatteryRecipe(MItems.ESSENCE_SERVO)
.row(MItemTags.TRITANIUM_PLATES, MItems.QUANTUM_TRANSCEIVER, MItemTags.TRITANIUM_PLATES)
.rowB(Tags.Items.RODS_WOODEN)
.rowB(Tags.Items.RODS_WOODEN)
.build(consumer)
MatteryRecipe(MItems.MATTER_RECONSTRUCTOR, category = machinesCategory)
MatteryRecipe(MItems.MATTER_RECONSTRUCTOR)
.setUpgradeSource(MItems.MATTER_REPLICATOR)
.addUpgradeOps(
UpgradeRecipe.Indirect("BlockEntityTag.${MatteryBlockEntity.ENERGY_KEY}", "BlockEntityTag.energy"),
@ -411,7 +408,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.row(MItems.ELECTROMAGNET, MItems.ELECTROMAGNET, MItems.ELECTROMAGNET)
.build(consumer)
MatteryRecipe(MItems.FLUID_CAPSULE, category = RecipeCategory.TOOLS, count = 8)
MatteryRecipe(MItems.FLUID_CAPSULE, count = 8)
.row(MItemTags.TRITANIUM_NUGGETS, MItemTags.TRITANIUM_NUGGETS, MItemTags.TRITANIUM_NUGGETS)
.rowB(MItemTags.HARDENED_GLASS_PANES)
.row(MItemTags.TRITANIUM_NUGGETS, MItemTags.TRITANIUM_NUGGETS, MItemTags.TRITANIUM_NUGGETS)
@ -419,7 +416,7 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
.unlockedBy(MItemTags.TRITANIUM_NUGGETS)
.build(consumer)
MatteryRecipe(MItems.FLUID_TANK, category = RecipeCategory.DECORATIONS)
MatteryRecipe(MItems.FLUID_TANK)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.HARDENED_GLASS_PANES, MItemTags.TRITANIUM_INGOTS)
.rowAC(MItemTags.HARDENED_GLASS_PANES, MItemTags.HARDENED_GLASS_PANES)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.HARDENED_GLASS_PANES, MItemTags.TRITANIUM_INGOTS)
@ -429,39 +426,39 @@ fun addCraftingTableRecipes(consumer: RecipeOutput) {
consumer.accept(ExplosiveHammerPrimingRecipe(Ingredient.of(Tags.Items.NUGGETS_IRON), modLocation("hammer_priming")).toFinished())
MatteryRecipe(MItems.EXPLOSIVE_HAMMER, category = RecipeCategory.COMBAT)
MatteryRecipe(MItems.EXPLOSIVE_HAMMER)
.rowB(Tags.Items.INGOTS_IRON)
.rowAB(Tags.Items.INGOTS_IRON, Tags.Items.RODS_WOODEN)
.rowB(Tags.Items.RODS_WOODEN)
.unlockedBy(Items.FLINT_AND_STEEL)
.build(consumer)
MatteryRecipe(MItems.POWERED_FURNACE, category = machinesCategory)
MatteryRecipe(MItems.POWERED_FURNACE)
.row(Items.FURNACE, MItems.MACHINE_FRAME, Items.FURNACE)
.unlockedBy(MItems.MACHINE_FRAME)
.build(consumer)
MatteryRecipe(MItems.POWERED_SMOKER, category = machinesCategory)
MatteryRecipe(MItems.POWERED_SMOKER)
.rowAC(Items.FURNACE, Items.FURNACE)
.row(MItems.ELECTROMAGNET, MItems.MACHINE_FRAME, MItems.ELECTROMAGNET)
.unlockedBy(MItems.MACHINE_FRAME)
.build(consumer)
MatteryRecipe(MItems.POWERED_BLAST_FURNACE, category = machinesCategory)
MatteryRecipe(MItems.POWERED_BLAST_FURNACE)
.row(MItems.ELECTROMAGNET, Items.FURNACE, MItems.ELECTROMAGNET)
.row(MItems.ELECTROMAGNET, MItems.MACHINE_FRAME, MItems.ELECTROMAGNET)
.row(MItems.ELECTROMAGNET, Items.FURNACE, MItems.ELECTROMAGNET)
.unlockedBy(MItems.MACHINE_FRAME)
.build(consumer)
MatteryRecipe(MItems.INFINITE_WATER_SOURCE, category = machinesCategory)
MatteryRecipe(MItems.INFINITE_WATER_SOURCE)
.row(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES, MItemTags.IRON_PLATES)
.rowAC(Items.WATER_BUCKET, Items.WATER_BUCKET)
.row(MItemTags.IRON_PLATES, MItemTags.IRON_PLATES, MItemTags.IRON_PLATES)
.unlockedBy(Items.WATER_BUCKET)
.build(consumer)
MatteryRecipe(MItems.PAINTER, category = machinesCategory)
MatteryRecipe(MItems.PAINTER)
.row(Tags.Items.RODS_WOODEN, Items.BUCKET, Items.BUCKET)
.row(MItemTags.IRON_PLATES, Items.BUCKET, MItemTags.IRON_PLATES)
.row(MItemTags.IRON_PLATES, MItemTags.CRAFTING_TABLES, MItemTags.IRON_PLATES)

View File

@ -13,10 +13,9 @@ import ru.dbotthepony.mc.otm.registry.MBlocks
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems
import ru.dbotthepony.mc.otm.registry.MRegistry
import java.util.function.Consumer
private fun stairs(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
MatteryRecipe(result, 4, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(result, 4)
.rowA(base)
.rowAB(base, base)
.row(base, base, base)
@ -25,14 +24,14 @@ private fun stairs(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
}
private fun slab(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
MatteryRecipe(result, 6, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(result, 6)
.row(base, base, base)
.unlockedBy(base)
.build(consumer, modLocation("decorative/slabs/${base.asItem().registryName!!.path}"))
}
private fun wall(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
MatteryRecipe(result, 6, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(result, 6)
.row(base, base, base)
.row(base, base, base)
.unlockedBy(base)
@ -41,7 +40,7 @@ private fun wall(base: ItemLike, result: ItemLike, consumer: RecipeOutput) {
private fun cut(base: ItemLike, result: ItemLike, amount: Int, consumer: RecipeOutput) {
SingleItemRecipeBuilder
.stonecutting(Ingredient.of(base), RecipeCategory.BUILDING_BLOCKS, result, amount)
.stonecutting(Ingredient.of(base), result, amount)
.unlockedBy(base)
.save(consumer, modLocation("stonecutting/${result.asItem().registryName!!.path}_from_${base.asItem().registryName!!.path}"))
}
@ -72,7 +71,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.build(consumer, modLocation("decorative/floor_tiles/unrefined/${color.name.lowercase()}"))
if (color != DyeColor.WHITE)
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, unrefinedItem, 8)
ShapelessRecipeBuilder(unrefinedItem, 8)
.requires(Ingredient.of(MRegistry.UNREFINED_FLOOR_TILES.getItem(DyeColor.WHITE)), 8)
.requires(color.tag)
.unlockedBy(MRegistry.UNREFINED_FLOOR_TILES.getItem(DyeColor.WHITE))
@ -82,7 +81,6 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
for ((color, refinedItem) in MRegistry.FLOOR_TILES.items) {
SimpleCookingRecipeBuilder.smelting(
Ingredient.of(MRegistry.UNREFINED_FLOOR_TILES.items[color]!!),
RecipeCategory.BUILDING_BLOCKS,
refinedItem,
0.15f,
100
@ -90,7 +88,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.save(consumer, modLocation("decorative/floor_tiles/refined/${color.name.lowercase()}"))
if (color != DyeColor.WHITE)
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, refinedItem, 8)
ShapelessRecipeBuilder(refinedItem, 8)
.requires(Ingredient.of(MRegistry.FLOOR_TILES.getItem(DyeColor.WHITE)), 8)
.requires(color.tag)
.unlockedBy(MRegistry.FLOOR_TILES.getItem(DyeColor.WHITE))
@ -124,7 +122,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
val original = MRegistry.TRITANIUM_BLOCK.items[base]!!
MatteryRecipe(item, 8, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(item, 8)
.row(original, original, original)
.row(original, stripe.tag, original)
.row(original, original, original)
@ -132,7 +130,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.build(consumer, modLocation("decorative/tritanium/striped/${base.name.lowercase()}_${stripe.name.lowercase()}"))
}
MatteryRecipe(MItems.DANGER_STRIPE_BLOCK, 24, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MItems.DANGER_STRIPE_BLOCK, 24)
.rowAB(Tags.Items.DYES_YELLOW, Tags.Items.INGOTS_IRON)
.row(Tags.Items.INGOTS_IRON, Tags.Items.COBBLESTONE, Tags.Items.INGOTS_IRON)
.rowBC(Tags.Items.INGOTS_IRON, Tags.Items.DYES_BLACK)
@ -140,13 +138,13 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.unlockedBy(Tags.Items.DYES_BLACK)
.build(consumer, modLocation("decorative/danger_stripe"))
MatteryRecipe(MItems.METAL_BEAM, 24, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MItems.METAL_BEAM, 24)
.rowB(Tags.Items.INGOTS_IRON)
.row(MItemTags.TRITANIUM_INGOTS, Tags.Items.COBBLESTONE, MItemTags.TRITANIUM_INGOTS)
.rowB(Tags.Items.INGOTS_IRON)
.build(consumer, modLocation("decorative/metal_beam"))
MatteryRecipe(MRegistry.VENT.item, 24, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MRegistry.VENT.item, 24)
.rowB(MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, Items.IRON_BARS, MItemTags.TRITANIUM_INGOTS)
.rowB(MItemTags.TRITANIUM_INGOTS)
@ -154,7 +152,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.build(consumer, modLocation("decorative/vent/default"))
for ((color, item) in MRegistry.VENT.items) {
MatteryRecipe(item, 8, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(item, 8)
.row(MRegistry.VENT.item, MRegistry.VENT.item, MRegistry.VENT.item)
.row(MRegistry.VENT.item, color.tag, MRegistry.VENT.item)
.row(MRegistry.VENT.item, MRegistry.VENT.item, MRegistry.VENT.item)
@ -166,16 +164,16 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
for ((color, item) in MRegistry.VENT_ALTERNATIVE.allItems) {
val other = MRegistry.VENT.allItems[color]!!
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, item, 1).requires(other)
ShapelessRecipeBuilder(item, 1).requires(other)
.unlockedBy(item)
.save(consumer, modLocation("decorative/vent/to_alt/${color?.name?.lowercase() ?: "default"}"))
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, other, 1).requires(item)
ShapelessRecipeBuilder(other, 1).requires(item)
.unlockedBy(other)
.save(consumer, modLocation("decorative/vent/from_alt/${color?.name?.lowercase() ?: "default"}"))
}
MatteryRecipe(MRegistry.DECORATIVE_CRATE.item, 24, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MRegistry.DECORATIVE_CRATE.item, 24)
.rowB(Tags.Items.INGOTS_IRON)
.row(Tags.Items.INGOTS_IRON, Tags.Items.COBBLESTONE, Tags.Items.INGOTS_IRON)
.rowB(Tags.Items.INGOTS_IRON)
@ -183,7 +181,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.build(consumer, modLocation("decorative/crate/rusty"))
for ((color, crate) in MRegistry.DECORATIVE_CRATE.items) {
MatteryRecipe(crate, 8, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(crate, 8)
.row(MRegistry.DECORATIVE_CRATE.item, MRegistry.DECORATIVE_CRATE.item, MRegistry.DECORATIVE_CRATE.item)
.row(MRegistry.DECORATIVE_CRATE.item, color.tag, MRegistry.DECORATIVE_CRATE.item)
.row(MRegistry.DECORATIVE_CRATE.item, MRegistry.DECORATIVE_CRATE.item, MRegistry.DECORATIVE_CRATE.item)
@ -192,7 +190,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
}
for ((color, item) in MRegistry.TRITANIUM_BLOCK.items) {
MatteryRecipe(item, 8, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(item, 8)
.row(MRegistry.TRITANIUM_BLOCK.item, MRegistry.TRITANIUM_BLOCK.item, MRegistry.TRITANIUM_BLOCK.item)
.row(MRegistry.TRITANIUM_BLOCK.item, color.tag, MRegistry.TRITANIUM_BLOCK.item)
.row(MRegistry.TRITANIUM_BLOCK.item, MRegistry.TRITANIUM_BLOCK.item, MRegistry.TRITANIUM_BLOCK.item)
@ -201,14 +199,14 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.build(consumer, modLocation("decorative/tritanium/default/${color.name.lowercase()}"))
}
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MRegistry.INDUSTRIAL_GLASS.item, 8)
ShapelessRecipeBuilder(MRegistry.INDUSTRIAL_GLASS.item, 8)
.requires(Items.GLASS, 8)
.requires(MItemTags.TRITANIUM_PLATES)
.unlockedBy("has_plate", has(MItemTags.TRITANIUM_PLATES))
.unlockedBy("has_glass", has(Items.GLASS))
.save(consumer, modLocation("decorative/industrial_glass/default"))
ShapedRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, MRegistry.INDUSTRIAL_GLASS_PANE.item, 16)
ShapedRecipeBuilder(MRegistry.INDUSTRIAL_GLASS_PANE.item, 16)
.define('#', MRegistry.INDUSTRIAL_GLASS.item)
.pattern("###").pattern("###")
.unlockedBy("has_tritanium_glass", has(MRegistry.INDUSTRIAL_GLASS.item))
@ -239,44 +237,44 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
val mappedVanilla = mappingUpgradeVanilla[color]!!
// обычная покраска
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, item, 8)
ShapelessRecipeBuilder(item, 8)
.requires(MRegistry.INDUSTRIAL_GLASS.item, 8)
.requires(color.tag)
.unlockedBy("has_tritanium_glass", has(MRegistry.INDUSTRIAL_GLASS.item))
.save(consumer, modLocation("decorative/industrial_glass/recolor/${color.name.lowercase()}"))
// апгрейд ванильного крашенного стекла
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, item, 8)
ShapelessRecipeBuilder(item, 8)
.requires(mappedVanilla, 8)
.requires(MItemTags.TRITANIUM_PLATES)
.unlockedBy("has_plate", has(MItemTags.TRITANIUM_PLATES))
.unlockedBy("has_colored_glass", has(mappedVanilla))
.save(consumer, modLocation("decorative/industrial_glass/upgrade/${color.name.lowercase()}"))
ShapedRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, paneItem, 16)
ShapedRecipeBuilder(paneItem, 16)
.define('#', item)
.pattern("###").pattern("###")
.unlockedBy("has_colored_tritanium_glass", has(paneItem))
.save(consumer, modLocation("decorative/industrial_glass_pane/${color.name.lowercase()}"))
ShapelessRecipeBuilder(RecipeCategory.BUILDING_BLOCKS, paneItem, 8)
ShapelessRecipeBuilder(paneItem, 8)
.requires(MRegistry.INDUSTRIAL_GLASS_PANE.item, 8)
.requires(color.tag)
.unlockedBy("has_tritanium_glass_pane", has(MRegistry.INDUSTRIAL_GLASS_PANE.item))
.save(consumer, modLocation("decorative/industrial_glass_pane/recolor/${color.name.lowercase()}"))
}
ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MItems.LABORATORY_LAMP, 1)
ShapelessRecipeBuilder(MItems.LABORATORY_LAMP, 1)
.requires(MItems.LABORATORY_LAMP_INVERTED)
.unlockedBy(MItems.LABORATORY_LAMP_INVERTED)
.save(consumer, MItems.LABORATORY_LAMP.registryName!!.toString() + "_inv")
ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MItems.LABORATORY_LAMP_INVERTED, 1)
ShapelessRecipeBuilder(MItems.LABORATORY_LAMP_INVERTED, 1)
.requires(MItems.LABORATORY_LAMP)
.unlockedBy(MItems.LABORATORY_LAMP)
.save(consumer, MItems.LABORATORY_LAMP_INVERTED.registryName!!.toString() + "_inv")
MatteryRecipe(MBlocks.TRITANIUM_STRIPED_BLOCK, 24, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MBlocks.TRITANIUM_STRIPED_BLOCK, 24)
.rowB(MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, Tags.Items.COBBLESTONE, MItemTags.TRITANIUM_INGOTS)
.rowAB(Tags.Items.DYES_YELLOW, MItemTags.TRITANIUM_INGOTS)
@ -284,14 +282,14 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.unlockedBy(Tags.Items.DYES_YELLOW)
.build(consumer, modLocation("decorative/blocks/striped_default"))
MatteryRecipe(MRegistry.TRITANIUM_BLOCK.item, 24, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MRegistry.TRITANIUM_BLOCK.item, 24)
.rowB(MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, Tags.Items.COBBLESTONE, MItemTags.TRITANIUM_INGOTS)
.rowB(MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer, modLocation("decorative/blocks/default"))
MatteryRecipe(MBlocks.TRITANIUM_DOOR[null]!!, 3, category = RecipeCategory.REDSTONE)
MatteryRecipe(MBlocks.TRITANIUM_DOOR[null]!!, 3)
.rowAB(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowAB(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowAB(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
@ -299,41 +297,41 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.build(consumer, modLocation("decorative/doors/default"))
for (color in DyeColor.values()) {
ShapelessRecipeBuilder.shapeless(RecipeCategory.REDSTONE, MItems.TRITANIUM_DOOR[color]!!, 1)
ShapelessRecipeBuilder.shapeless(MItems.TRITANIUM_DOOR[color]!!, 1)
.requires(Ingredient.of(MItems.TRITANIUM_DOOR.entries.stream().filter { it.key != color }.map { ItemStack(it.value) }))
.requires(color.tag)
.unlockedBy(MItems.TRITANIUM_DOOR.entries.stream().filter { it.key != color }.map { it.value })
.save(consumer, modLocation("decorative/doors/${color.name.lowercase()}"))
}
MatteryRecipe(MBlocks.TRITANIUM_TRAPDOOR[null]!!, category = RecipeCategory.REDSTONE)
MatteryRecipe(MBlocks.TRITANIUM_TRAPDOOR[null]!!)
.rowAB(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.rowAB(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.unlockedBy(MItemTags.TRITANIUM_INGOTS)
.build(consumer, modLocation("decorative/trapdoors/default"))
for (color in DyeColor.values()) {
ShapelessRecipeBuilder.shapeless(RecipeCategory.REDSTONE, MItems.TRITANIUM_TRAPDOOR[color]!!, 1)
ShapelessRecipeBuilder.shapeless(MItems.TRITANIUM_TRAPDOOR[color]!!, 1)
.requires(Ingredient.of(MItems.TRITANIUM_TRAPDOOR.entries.stream().filter { it.key != color }.map { ItemStack(it.value) }))
.requires(color.tag)
.unlockedBy(MItems.TRITANIUM_TRAPDOOR.entries.stream().filter { it.key != color }.map { it.value })
.save(consumer, modLocation("decorative/trapdoors/${color.name.lowercase()}"))
}
MatteryRecipe(MRegistry.TRITANIUM_PRESSURE_PLATE.item, category = RecipeCategory.REDSTONE)
MatteryRecipe(MRegistry.TRITANIUM_PRESSURE_PLATE.item)
.row(MItemTags.TRITANIUM_PLATES, MItemTags.BASIC_CIRCUIT, MItemTags.TRITANIUM_PLATES)
.unlockedBy(MItemTags.TRITANIUM_PLATES)
.build(consumer, modLocation("pressure_plates/default"))
for (dye in DyeColor.values()) {
ShapelessRecipeBuilder(RecipeCategory.REDSTONE, MRegistry.TRITANIUM_PRESSURE_PLATE.getItem(dye), 1)
ShapelessRecipeBuilder(MRegistry.TRITANIUM_PRESSURE_PLATE.getItem(dye), 1)
.requires(Ingredient.of(MRegistry.TRITANIUM_PRESSURE_PLATE.allItems.entries.stream().filter { it.key != dye }.map { ItemStack(it.value) }))
.requires(dye.tag)
.unlockedBy(MItemTags.TRITANIUM_PLATES)
.save(consumer, modLocation("pressure_plates/${dye.name.lowercase()}"))
}
MatteryRecipe(MItems.ENGINE, count = 9, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MItems.ENGINE, count = 9)
.rowAC(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, Items.FLINT_AND_STEEL, MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, MItems.MATTER_CABLE, MItemTags.TRITANIUM_INGOTS)
@ -341,7 +339,7 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.unlockedBy(Items.FLINT_AND_STEEL)
.build(consumer, modLocation("decorative/engine"))
MatteryRecipe(MItems.METAL_MESH, count = 12, category = RecipeCategory.BUILDING_BLOCKS)
MatteryRecipe(MItems.METAL_MESH, count = 12)
.row(Tags.Items.NUGGETS_IRON, Items.IRON_BARS, Tags.Items.NUGGETS_IRON)
.rowAC(Items.IRON_BARS, Items.IRON_BARS)
.row(Tags.Items.NUGGETS_IRON, Items.IRON_BARS, Tags.Items.NUGGETS_IRON)
@ -350,25 +348,25 @@ fun addDecorativesRecipes(provider: MatteryRecipeProvider, consumer: RecipeOutpu
.build(consumer, modLocation("decorative/metal_mesh"))
// лампа
MatteryRecipe(MItems.LABORATORY_LAMP, category = RecipeCategory.REDSTONE)
MatteryRecipe(MItems.LABORATORY_LAMP)
.row(MItemTags.IRON_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS, MItemTags.IRON_PLATES)
.row(MItems.MIRROR, Items.GLOWSTONE, MItems.MIRROR)
.row(MItemTags.TRITANIUM_PLATES, Tags.Items.DUSTS_REDSTONE, MItemTags.TRITANIUM_PLATES)
.build(consumer, modLocation("decorative/lamp"))
// Голо табличка
MatteryRecipe(MItems.HOLO_SIGN, category = RecipeCategory.DECORATIONS)
MatteryRecipe(MItems.HOLO_SIGN)
.row(MItemTags.BASIC_CIRCUIT, MItemTags.TRITANIUM_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS)
.rowAB(Tags.Items.DUSTS_REDSTONE, Tags.Items.DUSTS_GLOWSTONE)
.rowBC(MItemTags.TRITANIUM_PLATES, MItemTags.HARDENED_GLASS_PANES_COLORLESS)
.build(consumer, modLocation("decorative/holo_sign"))
MatteryRecipe(MItems.TRITANIUM_BARS, category = RecipeCategory.DECORATIONS, count = 16)
MatteryRecipe(MItems.TRITANIUM_BARS, count = 16)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)
.build(consumer, modLocation("decorative/tritanium_bars"))
MatteryRecipe(MItems.TRITANIUM_ANVIL[0], category = RecipeCategory.DECORATIONS)
MatteryRecipe(MItems.TRITANIUM_ANVIL[0])
.row(MItemTags.TRITANIUM_INGOTS_STORAGE, MItemTags.TRITANIUM_INGOTS_STORAGE, MItemTags.TRITANIUM_INGOTS_STORAGE)
.rowB(MItemTags.TRITANIUM_INGOTS)
.row(MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS, MItemTags.TRITANIUM_INGOTS)

View File

@ -6,7 +6,6 @@ import net.minecraft.advancements.Advancement
import net.minecraft.advancements.Criterion
import net.minecraft.advancements.CriterionTriggerInstance
import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.ShapedRecipeBuilder
import net.minecraft.resources.ResourceLocation
import net.minecraft.tags.TagKey
@ -68,7 +67,7 @@ private fun RecipeOutput.map(mapper: (FinishedRecipe) -> FinishedRecipe): Recipe
* [ShapedRecipeBuilder] that doesn't suck
*/
@Suppress("unused")
class MatteryRecipe(val result: ItemLike, val count: Int = 1, val category: RecipeCategory = RecipeCategory.MISC) {
class MatteryRecipe(val result: ItemLike, val count: Int = 1) {
private val rows = arrayOfNulls<RecipeRow>(3)
private var index = 0
@ -133,7 +132,7 @@ class MatteryRecipe(val result: ItemLike, val count: Int = 1, val category: Reci
throw NoSuchElementException("No recipe rows were defined")
}
val builder = ShapedRecipeBuilder(category, result, count)
val builder = ShapedRecipeBuilder(result, count)
val pairs = ArrayList<Pair<Char, RecipeCell>>()
val iterator = charlist.iterator()

View File

@ -81,7 +81,7 @@ fun <T : RecipeBuilder> T.unlockedBy(item: TagKey<Item>): T {
return this
}
class MatteryRecipeProvider(generatorIn: DataGenerator) : RecipeProvider(generatorIn.packOutput) {
class MatteryRecipeProvider(generatorIn: DataGenerator) : RecipeProvider(generatorIn) {
private val callbacks = LinkedList<RecipeBuilderCallback>()
fun exec(callback: RecipeBuilderCallback): MatteryRecipeProvider {
@ -89,7 +89,7 @@ class MatteryRecipeProvider(generatorIn: DataGenerator) : RecipeProvider(generat
return this
}
override fun buildRecipes(callback: RecipeOutput) {
override fun buildCraftingRecipes(callback: RecipeOutput) {
for (lambda in callbacks) {
lambda(this, callback)
}

View File

@ -285,7 +285,7 @@ fun addPainterRecipes(consumer: RecipeOutput) {
striped(consumer, "walls", MRegistry.TRITANIUM_STRIPED_WALL.itemsWithColor, MRegistry.TRITANIUM_WALL.items)
striped(consumer, "slabs", MRegistry.TRITANIUM_STRIPED_SLAB.itemsWithColor, MRegistry.TRITANIUM_SLAB.items)
for (color in DyeColor.entries) {
for (color in DyeColor.values()) {
consumer.accept(PainterArmorDyeRecipe(modLocation("painter/armor_dye_" + color.getName().lowercase()), mapOf(color to 1)).toFinished())
}
consumer.accept(PainterArmorDyeRecipe(modLocation("painter/armor_clear_dye"), mapOf(null to 15)).toFinished())

View File

@ -1,7 +1,6 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.ShapelessRecipeBuilder
import net.minecraft.tags.TagKey
import net.minecraft.world.item.DyeColor
@ -21,7 +20,7 @@ import java.util.function.Consumer
typealias RecipeOutput = Consumer<FinishedRecipe>
fun hammerRecipe(output: ItemLike, input: ItemLike, consumer: RecipeOutput) {
ShapelessRecipeBuilder(RecipeCategory.MISC, output, 1)
ShapelessRecipeBuilder(output, 1)
.requires(MItemTags.TOOLS_HAMMERS)
.requires(input)
.unlockedBy(MItemTags.TOOLS_HAMMERS)
@ -30,7 +29,7 @@ fun hammerRecipe(output: ItemLike, input: ItemLike, consumer: RecipeOutput) {
}
fun hammerRecipe(output: ItemLike, input: TagKey<Item>, consumer: RecipeOutput) {
ShapelessRecipeBuilder(RecipeCategory.MISC, output, 1)
ShapelessRecipeBuilder(output, 1)
.requires(MItemTags.TOOLS_HAMMERS)
.requires(input)
.unlockedBy(MItemTags.TOOLS_HAMMERS)
@ -39,22 +38,22 @@ fun hammerRecipe(output: ItemLike, input: TagKey<Item>, consumer: RecipeOutput)
}
fun addShapelessRecipes(consumer: RecipeOutput) {
for (color in DyeColor.entries) {
ShapelessRecipeBuilder(RecipeCategory.TRANSPORTATION, MItems.CARGO_CRATE_MINECARTS[color]!!, 1)
for (color in DyeColor.values()) {
ShapelessRecipeBuilder(MItems.CARGO_CRATE_MINECARTS[color]!!, 1)
.requires(Items.MINECART)
.requires(MRegistry.CARGO_CRATES.items[color]!!)
.unlockedBy(Items.MINECART)
.unlockedBy(MRegistry.CARGO_CRATES.items[color]!!)
.save(consumer)
ShapelessRecipeBuilder(RecipeCategory.TRANSPORTATION, MItems.CARGO_CRATE_MINECARTS[color]!!, 1)
ShapelessRecipeBuilder(MItems.CARGO_CRATE_MINECARTS[color]!!, 1)
.requires(Ingredient.of(MItems.CARGO_CRATE_MINECARTS.entries.stream().filter { it.key != color }.map { ItemStack(it.value) }))
.requires(color.tag)
.unlockedBy(MItems.CARGO_CRATE_MINECARTS.entries.stream().filter { it.key != color }.map { it.value })
.save(consumer, modLocation(MItems.CARGO_CRATE_MINECARTS[color]!!.registryName!!.path + "_alt"))
}
ShapelessRecipeBuilder(RecipeCategory.TRANSPORTATION, MItems.CARGO_CRATE_MINECARTS[null]!!, 1)
ShapelessRecipeBuilder(MItems.CARGO_CRATE_MINECARTS[null]!!, 1)
.requires(Items.MINECART)
.requires(MRegistry.CARGO_CRATES.item)
.unlockedBy(Items.MINECART)

View File

@ -3,8 +3,6 @@ package ru.dbotthepony.mc.otm.datagen.tags
import it.unimi.dsi.fastutil.objects.ObjectArraySet
import net.minecraft.core.HolderLookup
import net.minecraft.core.Registry
import net.minecraft.core.registries.BuiltInRegistries
import net.minecraft.core.registries.Registries
import net.minecraft.resources.ResourceKey
import net.minecraft.resources.ResourceLocation
import net.minecraft.tags.BlockTags
@ -24,13 +22,13 @@ import java.util.stream.Stream
import net.minecraft.data.tags.TagsProvider as MinecraftTagsProvider
private fun <T : Any> vanillaLookup(key: ResourceKey<Registry<T>>): (T) -> ResourceLocation {
val registry by lazy { (BuiltInRegistries.REGISTRY.get(key.location()) ?: throw NoSuchElementException("No such registry $key")) as Registry<T> }
val registry by lazy { (Registry.REGISTRY.get(key.location()) ?: throw NoSuchElementException("No such registry $key")) as Registry<T> }
return { registry.getKey(it) ?: throw NoSuchElementException("Registry $key does not contain $it") }
}
class TagsProvider(private val event: GatherDataEvent) {
inner class Delegate<T : Any> private constructor(key: ResourceKey<Registry<T>>, val lookup: (T) -> ResourceLocation) : MinecraftTagsProvider<T>(event.generator.packOutput, key, event.lookupProvider, DataGen.MOD_ID, event.existingFileHelper) {
constructor(registry: IForgeRegistry<T>) : this(registry.registryKey, { registry.getKey(it) ?: throw NoSuchElementException("Registry $registry does not contain $it") })
inner class Delegate<T : Any> private constructor(key: Registry<T>, val lookup: (T) -> ResourceLocation) : MinecraftTagsProvider<T>(event.generator, key, DataGen.MOD_ID, event.existingFileHelper) {
constructor(registry: IForgeRegistry<T>) : this(registry, { registry.getKey(it) ?: throw NoSuchElementException("Registry $registry does not contain $it") })
constructor(key: ResourceKey<Registry<T>>) : this(key, vanillaLookup(key))
init {
@ -123,7 +121,7 @@ class TagsProvider(private val event: GatherDataEvent) {
fun forge(path: String) = Appender(ResourceLocation("forge", path))
fun minecraft(path: String) = Appender(ResourceLocation("minecraft", path))
override fun addTags(provider: HolderLookup.Provider) {
override fun addTags() {
for ((tag, values) in tags) {
val appender = tag(tag)
@ -214,8 +212,8 @@ class TagsProvider(private val event: GatherDataEvent) {
fun ore(key: String, block: Block): TagsProvider {
val forgeKey = ResourceLocation("forge", "ores/$key")
val b = TagKey.create(Registries.BLOCK, forgeKey)
val i = TagKey.create(Registries.ITEM, forgeKey)
val b = TagKey.create(Registry.BLOCK_REGISTRY, forgeKey)
val i = TagKey.create(Registry.ITEM_REGISTRY, forgeKey)
items.Appender(i).add(block.asItem())
itemOres.add(block.asItem())
@ -269,7 +267,7 @@ class TagsProvider(private val event: GatherDataEvent) {
val itemOreRatesSingular = items.Appender(Tags.Items.ORE_RATES_SINGULAR)
// val itemOreRatesDense = items.forge("ore_rates/dense")
val gameEvents = Delegate(Registries.GAME_EVENT)
val gameEvents = Delegate(Registry.GAME_EVENT_REGISTRY)
val vibrations = gameEvents.Appender(GameEventTags.VIBRATIONS)
fun requiresPickaxe(block: Block, tier: Tier? = null): TagsProvider {