Fix datagen failure
This commit is contained in:
parent
d7a444327c
commit
9db36447a9
@ -64,8 +64,8 @@ fun addCraftingTableRecipes(consumer: Consumer<FinishedRecipe>) {
|
||||
|
||||
for ((color, item) in MRegistry.VENT_ALTERNATIVE.mappedColoredItemsAll) {
|
||||
val other = MRegistry.VENT.mappedColoredItemsAll[color]!!
|
||||
ShapelessRecipeBuilder(item, 1).requires(other).save(consumer)
|
||||
ShapelessRecipeBuilder(other, 1).requires(item).save(consumer, "${other.registryName!!.path}_from_alt")
|
||||
ShapelessRecipeBuilder(item, 1).requires(other).unlockedBy(item).save(consumer)
|
||||
ShapelessRecipeBuilder(other, 1).requires(item).unlockedBy(other).save(consumer, "${other.registryName!!.path}_from_alt")
|
||||
}
|
||||
|
||||
for ((crate, color) in listOf(
|
||||
|
@ -4,6 +4,7 @@ package ru.dbotthepony.mc.otm.datagen.recipes
|
||||
import net.minecraft.advancements.CriterionTriggerInstance
|
||||
import net.minecraft.data.recipes.FinishedRecipe
|
||||
import net.minecraft.data.recipes.ShapedRecipeBuilder
|
||||
import net.minecraft.data.recipes.ShapelessRecipeBuilder
|
||||
import net.minecraft.resources.ResourceLocation
|
||||
import net.minecraft.tags.TagKey
|
||||
import net.minecraft.world.item.Item
|
||||
@ -46,6 +47,15 @@ private data class RecipeRow(
|
||||
val c: RecipeCell?,
|
||||
)
|
||||
|
||||
fun ShapelessRecipeBuilder.unlockedBy(item: ItemLike): ShapelessRecipeBuilder {
|
||||
val location = item.asItem().registryName!!
|
||||
return unlockedBy("has_${location.namespace}_${location.path}", has(item))
|
||||
}
|
||||
|
||||
fun ShapelessRecipeBuilder.unlockedBy(item: TagKey<Item>): ShapelessRecipeBuilder {
|
||||
return unlockedBy("has_${item.location.namespace}_${item.location.path}", has(item))
|
||||
}
|
||||
|
||||
/**
|
||||
* [ShapedRecipeBuilder] that doesn't suck
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user