redone tritanium recycle recipes, added simple armor recycling, removed shield from tools group

This commit is contained in:
YuRaNnNzZZ 2023-06-09 19:01:29 +03:00
parent 9b5871a320
commit d77f735fa8
Signed by: YuRaNnNzZZ
GPG Key ID: 5F71738C85A6006D
4 changed files with 34 additions and 18 deletions

View File

@ -85,7 +85,7 @@ fun addItemModels(provider: MatteryItemModelProvider) {
provider.generated(MItems.EXOPACK_PROBE)
provider.handheld(MItems.TRITANIUM_TOOLS.filter { it != MItems.TRITANIUM_SHIELD })
provider.handheld(MItems.TRITANIUM_TOOLS)
provider.generated(MItems.TRITANIUM_ARMOR)
provider.generated(MItems.SIMPLE_TRITANIUM_ARMOR)

View File

@ -1,34 +1,50 @@
package ru.dbotthepony.mc.otm.datagen.recipes
import com.google.common.collect.Lists
import net.minecraft.data.recipes.FinishedRecipe
import net.minecraft.data.recipes.RecipeCategory
import net.minecraft.data.recipes.SimpleCookingRecipeBuilder
import net.minecraft.world.item.Item
import net.minecraft.world.item.ItemStack
import net.minecraft.world.item.crafting.Ingredient
import ru.dbotthepony.mc.otm.core.registryName
import net.minecraft.world.level.ItemLike
import ru.dbotthepony.mc.otm.datagen.modLocation
import ru.dbotthepony.mc.otm.registry.MItemTags
import ru.dbotthepony.mc.otm.registry.MItems
import java.util.*
import java.util.function.Consumer
private fun Consumer<FinishedRecipe>.addRecyclingRecipe(inputs: Collection<ItemLike>, result: Item, name: String) {
val inputStacks: LinkedList<ItemStack> = Lists.newLinkedList()
inputs.forEach { inputStacks.add(ItemStack(it)) }
val smelting = SimpleCookingRecipeBuilder.smelting(
Ingredient.of(inputStacks.stream()),
RecipeCategory.MISC,
result,
0f,
200
)
inputs.forEach { smelting.unlockedBy(it) }
smelting.save(this, modLocation("smelting/${name}"))
val blasting = SimpleCookingRecipeBuilder.blasting(
Ingredient.of(inputStacks.stream()),
RecipeCategory.MISC,
result,
0f,
100
)
inputs.forEach { blasting.unlockedBy(it) }
blasting.save(this, modLocation("blasting/${name}"))
}
fun addBlastingRecipes(consumer: Consumer<FinishedRecipe>) {
SimpleCookingRecipeBuilder.blasting(Ingredient.of(MItems.MIRROR_COMPOUND), RecipeCategory.MISC, 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(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(MItemTags.TRITANIUM_PLATES).save(consumer, modLocation("tritanium_ingot_from_plates_blasting"))
for (tool in MItems.TRITANIUM_TOOLS) {
SimpleCookingRecipeBuilder.smelting(
Ingredient.of(tool),
RecipeCategory.MISC,
MItems.TRITANIUM_NUGGET,
0f, 200
).unlockedBy(MItems.TRITANIUM_NUGGET).save(consumer, modLocation("smelting/tritanium_nugget_from_${tool.registryName!!.path}"))
SimpleCookingRecipeBuilder.blasting(
Ingredient.of(tool),
RecipeCategory.MISC,
MItems.TRITANIUM_NUGGET,
0f, 100
).unlockedBy(MItems.TRITANIUM_NUGGET).save(consumer, modLocation("blasting/tritanium_nugget_from_${tool.registryName!!.path}"))
}
consumer.addRecyclingRecipe(MItems.TRITANIUM_TOOLS, MItems.TRITANIUM_NUGGET, "tritanium_nugget_from_tools")
consumer.addRecyclingRecipe(MItems.SIMPLE_TRITANIUM_ARMOR, MItems.TRITANIUM_NUGGET, "tritanium_nugger_from_armor")
}

View File

@ -148,6 +148,7 @@ private fun addMainCreativeTabItems(consumer: CreativeModeTab.Output) {
accept(MItems.TRITANIUM_INGOT_BLOCK)
accept(MItems.TRITANIUM_TOOLS)
accept(MItems.TRITANIUM_SHIELD)
accept(MItems.SIMPLE_TRITANIUM_ARMOR)
accept(MItems.TRITANIUM_ARMOR)

View File

@ -215,7 +215,6 @@ object MItems {
::TRITANIUM_PICKAXE,
::TRITANIUM_HOE,
::TRITANIUM_SHEARS,
::TRITANIUM_SHIELD,
)
val TRITANIUM_HELMET: TritaniumArmorItem by registry.register(MNames.TRITANIUM_HELMET) { TritaniumArmorItem(ArmorItem.Type.HELMET) }