From bc7167d07378e79bef5adf2e6541c3bec8ff6705 Mon Sep 17 00:00:00 2001 From: Hiiragi Russell Tsubasa <97942736+Hiiragi283@users.noreply.github.com> Date: Thu, 17 Sep 2026 23:47:40 +0900 Subject: [PATCH 1/7] =?UTF-8?q?feat:=20Enchanting=20Recipe=20=E3=81=A7?= =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=93=81=E3=81=AE=E8=A6=81=E4=BB=B6=E3=82=92?= =?UTF-8?q?=E7=B7=A9=E5=92=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/recipe/RagiumArcaneRecipeProvider.kt | 10 +++- .../recipe/enchanting/diamond_armor.json | 2 + .../ragium/recipe/enchanting/protection.json | 2 + .../recipe/result/HTFluidResultBuilder.kt | 3 +- .../data/recipe/result/HTItemResultBuilder.kt | 21 ++++++- .../lib/recipe/result/HTItemResult.kt | 50 +++++++++++++++- .../builder/RTEnchantingRecipeBuilder.kt | 58 ------------------- .../recipe/builder/RagiumRecipeBuilders.kt | 7 ++- .../ragium/api/recipe/RTEnchantingRecipe.kt | 41 ++----------- .../kotlin/hiiragi283/ragium/common/Ragium.kt | 1 + 10 files changed, 88 insertions(+), 107 deletions(-) delete mode 100644 src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RTEnchantingRecipeBuilder.kt diff --git a/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumArcaneRecipeProvider.kt b/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumArcaneRecipeProvider.kt index aa5d09087..241855885 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumArcaneRecipeProvider.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumArcaneRecipeProvider.kt @@ -23,7 +23,9 @@ class RagiumArcaneRecipeProvider(packOutput: PackOutput, future: CompletableFutu +holderSet(CommonTagPrefixes.INGOT, RagiumMaterial.Metal.IRON) count = 64 } - +registries.getOrThrow(Enchantments.PROTECTION) + result { + +registries.getOrThrow(Enchantments.PROTECTION) + } }.save(exporter) // Diamond -> Protection + Unbreaking RagiumRecipeBuilders.enchanting { @@ -32,8 +34,10 @@ class RagiumArcaneRecipeProvider(packOutput: PackOutput, future: CompletableFutu count = 16 } result { - set(registries.getOrThrow(Enchantments.PROTECTION), 4) - set(registries.getOrThrow(Enchantments.UNBREAKING), 3) + enchantedBook { + set(registries.getOrThrow(Enchantments.PROTECTION), 4) + set(registries.getOrThrow(Enchantments.UNBREAKING), 3) + } } recipeId replace id("diamond_armor") }.save(exporter) diff --git a/src/generated/resources/data/ragium/recipe/enchanting/diamond_armor.json b/src/generated/resources/data/ragium/recipe/enchanting/diamond_armor.json index e74fcc159..8c838120f 100644 --- a/src/generated/resources/data/ragium/recipe/enchanting/diamond_armor.json +++ b/src/generated/resources/data/ragium/recipe/enchanting/diamond_armor.json @@ -5,6 +5,8 @@ "items": "#c:gems/diamond" }, "result": { + "type": "ragium:enchanted_book", + "count": 1, "enchantments": { "minecraft:protection": 4, "minecraft:unbreaking": 3 diff --git a/src/generated/resources/data/ragium/recipe/enchanting/protection.json b/src/generated/resources/data/ragium/recipe/enchanting/protection.json index a3f0f8589..55ce9f449 100644 --- a/src/generated/resources/data/ragium/recipe/enchanting/protection.json +++ b/src/generated/resources/data/ragium/recipe/enchanting/protection.json @@ -5,6 +5,8 @@ "items": "#c:ingots/iron" }, "result": { + "type": "ragium:enchanted_book", + "count": 1, "id": "minecraft:protection" }, "time": 200 diff --git a/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTFluidResultBuilder.kt b/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTFluidResultBuilder.kt index 928f3a051..741eb4620 100644 --- a/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTFluidResultBuilder.kt +++ b/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTFluidResultBuilder.kt @@ -65,9 +65,8 @@ class HTFluidResultBuilder @PublishedApi internal constructor() { +HTFluidResult.SimpleEntry(this) } - @Suppress("DEPRECATION") operator fun Fluid.unaryPlus() { - +HTFluidResult.SimpleEntry(this.builtInRegistryHolder()) + +HTFluidResult.SimpleEntry(FluidStackTemplate(this, 1)) } operator fun HTFluidContent.unaryPlus() { diff --git a/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTItemResultBuilder.kt b/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTItemResultBuilder.kt index 3eac0cbc0..eea0b7d30 100644 --- a/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTItemResultBuilder.kt +++ b/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTItemResultBuilder.kt @@ -2,6 +2,7 @@ package hiiragi283.lib.data.recipe.result +import hiiragi283.lib.item.component.buildItemEnchantments import hiiragi283.lib.recipe.result.HTItemResult import hiiragi283.lib.registry.HTDeferredBlockAndItem import hiiragi283.lib.registry.HTSimpleDeferredItem @@ -14,6 +15,8 @@ import net.minecraft.resources.ResourceKey import net.minecraft.world.item.Item import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStackTemplate +import net.minecraft.world.item.enchantment.Enchantment +import net.minecraft.world.item.enchantment.ItemEnchantments import kotlin.contracts.ExperimentalContracts import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -54,6 +57,7 @@ class HTItemResultBuilder @PublishedApi internal constructor() { +HTSimpleDeferredItem(this).delegate } + @JvmName("unaryPlusItem") operator fun Holder.unaryPlus() { +HTItemResult.SimpleEntry(this) } @@ -62,9 +66,8 @@ class HTItemResultBuilder @PublishedApi internal constructor() { +this.item } - @Suppress("DEPRECATION") operator fun Item.unaryPlus() { - +HTItemResult.SimpleEntry(this.builtInRegistryHolder()) + +HTItemResult.SimpleEntry(ItemStackTemplate(this)) } fun from(template: ItemStackTemplate) { @@ -82,5 +85,19 @@ class HTItemResultBuilder @PublishedApi internal constructor() { +HTItemResult.TagEntry(this) } + // Enchanted Book + @JvmName("unaryPlusEnchantment") + operator fun Holder.unaryPlus() { + +HTItemResult.EnchantedBookEntry(this) + } + + operator fun ItemEnchantments.unaryPlus() { + +HTItemResult.EnchantedBookEntry(this) + } + + inline fun enchantedBook(builderAction: ItemEnchantments.Mutable.() -> Unit) { + +buildItemEnchantments(builderAction = builderAction) + } + fun build(): HTItemResult = HTItemResult(entry, count) } diff --git a/src/lib/kotlin/hiiragi283/lib/recipe/result/HTItemResult.kt b/src/lib/kotlin/hiiragi283/lib/recipe/result/HTItemResult.kt index 785021705..69a215797 100644 --- a/src/lib/kotlin/hiiragi283/lib/recipe/result/HTItemResult.kt +++ b/src/lib/kotlin/hiiragi283/lib/recipe/result/HTItemResult.kt @@ -5,16 +5,22 @@ import com.mojang.serialization.Codec import com.mojang.serialization.DataResult import com.mojang.serialization.MapCodec import hiiragi283.lib.HTConstants +import hiiragi283.lib.data.buildDataPatch +import hiiragi283.lib.item.ItemStack +import hiiragi283.lib.item.component.buildItemEnchantments import hiiragi283.lib.registry.getKeyOrThrow import hiiragi283.lib.serialization.codec.HTCodecs import hiiragi283.lib.serialization.network.HTStreamCodecs import hiiragi283.lib.util.DFUEither +import hiiragi283.lib.util.Either import hiiragi283.lib.util.fold +import hiiragi283.lib.util.unwrap import hiiragi283.ragium.api.RagiumConfig import hiiragi283.ragium.api.RagiumRegistries import net.minecraft.core.Holder import net.minecraft.core.HolderSet import net.minecraft.core.component.DataComponentPatch +import net.minecraft.core.component.DataComponents import net.minecraft.core.registries.Registries import net.minecraft.network.RegistryFriendlyByteBuf import net.minecraft.network.codec.ByteBufCodecs @@ -24,6 +30,9 @@ import net.minecraft.resources.ResourceKey import net.minecraft.world.item.Item import net.minecraft.world.item.ItemStack import net.minecraft.world.item.ItemStackTemplate +import net.minecraft.world.item.Items +import net.minecraft.world.item.enchantment.Enchantment +import net.minecraft.world.item.enchantment.ItemEnchantments import net.neoforged.neoforge.common.util.NeoForgeExtraCodecs import java.util.Optional @@ -167,9 +176,8 @@ data class HTItemResult(val entry: Entry, val count: Int) : HTRecipeResult = HTStreamCodecs.holderSet( - Registries.ITEM - ).map(::TagEntry, TagEntry::tag) + val STREAM_CODEC: StreamCodec = + HTStreamCodecs.holderSet(Registries.ITEM).map(::TagEntry, TagEntry::tag) @JvmField val TYPE: HTItemResultType = HTItemResultType(CODEC, STREAM_CODEC) @@ -196,6 +204,42 @@ data class HTItemResult(val entry: Entry, val count: Int) : HTRecipeResult, ItemEnchantments>) : Entry { + companion object { + @JvmField + val CODEC: MapCodec = HTCodecs.mapEither( + HTCodecs.holder(Registries.ENCHANTMENT).fieldOf(HTConstants.ID), + ItemEnchantments.CODEC.fieldOf("enchantments") + ).xmap(::EnchantedBookEntry, EnchantedBookEntry::content) + + @JvmField + val STREAM_CODEC: StreamCodec = HTStreamCodecs + .either(HTStreamCodecs.holder(Registries.ENCHANTMENT), ItemEnchantments.STREAM_CODEC) + .map(::EnchantedBookEntry, EnchantedBookEntry::content) + + @JvmField + val TYPE: HTItemResultType = HTItemResultType(CODEC, STREAM_CODEC) + } + + constructor(holder: Holder) : this(Either.Left(holder)) + + constructor(enchantments: ItemEnchantments) : this(Either.Right(enchantments)) + + override fun type(): HTItemResultType<*> = TYPE + + override fun create(): ItemStack = content + .mapLeft { holder: Holder -> buildItemEnchantments { set(holder, holder.value().maxLevel) } } + .unwrap() + .let { buildDataPatch { set(DataComponents.STORED_ENCHANTMENTS, it) } } + .let { ItemStack(Items.ENCHANTED_BOOK, 1, it) } + + override fun getId(): Identifier? = content.leftOrNull()?.key?.identifier() + } } // Extensions // diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RTEnchantingRecipeBuilder.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RTEnchantingRecipeBuilder.kt deleted file mode 100644 index 748049214..000000000 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RTEnchantingRecipeBuilder.kt +++ /dev/null @@ -1,58 +0,0 @@ -@file:OptIn(ExperimentalContracts::class) - -package hiiragi283.ragium.api.data.recipe.builder - -import hiiragi283.lib.data.recipe.builder.HTProgressRecipeBuilder -import hiiragi283.lib.data.recipe.ingredient.HTItemIngredientBuilder -import hiiragi283.lib.item.component.buildItemEnchantments -import hiiragi283.lib.recipe.ingredient.HTItemIngredient -import hiiragi283.lib.registry.getKeyOrThrow -import hiiragi283.lib.util.Either -import hiiragi283.lib.util.HTDelegates -import hiiragi283.ragium.api.RagiumConstants -import hiiragi283.ragium.api.recipe.RTEnchantingRecipe -import net.minecraft.core.Holder -import net.minecraft.resources.Identifier -import net.minecraft.world.item.enchantment.Enchantment -import net.minecraft.world.item.enchantment.ItemEnchantments -import kotlin.contracts.ExperimentalContracts -import kotlin.contracts.InvocationKind -import kotlin.contracts.contract - -class RTEnchantingRecipeBuilder : HTProgressRecipeBuilder(RagiumConstants.ENCHANTING) { - override fun getRecipeId(): Identifier? = result.content.mapLeft { it.getKeyOrThrow().identifier() }.leftOrNull() - - override fun createRecipe(): RTEnchantingRecipe = RTEnchantingRecipe(ingredient, result, progressData) - - // Ingredient - @PublishedApi internal var ingredient: HTItemIngredient by HTDelegates.onceInitialize() - - operator fun HTItemIngredient.unaryPlus() { - ingredient = this - } - - inline fun ingredient(builderAction: HTItemIngredientBuilder.() -> Unit) { - contract { - callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) - } - +HTItemIngredientBuilder.build(builderAction) - } - - // Result - @PublishedApi internal var result: RTEnchantingRecipe.EnchantmentResult by HTDelegates.onceInitialize() - - operator fun Holder.unaryPlus() { - result = RTEnchantingRecipe.EnchantmentResult(Either.Left(this)) - } - - operator fun ItemEnchantments.unaryPlus() { - result = RTEnchantingRecipe.EnchantmentResult(Either.Right(this)) - } - - inline fun result(builderAction: ItemEnchantments.Mutable.() -> Unit) { - contract { - callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) - } - +buildItemEnchantments(builderAction = builderAction) - } -} diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RagiumRecipeBuilders.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RagiumRecipeBuilders.kt index 555cf195f..e7bc86fe1 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RagiumRecipeBuilders.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RagiumRecipeBuilders.kt @@ -17,6 +17,7 @@ import hiiragi283.ragium.api.recipe.RTCompressingRecipe import hiiragi283.ragium.api.recipe.RTCrushingRecipe import hiiragi283.ragium.api.recipe.RTCuttingRecipe import hiiragi283.ragium.api.recipe.RTDrainingRecipe +import hiiragi283.ragium.api.recipe.RTEnchantingRecipe import hiiragi283.ragium.api.recipe.RTFillingRecipe import hiiragi283.ragium.api.recipe.RTFreezingRecipe import hiiragi283.ragium.api.recipe.RTMeltingRecipe @@ -203,10 +204,12 @@ data object RagiumRecipeBuilders { // Arcane @JvmStatic - inline fun enchanting(builderAction: RTEnchantingRecipeBuilder.() -> Unit): RTEnchantingRecipeBuilder { + inline fun enchanting( + builderAction: HTItemToRecipeBuilder.ToItem.() -> Unit + ): HTItemToRecipeBuilder.ToItem { contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) } - return RTEnchantingRecipeBuilder().apply(builderAction) + return HTItemToRecipeBuilder.ToItem(RagiumConstants.ENCHANTING, ::RTEnchantingRecipe).apply(builderAction) } } diff --git a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTEnchantingRecipe.kt b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTEnchantingRecipe.kt index bdd1511f3..ac9612e37 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTEnchantingRecipe.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTEnchantingRecipe.kt @@ -2,22 +2,15 @@ package hiiragi283.ragium.api.recipe import com.mojang.serialization.MapCodec import hiiragi283.lib.HTConstants -import hiiragi283.lib.data.buildDataPatch import hiiragi283.lib.item.ItemStack -import hiiragi283.lib.item.component.buildItemEnchantments import hiiragi283.lib.recipe.HTRecipeType import hiiragi283.lib.recipe.HTSerializableRecipe import hiiragi283.lib.recipe.base.HTDoubleItemToItemRecipe import hiiragi283.lib.recipe.base.HTProgressData import hiiragi283.lib.recipe.base.HTProgressRecipe import hiiragi283.lib.recipe.ingredient.HTItemIngredient +import hiiragi283.lib.recipe.result.HTItemResult import hiiragi283.lib.serialization.codec.HTCodecs -import hiiragi283.lib.serialization.network.HTStreamCodecs -import hiiragi283.lib.util.Either -import hiiragi283.lib.util.unwrap -import net.minecraft.core.Holder -import net.minecraft.core.component.DataComponents -import net.minecraft.core.registries.Registries import net.minecraft.network.RegistryFriendlyByteBuf import net.minecraft.network.codec.StreamCodec import net.minecraft.world.item.ItemInstance @@ -26,13 +19,11 @@ import net.minecraft.world.item.Items import net.minecraft.world.item.crafting.Ingredient import net.minecraft.world.item.crafting.RecipeInput import net.minecraft.world.item.crafting.RecipeSerializer -import net.minecraft.world.item.enchantment.Enchantment -import net.minecraft.world.item.enchantment.ItemEnchantments @JvmRecord data class RTEnchantingRecipe( val ingredient: HTItemIngredient, - val result: EnchantmentResult, + val result: HTItemResult, override val progressData: HTProgressData ) : HTDoubleItemToItemRecipe, HTProgressRecipe.Simple, @@ -45,7 +36,7 @@ data class RTEnchantingRecipe( val CODEC: MapCodec = HTCodecs.recordMap { instance -> instance.group( HTItemIngredient.CODEC.fieldOf(HTConstants.INGREDIENT).forGetter(RTEnchantingRecipe::ingredient), - EnchantmentResult.CODEC.fieldOf(HTConstants.RESULT).forGetter(RTEnchantingRecipe::result), + HTItemResult.CODEC.fieldOf(HTConstants.RESULT).forGetter(RTEnchantingRecipe::result), HTProgressData.CODEC.forGetter(RTEnchantingRecipe::progressData) ).apply(instance, ::RTEnchantingRecipe) } @@ -54,7 +45,7 @@ data class RTEnchantingRecipe( val STREAM_CODEC: StreamCodec = StreamCodec.composite( HTItemIngredient.STREAM_CODEC, RTEnchantingRecipe::ingredient, - EnchantmentResult.STREAM_CODEC, + HTItemResult.STREAM_CODEC, RTEnchantingRecipe::result, HTProgressData.STREAM_CODEC, RTEnchantingRecipe::progressData, @@ -76,28 +67,4 @@ data class RTEnchantingRecipe( override fun getSerializer(): RecipeSerializer = RagiumRecipeSerializers.ENCHANTING override fun getType(): HTRecipeType = RagiumRecipeTypes.ENCHANTING - - // EnchantmentResult // - - @JvmRecord - data class EnchantmentResult(val content: Either, ItemEnchantments>) { - companion object { - @JvmField - val CODEC: MapCodec = HTCodecs.mapEither( - HTCodecs.holder(Registries.ENCHANTMENT).fieldOf(HTConstants.ID), - ItemEnchantments.CODEC.fieldOf("enchantments") - ).xmap(::EnchantmentResult, EnchantmentResult::content) - - @JvmField - val STREAM_CODEC: StreamCodec = HTStreamCodecs - .either(HTStreamCodecs.holder(Registries.ENCHANTMENT), ItemEnchantments.STREAM_CODEC) - .map(::EnchantmentResult, EnchantmentResult::content) - } - - fun create(): ItemStack = content - .mapLeft { holder: Holder -> buildItemEnchantments { set(holder, holder.value().maxLevel) } } - .unwrap() - .let { buildDataPatch { set(DataComponents.STORED_ENCHANTMENTS, it) } } - .let { ItemStack(Items.ENCHANTED_BOOK, 1, it) } - } } diff --git a/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt b/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt index 1b19ca227..a39d63a89 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt @@ -137,6 +137,7 @@ data object Ragium : HTCommonMod() { event.register(RagiumRegistries.Keys.ITEM_RESULT_TYPE) { helper -> helper.register(RagiumAPI.id("simple"), HTItemResult.SimpleEntry.TYPE) helper.register(RagiumAPI.id(HTConstants.TAG), HTItemResult.TagEntry.TYPE) + helper.register(RagiumAPI.id("enchanted_book"), HTItemResult.EnchantedBookEntry.TYPE) } event.register(RagiumRegistries.Keys.SYNCABLE_SLOT_TYPE) { helper -> helper.register(RagiumAPI.id("integer"), HTIntSyncPayload.TYPE) From 84632967ff9c26735d2bbecd624fc655c86977a9 Mon Sep 17 00:00:00 2001 From: Hiiragi Russell Tsubasa <97942736+Hiiragi283@users.noreply.github.com> Date: Thu, 17 Sep 2026 23:51:50 +0900 Subject: [PATCH 2/7] =?UTF-8?q?refactor:=20`HTBottleType.filledItem`?= =?UTF-8?q?=E3=82=92`Item`=E3=81=8B=E3=82=89`HTSimpleDeferredItem`?= =?UTF-8?q?=E3=81=AB=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/integration/jei/RagiumJeiPlugin.kt | 5 ++--- .../lib/item/alchemy/HTBottleType.kt | 20 ++++++++----------- .../lib/item/alchemy/HTPotionHelper.kt | 4 ++-- .../recipe/RTPotionBottleFillingRecipe.kt | 3 +-- 4 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/client/kotlin/hiiragi283/ragium/client/integration/jei/RagiumJeiPlugin.kt b/src/client/kotlin/hiiragi283/ragium/client/integration/jei/RagiumJeiPlugin.kt index df6d2431c..85a718a1b 100644 --- a/src/client/kotlin/hiiragi283/ragium/client/integration/jei/RagiumJeiPlugin.kt +++ b/src/client/kotlin/hiiragi283/ragium/client/integration/jei/RagiumJeiPlugin.kt @@ -10,7 +10,6 @@ import hiiragi283.lib.integration.jei.category.HTItemToDoubleItemRecipeCategory import hiiragi283.lib.integration.jei.category.HTItemToItemAndFluidRecipeCategory import hiiragi283.lib.integration.jei.category.HTSingleRecipeCategory import hiiragi283.lib.item.HTPotionBasedItem -import hiiragi283.lib.item.ItemStack import hiiragi283.lib.item.alchemy.HTBottleType import hiiragi283.lib.item.alchemy.HTPotionHelper import hiiragi283.lib.recipe.ingredient.HTPotionFluidIngredient @@ -185,7 +184,7 @@ class RagiumJeiPlugin : HTJeiPlugin(RagiumAPI.MOD_ID) { HTBottleType.entries.map { bottleType: HTBottleType -> RagiumRecipeBuilders.draining { +HTJeiRecipeHelper.fakeItem( - ItemStack(bottleType.filledItem, 1, HTPotionHelper.createPotionPatch(potion)) + bottleType.filledItem.toStack(patch = HTPotionHelper.createPotionPatch(potion)) ) itemResult { +bottleType.emptyItem } fluidResult { from(HTPotionHelper.createFluid(potion, HTPotionHelper.BOTTLE_AMOUNT)) } @@ -208,7 +207,7 @@ class RagiumJeiPlugin : HTJeiPlugin(RagiumAPI.MOD_ID) { amount = HTPotionHelper.BOTTLE_AMOUNT } result { - from(ItemStack(bottleType.filledItem, 1, HTPotionHelper.createPotionPatch(potion))) + from(bottleType.filledItem.toStack(patch = HTPotionHelper.createPotionPatch(potion))) } recipeId replace potion.getKeyOrThrow() .identifier() diff --git a/src/lib/kotlin/hiiragi283/lib/item/alchemy/HTBottleType.kt b/src/lib/kotlin/hiiragi283/lib/item/alchemy/HTBottleType.kt index 92809feb8..63b96023b 100644 --- a/src/lib/kotlin/hiiragi283/lib/item/alchemy/HTBottleType.kt +++ b/src/lib/kotlin/hiiragi283/lib/item/alchemy/HTBottleType.kt @@ -4,23 +4,23 @@ import com.mojang.serialization.Codec import com.mojang.serialization.MapCodec import hiiragi283.lib.HTConstants import hiiragi283.lib.registry.HTSimpleDeferredItem +import hiiragi283.lib.resource.vanillaId import hiiragi283.lib.serialization.codec.HTCodecs import hiiragi283.lib.serialization.network.HTStreamCodecs import io.netty.buffer.ByteBuf import net.minecraft.network.codec.StreamCodec +import net.minecraft.resources.Identifier import net.minecraft.util.StringRepresentable -import net.minecraft.world.item.Item -import net.minecraft.world.item.Items /** * ポーション瓶の種類を管理するクラスです。 * @author Hiiragi Tsubasa * @since 26.1.0 */ -enum class HTBottleType : StringRepresentable { - DEFAULT, - SPLASH, - LINGERING +enum class HTBottleType(val filledItem: HTSimpleDeferredItem) : StringRepresentable { + DEFAULT(vanillaId("potion")), + SPLASH(vanillaId("splash_potion")), + LINGERING(vanillaId("lingering_potion")) ; companion object { @@ -34,18 +34,14 @@ enum class HTBottleType : StringRepresentable { val STREAM_CODEC: StreamCodec = HTStreamCodecs.enum() } + constructor(filledItem: Identifier) : this(HTSimpleDeferredItem(filledItem)) + val emptyItem: HTSimpleDeferredItem get() = when (this) { DEFAULT -> HTPotionFluidAccess.INSTANCE.glassBottle SPLASH -> HTPotionFluidAccess.INSTANCE.splashBottle LINGERING -> HTPotionFluidAccess.INSTANCE.lingeringBottle } - val filledItem: Item - get() = when (this) { - DEFAULT -> Items.POTION - SPLASH -> Items.SPLASH_POTION - LINGERING -> Items.LINGERING_POTION - } override fun getSerializedName(): String = name.lowercase() } diff --git a/src/lib/kotlin/hiiragi283/lib/item/alchemy/HTPotionHelper.kt b/src/lib/kotlin/hiiragi283/lib/item/alchemy/HTPotionHelper.kt index 7dcd0c269..f6c0f419d 100644 --- a/src/lib/kotlin/hiiragi283/lib/item/alchemy/HTPotionHelper.kt +++ b/src/lib/kotlin/hiiragi283/lib/item/alchemy/HTPotionHelper.kt @@ -81,7 +81,7 @@ data object HTPotionHelper { @JvmStatic fun getPotionName(contents: PotionContents, bottleType: HTBottleType): Text = - contents.getName("${bottleType.filledItem.descriptionId}.effect.") + contents.getName("${bottleType.filledItem.translationKey}.effect.") // ItemStack // @@ -97,7 +97,7 @@ data object HTPotionHelper { @JvmStatic fun createFilled(contents: PotionContents, bottleType: HTBottleType): ItemStackTemplate = - ItemStackTemplate(bottleType.filledItem, 1, createPotionPatch(contents)) + bottleType.filledItem.toTemplate(patch = createPotionPatch(contents))!! // Bucket diff --git a/src/main/kotlin/hiiragi283/ragium/common/recipe/RTPotionBottleFillingRecipe.kt b/src/main/kotlin/hiiragi283/ragium/common/recipe/RTPotionBottleFillingRecipe.kt index 4aea2ca51..3a3b07371 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/recipe/RTPotionBottleFillingRecipe.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/recipe/RTPotionBottleFillingRecipe.kt @@ -1,6 +1,5 @@ package hiiragi283.ragium.common.recipe -import hiiragi283.lib.item.ItemStack import hiiragi283.lib.item.alchemy.HTBottleType import hiiragi283.lib.item.alchemy.HTPotionHelper import hiiragi283.lib.recipe.base.HTItemAndFluidToItemRecipe @@ -24,7 +23,7 @@ data class RTPotionBottleFillingRecipe(val bottleType: HTBottleType, override va } override fun apply(first: ItemInstance, second: FluidInstance): ItemStack = - ItemStack(bottleType.filledItem, 1, HTPotionHelper.createPotionPatch(second)) + bottleType.filledItem.toStack(patch = HTPotionHelper.createPotionPatch(second)) override fun getRequiredAmount(first: ItemInstance, second: FluidInstance): Pair = when { test(first, second) -> 1 to HTPotionHelper.BOTTLE_AMOUNT From 0ef1245d280652c6a98d91da21d9f57e9eba722f Mon Sep 17 00:00:00 2001 From: Hiiragi Russell Tsubasa <97942736+Hiiragi283@users.noreply.github.com> Date: Thu, 17 Sep 2026 23:59:06 +0900 Subject: [PATCH 3/7] =?UTF-8?q?refactor:=20Ore=20Slurry=20Data=E9=96=A2?= =?UTF-8?q?=E9=80=A3=E3=81=AE=E3=82=AF=E3=83=A9=E3=82=B9=E3=81=AE=E3=83=91?= =?UTF-8?q?=E3=83=83=E3=82=B1=E3=83=BC=E3=82=B8=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/integration/jei/RagiumJeiPlugin.kt | 4 ++-- .../hiiragi283/ragium/data/RagiumDataGen.kt | 2 +- .../data/lang/RagiumEnglishLangProvider.kt | 2 +- .../data/lang/RagiumJapaneseLangProvider.kt | 2 +- .../lib/data/lang/HTLangProvider.kt | 2 +- .../hiiragi283/ragium/api/RagiumRegistries.kt | 2 +- .../ragium/api/data/RagiumDataComponents.kt | 2 +- .../ragium/api/data/map/RagiumDataMaps.kt | 22 ------------------- .../{recipe => oreSlurry}/HTOreSlurryData.kt | 2 +- .../HTOreSlurryDataHelper.kt | 2 +- .../HTOreSlurryFluidAccess.kt | 2 +- .../kotlin/hiiragi283/ragium/common/Ragium.kt | 4 ++-- .../RagiumOreSlurryData.kt | 4 ++-- .../RagiumOreSlurryFluidAccess.kt | 4 ++-- .../common/fluid/HTOreSlurryFluidType.kt | 2 +- .../common/item/HTOreSlurryBucketItem.kt | 2 +- .../common/recipe/RTOreSolvingRecipe.kt | 2 +- ....api.data.oreSlurry.HTOreSlurryFluidAccess | 1 + ...ium.api.data.recipe.HTOreSlurryFluidAccess | 1 - 19 files changed, 21 insertions(+), 43 deletions(-) delete mode 100644 src/lib/kotlin/hiiragi283/ragium/api/data/map/RagiumDataMaps.kt rename src/lib/kotlin/hiiragi283/ragium/api/data/{recipe => oreSlurry}/HTOreSlurryData.kt (97%) rename src/lib/kotlin/hiiragi283/ragium/api/data/{recipe => oreSlurry}/HTOreSlurryDataHelper.kt (97%) rename src/lib/kotlin/hiiragi283/ragium/api/data/{recipe => oreSlurry}/HTOreSlurryFluidAccess.kt (90%) rename src/main/kotlin/hiiragi283/ragium/common/data/{recipe => oreSlurry}/RagiumOreSlurryData.kt (94%) rename src/main/kotlin/hiiragi283/ragium/common/data/{recipe => oreSlurry}/RagiumOreSlurryFluidAccess.kt (67%) create mode 100644 src/main/resources/META-INF/services/hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryFluidAccess delete mode 100644 src/main/resources/META-INF/services/hiiragi283.ragium.api.data.recipe.HTOreSlurryFluidAccess diff --git a/src/client/kotlin/hiiragi283/ragium/client/integration/jei/RagiumJeiPlugin.kt b/src/client/kotlin/hiiragi283/ragium/client/integration/jei/RagiumJeiPlugin.kt index 85a718a1b..e0d375410 100644 --- a/src/client/kotlin/hiiragi283/ragium/client/integration/jei/RagiumJeiPlugin.kt +++ b/src/client/kotlin/hiiragi283/ragium/client/integration/jei/RagiumJeiPlugin.kt @@ -16,8 +16,8 @@ import hiiragi283.lib.recipe.ingredient.HTPotionFluidIngredient import hiiragi283.lib.registry.getKeyOrThrow import hiiragi283.ragium.api.RagiumAPI import hiiragi283.ragium.api.RagiumRegistries -import hiiragi283.ragium.api.data.recipe.HTOreSlurryData -import hiiragi283.ragium.api.data.recipe.HTOreSlurryDataHelper +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryData +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryDataHelper import hiiragi283.ragium.api.data.recipe.builder.RagiumRecipeBuilders import hiiragi283.ragium.api.recipe.RagiumRecipeLookups import hiiragi283.ragium.client.gui.screen.HTWidgetContainerScreen diff --git a/src/data/kotlin/hiiragi283/ragium/data/RagiumDataGen.kt b/src/data/kotlin/hiiragi283/ragium/data/RagiumDataGen.kt index 76360372a..6c6750c08 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/RagiumDataGen.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/RagiumDataGen.kt @@ -2,7 +2,7 @@ package hiiragi283.ragium.data import hiiragi283.lib.data.createLootTables import hiiragi283.ragium.api.RagiumRegistries -import hiiragi283.ragium.common.data.recipe.RagiumOreSlurryData +import hiiragi283.ragium.common.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.data.advancement.RagiumAdvancementProvider import hiiragi283.ragium.data.lang.RagiumEnglishLangProvider import hiiragi283.ragium.data.lang.RagiumJapaneseLangProvider diff --git a/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumEnglishLangProvider.kt b/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumEnglishLangProvider.kt index 569592be5..6e721b5b2 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumEnglishLangProvider.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumEnglishLangProvider.kt @@ -8,7 +8,7 @@ import hiiragi283.ragium.api.recipe.RagiumRecipeTypes import hiiragi283.ragium.api.text.RagiumTranslation import hiiragi283.ragium.common.advancment.RagiumAdvancementKeys import hiiragi283.ragium.common.block.RagiumBlocks -import hiiragi283.ragium.common.data.recipe.RagiumOreSlurryData +import hiiragi283.ragium.common.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.common.effect.RagiumMobEffects import hiiragi283.ragium.common.fluid.RagiumFluids import hiiragi283.ragium.common.item.RagiumItems diff --git a/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumJapaneseLangProvider.kt b/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumJapaneseLangProvider.kt index e129360a3..23207d2bb 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumJapaneseLangProvider.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumJapaneseLangProvider.kt @@ -8,7 +8,7 @@ import hiiragi283.ragium.api.recipe.RagiumRecipeTypes import hiiragi283.ragium.api.text.RagiumTranslation import hiiragi283.ragium.common.advancment.RagiumAdvancementKeys import hiiragi283.ragium.common.block.RagiumBlocks -import hiiragi283.ragium.common.data.recipe.RagiumOreSlurryData +import hiiragi283.ragium.common.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.common.effect.RagiumMobEffects import hiiragi283.ragium.common.fluid.RagiumFluids import hiiragi283.ragium.common.item.RagiumItems diff --git a/src/lib/kotlin/hiiragi283/lib/data/lang/HTLangProvider.kt b/src/lib/kotlin/hiiragi283/lib/data/lang/HTLangProvider.kt index 41fc92a52..ec589b17a 100644 --- a/src/lib/kotlin/hiiragi283/lib/data/lang/HTLangProvider.kt +++ b/src/lib/kotlin/hiiragi283/lib/data/lang/HTLangProvider.kt @@ -7,7 +7,7 @@ import hiiragi283.lib.registry.HTFluidContent import hiiragi283.lib.registry.HTPotionContent import hiiragi283.lib.resource.toLanguageKey import hiiragi283.lib.text.HTHasTranslationKey -import hiiragi283.ragium.api.data.recipe.HTOreSlurryData +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryData import net.minecraft.data.PackOutput import net.minecraft.resources.ResourceKey import net.minecraft.world.item.enchantment.Enchantment diff --git a/src/lib/kotlin/hiiragi283/ragium/api/RagiumRegistries.kt b/src/lib/kotlin/hiiragi283/ragium/api/RagiumRegistries.kt index b4f9115b1..5eb92e942 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/RagiumRegistries.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/RagiumRegistries.kt @@ -5,7 +5,7 @@ import hiiragi283.lib.gui.widget.HTWidgetType import hiiragi283.lib.recipe.result.HTFluidResultType import hiiragi283.lib.recipe.result.HTItemResultType import hiiragi283.lib.resource.toId -import hiiragi283.ragium.api.data.recipe.HTOreSlurryData +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryData import net.minecraft.core.Registry import net.minecraft.resources.ResourceKey import net.neoforged.bus.api.SubscribeEvent diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/RagiumDataComponents.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/RagiumDataComponents.kt index 248490035..4898d2b0e 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/RagiumDataComponents.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/data/RagiumDataComponents.kt @@ -4,7 +4,7 @@ import hiiragi283.lib.data.DataComponentType import hiiragi283.lib.serialization.codec.HTCodecs import hiiragi283.lib.serialization.network.HTStreamCodecs import hiiragi283.ragium.api.RagiumRegistries -import hiiragi283.ragium.api.data.recipe.HTOreSlurryData +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryData import net.minecraft.core.Holder import net.minecraft.core.component.DataComponentType import net.minecraft.network.codec.ByteBufCodecs diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/map/RagiumDataMaps.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/map/RagiumDataMaps.kt deleted file mode 100644 index c6f1466ca..000000000 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/map/RagiumDataMaps.kt +++ /dev/null @@ -1,22 +0,0 @@ -package hiiragi283.ragium.api.data.map - -import com.mojang.serialization.Codec -import hiiragi283.ragium.api.RagiumAPI -import net.minecraft.core.Registry -import net.minecraft.resources.ResourceKey -import net.neoforged.neoforge.registries.datamaps.DataMapType - -/** - * Ragiumで使用される[DataMapType]をまとめたクラスです。 - * @author Hiiragi Tsubasa - * @since 26.1.0 - */ -data object RagiumDataMaps { - - @JvmStatic - fun register( - name: String, - registryKey: ResourceKey>, - codec: Codec - ): DataMapType = DataMapType.builder(RagiumAPI.id(name), registryKey, codec).synced(codec, false).build() -} diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/HTOreSlurryData.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryData.kt similarity index 97% rename from src/lib/kotlin/hiiragi283/ragium/api/data/recipe/HTOreSlurryData.kt rename to src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryData.kt index d581e65da..eb92d131b 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/HTOreSlurryData.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryData.kt @@ -1,4 +1,4 @@ -package hiiragi283.ragium.api.data.recipe +package hiiragi283.ragium.api.data.oreSlurry import com.mojang.serialization.Codec import hiiragi283.lib.HTConstants diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/HTOreSlurryDataHelper.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryDataHelper.kt similarity index 97% rename from src/lib/kotlin/hiiragi283/ragium/api/data/recipe/HTOreSlurryDataHelper.kt rename to src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryDataHelper.kt index c25982368..3d31d0f9f 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/HTOreSlurryDataHelper.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryDataHelper.kt @@ -1,4 +1,4 @@ -package hiiragi283.ragium.api.data.recipe +package hiiragi283.ragium.api.data.oreSlurry import hiiragi283.lib.data.buildDataPatch import hiiragi283.lib.text.Text diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/HTOreSlurryFluidAccess.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryFluidAccess.kt similarity index 90% rename from src/lib/kotlin/hiiragi283/ragium/api/data/recipe/HTOreSlurryFluidAccess.kt rename to src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryFluidAccess.kt index 7d6939456..85ec3ac7c 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/HTOreSlurryFluidAccess.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryFluidAccess.kt @@ -1,4 +1,4 @@ -package hiiragi283.ragium.api.data.recipe +package hiiragi283.ragium.api.data.oreSlurry import hiiragi283.lib.registry.HTFluidContent import hiiragi283.ragium.api.RagiumAPI diff --git a/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt b/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt index a39d63a89..a87ff483f 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt @@ -18,7 +18,7 @@ import hiiragi283.ragium.api.RagiumAPI import hiiragi283.ragium.api.RagiumConfig import hiiragi283.ragium.api.RagiumRegistries import hiiragi283.ragium.api.data.RagiumDataComponents -import hiiragi283.ragium.api.data.recipe.HTOreSlurryData +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryData import hiiragi283.ragium.api.material.HTBlockPart import hiiragi283.ragium.api.material.RagiumMaterial import hiiragi283.ragium.api.recipe.RagiumRecipeSerializers @@ -27,7 +27,7 @@ import hiiragi283.ragium.api.text.RagiumTranslation import hiiragi283.ragium.common.block.RagiumBlocks import hiiragi283.ragium.common.block.entity.RagiumBlockEntityTypes import hiiragi283.ragium.common.block.entity.machine.HTProcessorBlockEntity -import hiiragi283.ragium.common.data.recipe.RagiumOreSlurryData +import hiiragi283.ragium.common.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.common.effect.RagiumMobEffects import hiiragi283.ragium.common.fluid.RagiumFluids import hiiragi283.ragium.common.gui.factory.HTBlockWidgetHolderContext diff --git a/src/main/kotlin/hiiragi283/ragium/common/data/recipe/RagiumOreSlurryData.kt b/src/main/kotlin/hiiragi283/ragium/common/data/oreSlurry/RagiumOreSlurryData.kt similarity index 94% rename from src/main/kotlin/hiiragi283/ragium/common/data/recipe/RagiumOreSlurryData.kt rename to src/main/kotlin/hiiragi283/ragium/common/data/oreSlurry/RagiumOreSlurryData.kt index edd420bde..8c2c9af84 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/data/recipe/RagiumOreSlurryData.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/data/oreSlurry/RagiumOreSlurryData.kt @@ -1,11 +1,11 @@ -package hiiragi283.ragium.common.data.recipe +package hiiragi283.ragium.common.data.oreSlurry import hiiragi283.lib.registry.createKey import hiiragi283.lib.resource.toLanguageKey import hiiragi283.lib.text.translatableText import hiiragi283.ragium.api.RagiumAPI import hiiragi283.ragium.api.RagiumRegistries -import hiiragi283.ragium.api.data.recipe.HTOreSlurryData +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryData import hiiragi283.ragium.api.material.HTItemPart import hiiragi283.ragium.api.material.RagiumMaterial import hiiragi283.ragium.common.item.RagiumItems diff --git a/src/main/kotlin/hiiragi283/ragium/common/data/recipe/RagiumOreSlurryFluidAccess.kt b/src/main/kotlin/hiiragi283/ragium/common/data/oreSlurry/RagiumOreSlurryFluidAccess.kt similarity index 67% rename from src/main/kotlin/hiiragi283/ragium/common/data/recipe/RagiumOreSlurryFluidAccess.kt rename to src/main/kotlin/hiiragi283/ragium/common/data/oreSlurry/RagiumOreSlurryFluidAccess.kt index 4b2658f68..fff47b235 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/data/recipe/RagiumOreSlurryFluidAccess.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/data/oreSlurry/RagiumOreSlurryFluidAccess.kt @@ -1,7 +1,7 @@ -package hiiragi283.ragium.common.data.recipe +package hiiragi283.ragium.common.data.oreSlurry import hiiragi283.lib.registry.HTFluidContent -import hiiragi283.ragium.api.data.recipe.HTOreSlurryFluidAccess +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryFluidAccess import hiiragi283.ragium.common.fluid.RagiumFluids class RagiumOreSlurryFluidAccess : HTOreSlurryFluidAccess { diff --git a/src/main/kotlin/hiiragi283/ragium/common/fluid/HTOreSlurryFluidType.kt b/src/main/kotlin/hiiragi283/ragium/common/fluid/HTOreSlurryFluidType.kt index 4e8cd5d48..a37302eb1 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/fluid/HTOreSlurryFluidType.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/fluid/HTOreSlurryFluidType.kt @@ -1,7 +1,7 @@ package hiiragi283.ragium.common.fluid import hiiragi283.lib.fluid.HTFluidType -import hiiragi283.ragium.api.data.recipe.HTOreSlurryDataHelper +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryDataHelper import net.minecraft.network.chat.Component import net.minecraft.world.item.ItemStack import net.neoforged.neoforge.fluids.FluidStack diff --git a/src/main/kotlin/hiiragi283/ragium/common/item/HTOreSlurryBucketItem.kt b/src/main/kotlin/hiiragi283/ragium/common/item/HTOreSlurryBucketItem.kt index e2dcd4fe1..8f9ae32b4 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/item/HTOreSlurryBucketItem.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/item/HTOreSlurryBucketItem.kt @@ -4,7 +4,7 @@ import hiiragi283.lib.item.HTSubCreativeTabContents import hiiragi283.lib.text.Text import hiiragi283.lib.text.translatableText import hiiragi283.ragium.api.RagiumRegistries -import hiiragi283.ragium.api.data.recipe.HTOreSlurryDataHelper +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryDataHelper import hiiragi283.ragium.common.transfer.item.HTCustomBucketItemHandler import net.minecraft.core.Holder import net.minecraft.network.chat.Component diff --git a/src/main/kotlin/hiiragi283/ragium/common/recipe/RTOreSolvingRecipe.kt b/src/main/kotlin/hiiragi283/ragium/common/recipe/RTOreSolvingRecipe.kt index c902411d9..7a43af19c 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/recipe/RTOreSolvingRecipe.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/recipe/RTOreSolvingRecipe.kt @@ -5,7 +5,7 @@ import hiiragi283.lib.recipe.base.HTProgressData import hiiragi283.lib.recipe.base.HTProgressRecipe import hiiragi283.lib.recipe.input.HTItemAndFluidRecipeInput import hiiragi283.ragium.api.data.RagiumDataComponents -import hiiragi283.ragium.api.data.recipe.HTOreSlurryDataHelper +import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryDataHelper import hiiragi283.ragium.common.fluid.RagiumFluids import net.minecraft.world.item.ItemInstance import net.neoforged.neoforge.fluids.FluidInstance diff --git a/src/main/resources/META-INF/services/hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryFluidAccess b/src/main/resources/META-INF/services/hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryFluidAccess new file mode 100644 index 000000000..9d6970eab --- /dev/null +++ b/src/main/resources/META-INF/services/hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryFluidAccess @@ -0,0 +1 @@ +hiiragi283.ragium.common.data.oreSlurry.RagiumOreSlurryFluidAccess diff --git a/src/main/resources/META-INF/services/hiiragi283.ragium.api.data.recipe.HTOreSlurryFluidAccess b/src/main/resources/META-INF/services/hiiragi283.ragium.api.data.recipe.HTOreSlurryFluidAccess deleted file mode 100644 index d0d151675..000000000 --- a/src/main/resources/META-INF/services/hiiragi283.ragium.api.data.recipe.HTOreSlurryFluidAccess +++ /dev/null @@ -1 +0,0 @@ -hiiragi283.ragium.common.data.recipe.RagiumOreSlurryFluidAccess From 0f7096d9c69319cbf36d1fdb77e7136f341df5a1 Mon Sep 17 00:00:00 2001 From: Hiiragi Russell Tsubasa <97942736+Hiiragi283@users.noreply.github.com> Date: Fri, 18 Sep 2026 00:09:21 +0900 Subject: [PATCH 4/7] =?UTF-8?q?refactor:=20RagiumOreSlurryData=E3=82=92api?= =?UTF-8?q?=E3=83=A2=E3=82=B8=E3=83=A5=E3=83=BC=E3=83=AB=E3=81=AB=E7=A7=BB?= =?UTF-8?q?=E5=8B=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kotlin/hiiragi283/ragium/data/RagiumDataGen.kt | 2 +- .../ragium/data/lang/RagiumEnglishLangProvider.kt | 2 +- .../ragium/data/lang/RagiumJapaneseLangProvider.kt | 2 +- .../api}/data/oreSlurry/RagiumOreSlurryData.kt | 12 ++++++++---- src/main/kotlin/hiiragi283/ragium/common/Ragium.kt | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) rename src/{main/kotlin/hiiragi283/ragium/common => lib/kotlin/hiiragi283/ragium/api}/data/oreSlurry/RagiumOreSlurryData.kt (85%) diff --git a/src/data/kotlin/hiiragi283/ragium/data/RagiumDataGen.kt b/src/data/kotlin/hiiragi283/ragium/data/RagiumDataGen.kt index 6c6750c08..179727f72 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/RagiumDataGen.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/RagiumDataGen.kt @@ -2,7 +2,7 @@ package hiiragi283.ragium.data import hiiragi283.lib.data.createLootTables import hiiragi283.ragium.api.RagiumRegistries -import hiiragi283.ragium.common.data.oreSlurry.RagiumOreSlurryData +import hiiragi283.ragium.api.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.data.advancement.RagiumAdvancementProvider import hiiragi283.ragium.data.lang.RagiumEnglishLangProvider import hiiragi283.ragium.data.lang.RagiumJapaneseLangProvider diff --git a/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumEnglishLangProvider.kt b/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumEnglishLangProvider.kt index 6e721b5b2..b0b649060 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumEnglishLangProvider.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumEnglishLangProvider.kt @@ -4,11 +4,11 @@ import hiiragi283.lib.data.lang.HTLangProvider import hiiragi283.lib.data.lang.HTLangTypes import hiiragi283.lib.text.HTCommonTranslation import hiiragi283.ragium.api.RagiumAPI +import hiiragi283.ragium.api.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.api.recipe.RagiumRecipeTypes import hiiragi283.ragium.api.text.RagiumTranslation import hiiragi283.ragium.common.advancment.RagiumAdvancementKeys import hiiragi283.ragium.common.block.RagiumBlocks -import hiiragi283.ragium.common.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.common.effect.RagiumMobEffects import hiiragi283.ragium.common.fluid.RagiumFluids import hiiragi283.ragium.common.item.RagiumItems diff --git a/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumJapaneseLangProvider.kt b/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumJapaneseLangProvider.kt index 23207d2bb..b8f40fc08 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumJapaneseLangProvider.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/lang/RagiumJapaneseLangProvider.kt @@ -4,11 +4,11 @@ import hiiragi283.lib.data.lang.HTLangProvider import hiiragi283.lib.data.lang.HTLangTypes import hiiragi283.lib.text.HTCommonTranslation import hiiragi283.ragium.api.RagiumAPI +import hiiragi283.ragium.api.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.api.recipe.RagiumRecipeTypes import hiiragi283.ragium.api.text.RagiumTranslation import hiiragi283.ragium.common.advancment.RagiumAdvancementKeys import hiiragi283.ragium.common.block.RagiumBlocks -import hiiragi283.ragium.common.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.common.effect.RagiumMobEffects import hiiragi283.ragium.common.fluid.RagiumFluids import hiiragi283.ragium.common.item.RagiumItems diff --git a/src/main/kotlin/hiiragi283/ragium/common/data/oreSlurry/RagiumOreSlurryData.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/RagiumOreSlurryData.kt similarity index 85% rename from src/main/kotlin/hiiragi283/ragium/common/data/oreSlurry/RagiumOreSlurryData.kt rename to src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/RagiumOreSlurryData.kt index 8c2c9af84..4525bfa6e 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/data/oreSlurry/RagiumOreSlurryData.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/RagiumOreSlurryData.kt @@ -1,14 +1,13 @@ -package hiiragi283.ragium.common.data.oreSlurry +package hiiragi283.ragium.api.data.oreSlurry import hiiragi283.lib.registry.createKey import hiiragi283.lib.resource.toLanguageKey import hiiragi283.lib.text.translatableText import hiiragi283.ragium.api.RagiumAPI import hiiragi283.ragium.api.RagiumRegistries -import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryData import hiiragi283.ragium.api.material.HTItemPart +import hiiragi283.ragium.api.material.HTMaterialAccess import hiiragi283.ragium.api.material.RagiumMaterial -import hiiragi283.ragium.common.item.RagiumItems import net.minecraft.core.Holder import net.minecraft.core.HolderGetter import net.minecraft.core.registries.Registries @@ -43,7 +42,12 @@ data object RagiumOreSlurryData { } fun register(key: ResourceKey, part: HTItemPart, material: RagiumMaterial, count: Int = 1) { - register(key, part.tagPrefix.itemTagKey(material), RagiumItems.getOrThrow(part, material), count) + register( + key, + part.tagPrefix.itemTagKey(material), + HTMaterialAccess.INSTANCE.getMaterialItem(part, material)?.item, + count + ) } register(COPPER, HTItemPart.DUST, RagiumMaterial.Metal.COPPER, 3) diff --git a/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt b/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt index a87ff483f..81b54a613 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt @@ -19,6 +19,7 @@ import hiiragi283.ragium.api.RagiumConfig import hiiragi283.ragium.api.RagiumRegistries import hiiragi283.ragium.api.data.RagiumDataComponents import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryData +import hiiragi283.ragium.api.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.api.material.HTBlockPart import hiiragi283.ragium.api.material.RagiumMaterial import hiiragi283.ragium.api.recipe.RagiumRecipeSerializers @@ -27,7 +28,6 @@ import hiiragi283.ragium.api.text.RagiumTranslation import hiiragi283.ragium.common.block.RagiumBlocks import hiiragi283.ragium.common.block.entity.RagiumBlockEntityTypes import hiiragi283.ragium.common.block.entity.machine.HTProcessorBlockEntity -import hiiragi283.ragium.common.data.oreSlurry.RagiumOreSlurryData import hiiragi283.ragium.common.effect.RagiumMobEffects import hiiragi283.ragium.common.fluid.RagiumFluids import hiiragi283.ragium.common.gui.factory.HTBlockWidgetHolderContext From b6606f1e7ab58b6245f24f1536db5bf7248821ef Mon Sep 17 00:00:00 2001 From: Hiiragi Russell Tsubasa <97942736+Hiiragi283@users.noreply.github.com> Date: Fri, 18 Sep 2026 00:11:51 +0900 Subject: [PATCH 5/7] =?UTF-8?q?refactor:=20=E3=82=B3=E3=83=BC=E3=83=89?= =?UTF-8?q?=E3=81=AE=E6=95=B4=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ragium/data/recipe/RagiumArcaneRecipeProvider.kt | 4 +--- .../lib/data/recipe/result/HTItemResultBuilder.kt | 10 ++++++++++ .../hiiragi283/ragium/api/recipe/RTEnchantingRecipe.kt | 1 - 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumArcaneRecipeProvider.kt b/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumArcaneRecipeProvider.kt index 241855885..7914fa1f2 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumArcaneRecipeProvider.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumArcaneRecipeProvider.kt @@ -23,9 +23,7 @@ class RagiumArcaneRecipeProvider(packOutput: PackOutput, future: CompletableFutu +holderSet(CommonTagPrefixes.INGOT, RagiumMaterial.Metal.IRON) count = 64 } - result { - +registries.getOrThrow(Enchantments.PROTECTION) - } + result { +registries.getOrThrow(Enchantments.PROTECTION) } }.save(exporter) // Diamond -> Protection + Unbreaking RagiumRecipeBuilders.enchanting { diff --git a/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTItemResultBuilder.kt b/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTItemResultBuilder.kt index eea0b7d30..549a9aaa4 100644 --- a/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTItemResultBuilder.kt +++ b/src/lib/kotlin/hiiragi283/lib/data/recipe/result/HTItemResultBuilder.kt @@ -86,15 +86,25 @@ class HTItemResultBuilder @PublishedApi internal constructor() { } // Enchanted Book + + /** + * @since 26.1.6 + */ @JvmName("unaryPlusEnchantment") operator fun Holder.unaryPlus() { +HTItemResult.EnchantedBookEntry(this) } + /** + * @since 26.1.6 + */ operator fun ItemEnchantments.unaryPlus() { +HTItemResult.EnchantedBookEntry(this) } + /** + * @since 26.1.6 + */ inline fun enchantedBook(builderAction: ItemEnchantments.Mutable.() -> Unit) { +buildItemEnchantments(builderAction = builderAction) } diff --git a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTEnchantingRecipe.kt b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTEnchantingRecipe.kt index ac9612e37..d2056fcbf 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTEnchantingRecipe.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTEnchantingRecipe.kt @@ -2,7 +2,6 @@ package hiiragi283.ragium.api.recipe import com.mojang.serialization.MapCodec import hiiragi283.lib.HTConstants -import hiiragi283.lib.item.ItemStack import hiiragi283.lib.recipe.HTRecipeType import hiiragi283.lib.recipe.HTSerializableRecipe import hiiragi283.lib.recipe.base.HTDoubleItemToItemRecipe From 2e85b5ca539a38c0c841e3c0db95e89e0ceed9f2 Mon Sep 17 00:00:00 2001 From: Hiiragi Russell Tsubasa <97942736+Hiiragi283@users.noreply.github.com> Date: Fri, 18 Sep 2026 00:30:31 +0900 Subject: [PATCH 6/7] =?UTF-8?q?feat:=20RagiumDataComponents.ORE=5FSLURRY?= =?UTF-8?q?=5FDATA=E3=81=8C`Holder.Direct`=E3=82=92?= =?UTF-8?q?=E5=8F=97=E3=81=91=E5=8F=96=E3=82=8C=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/serialization/codec/HTCodecs.kt | 21 +++++++++++++-- .../serialization/network/HTStreamCodecs.kt | 12 +++++++++ .../ragium/api/data/RagiumDataComponents.kt | 8 ++---- .../api/data/oreSlurry/HTOreSlurryData.kt | 27 ++++++++++++++++++- .../kotlin/hiiragi283/ragium/common/Ragium.kt | 6 ++++- 5 files changed, 64 insertions(+), 10 deletions(-) diff --git a/src/lib/kotlin/hiiragi283/lib/serialization/codec/HTCodecs.kt b/src/lib/kotlin/hiiragi283/lib/serialization/codec/HTCodecs.kt index d8b91449d..8bd980ac1 100644 --- a/src/lib/kotlin/hiiragi283/lib/serialization/codec/HTCodecs.kt +++ b/src/lib/kotlin/hiiragi283/lib/serialization/codec/HTCodecs.kt @@ -21,6 +21,7 @@ import net.minecraft.core.HolderSet import net.minecraft.core.RegistryCodecs import net.minecraft.core.UUIDUtil import net.minecraft.network.chat.ComponentSerialization +import net.minecraft.resources.RegistryFileCodec import net.minecraft.resources.RegistryFixedCodec import net.minecraft.resources.ResourceKey import net.minecraft.tags.TagKey @@ -246,6 +247,16 @@ data object HTCodecs { @JvmStatic fun holder(registryKey: RegistryKey): Codec> = RegistryFixedCodec.create(registryKey) + /** + * 指定した[registryKey]から[Holder]の[Codec]を返します。 + * @param T レジストリの要素のクラス + * @param directCodec [Holder.Direct]に対する[Codec] + * @since 26.1.6 + */ + @JvmStatic + fun holder(registryKey: RegistryKey, directCodec: Codec): Codec> = + RegistryFileCodec.create(registryKey, directCodec) + /** * 指定した[registryKey]から[HolderSet]の[Codec]を返します。 * @param T レジストリの要素のクラス @@ -254,7 +265,13 @@ data object HTCodecs { fun holderSet(registryKey: RegistryKey): Codec> = RegistryCodecs.homogeneousList(registryKey) + /** + * 指定した[registryKey]から[HolderSet]の[Codec]を返します。 + * @param T レジストリの要素のクラス + * @param directCodec [Holder.Direct]に対する[Codec] + * @since 26.1.6 + */ @JvmStatic - fun holderSet(registryKey: RegistryKey, element: Codec): Codec> = - RegistryCodecs.homogeneousList(registryKey, element) + fun holderSet(registryKey: RegistryKey, directCodec: Codec): Codec> = + RegistryCodecs.homogeneousList(registryKey, directCodec) } diff --git a/src/lib/kotlin/hiiragi283/lib/serialization/network/HTStreamCodecs.kt b/src/lib/kotlin/hiiragi283/lib/serialization/network/HTStreamCodecs.kt index 135be3290..9fa7ea0ba 100644 --- a/src/lib/kotlin/hiiragi283/lib/serialization/network/HTStreamCodecs.kt +++ b/src/lib/kotlin/hiiragi283/lib/serialization/network/HTStreamCodecs.kt @@ -177,6 +177,18 @@ data object HTStreamCodecs { fun holder(registryKey: RegistryKey): StreamCodec> = ByteBufCodecs.holderRegistry(registryKey) + /** + * 指定した[registryKey]から[Holder]の[StreamCodec]を返します。 + * @param T レジストリの要素のクラス + * @param directCodec [Holder.Direct]に対する[StreamCodec] + * @since 26.1.6 + */ + @JvmStatic + fun holder( + registryKey: RegistryKey, + directCodec: StreamCodec + ): StreamCodec> = ByteBufCodecs.holder(registryKey, directCodec) + /** * 指定した[registryKey]から[HolderSet]の[StreamCodec]を返します。 * @param T レジストリの要素のクラス diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/RagiumDataComponents.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/RagiumDataComponents.kt index 4898d2b0e..1d3675034 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/RagiumDataComponents.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/data/RagiumDataComponents.kt @@ -2,8 +2,6 @@ package hiiragi283.ragium.api.data import hiiragi283.lib.data.DataComponentType import hiiragi283.lib.serialization.codec.HTCodecs -import hiiragi283.lib.serialization.network.HTStreamCodecs -import hiiragi283.ragium.api.RagiumRegistries import hiiragi283.ragium.api.data.oreSlurry.HTOreSlurryData import net.minecraft.core.Holder import net.minecraft.core.component.DataComponentType @@ -35,8 +33,6 @@ data object RagiumDataComponents { * @since 26.1.5 */ @JvmField - val ORE_SLURRY_DATA: DataComponentType> = DataComponentType( - HTCodecs.holder(RagiumRegistries.Keys.ORE_SLURRY_DATA), - HTStreamCodecs.holder(RagiumRegistries.Keys.ORE_SLURRY_DATA) - ) + val ORE_SLURRY_DATA: DataComponentType> = + DataComponentType(HTOreSlurryData.CODEC, HTOreSlurryData.STREAM_CODEC) } diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryData.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryData.kt index eb92d131b..b267dbbcb 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryData.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/data/oreSlurry/HTOreSlurryData.kt @@ -4,11 +4,16 @@ import com.mojang.serialization.Codec import hiiragi283.lib.HTConstants import hiiragi283.lib.recipe.result.HTItemResult import hiiragi283.lib.serialization.codec.HTCodecs +import hiiragi283.lib.serialization.network.HTStreamCodecs import hiiragi283.lib.text.Text import hiiragi283.lib.util.toOptional +import hiiragi283.ragium.api.RagiumRegistries import net.minecraft.core.Holder import net.minecraft.core.HolderSet import net.minecraft.core.registries.Registries +import net.minecraft.network.RegistryFriendlyByteBuf +import net.minecraft.network.codec.ByteBufCodecs +import net.minecraft.network.codec.StreamCodec import net.minecraft.world.item.Item import net.minecraft.world.item.ItemStackTemplate import java.util.Optional @@ -27,7 +32,7 @@ data class HTOreSlurryData @JvmOverloads constructor( ) { companion object { @JvmField - val CODEC: Codec = HTCodecs.record { instance -> + val DIRECT_CODEC: Codec = HTCodecs.record { instance -> instance.group( HTCodecs.TEXT.fieldOf("title").forGetter(HTOreSlurryData::title), HTCodecs.holderSet(Registries.ITEM).fieldOf(HTConstants.RESULT).forGetter(HTOreSlurryData::result), @@ -35,6 +40,26 @@ data class HTOreSlurryData @JvmOverloads constructor( HTCodecs.POSITIVE_INT.optionalFieldOf(HTConstants.COUNT, 1).forGetter(HTOreSlurryData::count) ).apply(instance, ::HTOreSlurryData) } + + @JvmField + val CODEC: Codec> = HTCodecs.holder(RagiumRegistries.Keys.ORE_SLURRY_DATA, DIRECT_CODEC) + + @JvmField + val DIRECT_STREAM_CODEC: StreamCodec = StreamCodec.composite( + HTStreamCodecs.TEXT, + HTOreSlurryData::title, + HTStreamCodecs.holderSet(Registries.ITEM), + HTOreSlurryData::result, + HTStreamCodecs.optional(Item.STREAM_CODEC), + HTOreSlurryData::fallback, + ByteBufCodecs.VAR_INT, + HTOreSlurryData::count, + ::HTOreSlurryData + ) + + @JvmField + val STREAM_CODEC: StreamCodec> = + HTStreamCodecs.holder(RagiumRegistries.Keys.ORE_SLURRY_DATA, DIRECT_STREAM_CODEC) } @JvmOverloads constructor(title: Text, result: HolderSet, fallback: Holder?, count: Int = 1) : this( diff --git a/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt b/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt index 81b54a613..c8a03544a 100644 --- a/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt +++ b/src/main/kotlin/hiiragi283/ragium/common/Ragium.kt @@ -180,7 +180,11 @@ data object Ragium : HTCommonMod() { } override fun registerDynamicRegistries(event: DataPackRegistryEvent.NewRegistry) { - event.dataPackRegistry(RagiumRegistries.Keys.ORE_SLURRY_DATA, HTOreSlurryData.CODEC, HTOreSlurryData.CODEC) + event.dataPackRegistry( + RagiumRegistries.Keys.ORE_SLURRY_DATA, + HTOreSlurryData.DIRECT_CODEC, + HTOreSlurryData.DIRECT_CODEC + ) } override fun commonSetup(event: FMLCommonSetupEvent) { From 87594e52d6db5e55e92b0176d39105d2fb8c158d Mon Sep 17 00:00:00 2001 From: Hiiragi Russell Tsubasa <97942736+Hiiragi283@users.noreply.github.com> Date: Fri, 18 Sep 2026 19:51:09 +0900 Subject: [PATCH 7/7] =?UTF-8?q?feat:=20NonEmptyList=20/=20Nel=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data/recipe/RagiumBioRecipeProvider.kt | 12 +-- .../recipe/RagiumMechanicalRecipeProvider.kt | 78 +++++++++---------- .../crushing/amethyst_dust_from_gem.json | 2 +- .../recipe/crushing/amethyst_shard.json | 2 +- .../ragium/recipe/crushing/black_dye.json | 2 +- .../ragium/recipe/crushing/blaze_powder.json | 2 +- .../data/ragium/recipe/crushing/blue_dye.json | 2 +- .../data/ragium/recipe/crushing/brick.json | 2 +- .../ragium/recipe/crushing/brown_dye.json | 2 +- .../ragium/recipe/crushing/charcoal_dust.json | 2 +- .../ragium/recipe/crushing/clay_ball.json | 2 +- .../recipe/crushing/coal_coke_dust.json | 2 +- .../ragium/recipe/crushing/coal_dust.json | 2 +- .../recipe/crushing/coal_dust_from_ore.json | 18 +++-- .../crushing/copper_dust_from_gear.json | 2 +- .../crushing/copper_dust_from_ingot.json | 2 +- .../recipe/crushing/copper_dust_from_ore.json | 18 +++-- .../recipe/crushing/copper_dust_from_raw.json | 2 +- .../crushing/diamond_dust_from_gear.json | 2 +- .../crushing/diamond_dust_from_gem.json | 2 +- .../crushing/diamond_dust_from_ore.json | 2 +- .../recipe/crushing/double_cyan_dye.json | 2 +- .../recipe/crushing/double_pink_dye.json | 2 +- .../recipe/crushing/double_red_dye.json | 2 +- .../recipe/crushing/double_yellow_dye.json | 2 +- .../recipe/crushing/echo_dust_from_gem.json | 2 +- .../crushing/emerald_dust_from_gear.json | 2 +- .../crushing/emerald_dust_from_gem.json | 2 +- .../crushing/emerald_dust_from_ore.json | 2 +- .../crushing/glass_dust_from_block.json | 2 +- .../recipe/crushing/glass_dust_from_pane.json | 2 +- .../recipe/crushing/glowstone_dust.json | 2 +- .../recipe/crushing/gold_dust_from_gear.json | 2 +- .../recipe/crushing/gold_dust_from_ingot.json | 2 +- .../recipe/crushing/gold_dust_from_ore.json | 2 +- .../recipe/crushing/gold_dust_from_raw.json | 2 +- .../data/ragium/recipe/crushing/gray_dye.json | 2 +- .../ragium/recipe/crushing/green_dye.json | 2 +- .../ragium/recipe/crushing/honeycomb.json | 2 +- .../recipe/crushing/iron_dust_from_gear.json | 2 +- .../recipe/crushing/iron_dust_from_ingot.json | 2 +- .../recipe/crushing/iron_dust_from_ore.json | 18 +++-- .../recipe/crushing/iron_dust_from_raw.json | 2 +- .../recipe/crushing/lapis_dust_from_gem.json | 2 +- .../recipe/crushing/lapis_dust_from_ore.json | 2 +- .../recipe/crushing/light_blue_dye.json | 2 +- .../recipe/crushing/light_gray_dye.json | 2 +- .../data/ragium/recipe/crushing/lime_dye.json | 2 +- .../ragium/recipe/crushing/magenta_dye.json | 2 +- .../ragium/recipe/crushing/magma_cream.json | 2 +- .../ragium/recipe/crushing/nether_brick.json | 2 +- .../crushing/netherite_dust_from_gear.json | 2 +- .../crushing/netherite_dust_from_ingot.json | 2 +- .../recipe/crushing/niter_dust_from_ore.json | 2 +- .../ragium/recipe/crushing/obsidian_dust.json | 2 +- .../ragium/recipe/crushing/orange_dye.json | 2 +- .../recipe/crushing/paper_dust_from_book.json | 2 +- .../data/ragium/recipe/crushing/pink_dye.json | 2 +- .../recipe/crushing/pointed_dripstone.json | 2 +- .../recipe/crushing/popped_chorus_fruit.json | 2 +- .../crushing/prismarine_dust_from_gem.json | 2 +- .../recipe/crushing/prismarine_shard.json | 2 +- .../data/ragium/recipe/crushing/quartz.json | 2 +- .../recipe/crushing/quartz_dust_from_gem.json | 2 +- .../recipe/crushing/quartz_dust_from_ore.json | 18 +++-- .../data/ragium/recipe/crushing/red_dye.json | 2 +- .../data/ragium/recipe/crushing/red_sand.json | 2 +- .../recipe/crushing/redstone_from_ore.json | 18 +++-- .../data/ragium/recipe/crushing/sand.json | 2 +- .../data/ragium/recipe/crushing/snowball.json | 2 +- .../recipe/crushing/sulfur_dust_from_ore.json | 2 +- .../ragium/recipe/crushing/white_dye.json | 2 +- .../ragium/recipe/crushing/wind_charge.json | 2 +- .../wood_dust_from_barrels_wooden.json | 2 +- .../recipe/crushing/wood_dust_from_boats.json | 2 +- .../crushing/wood_dust_from_chest_boats.json | 2 +- .../wood_dust_from_chests_wooden.json | 2 +- .../wood_dust_from_fence_gates_wooden.json | 2 +- .../wood_dust_from_fences_wooden.json | 2 +- .../recipe/crushing/wood_dust_from_gear.json | 2 +- .../crushing/wood_dust_from_gears_wood.json | 2 +- .../wood_dust_from_hanging_signs.json | 2 +- .../recipe/crushing/wood_dust_from_logs.json | 2 +- .../crushing/wood_dust_from_planks.json | 2 +- .../crushing/wood_dust_from_rods_wooden.json | 2 +- .../recipe/crushing/wood_dust_from_signs.json | 2 +- .../wood_dust_from_wooden_buttons.json | 2 +- .../crushing/wood_dust_from_wooden_doors.json | 2 +- ...wood_dust_from_wooden_pressure_plates.json | 2 +- .../wood_dust_from_wooden_shelves.json | 2 +- .../crushing/wood_dust_from_wooden_slabs.json | 2 +- .../wood_dust_from_wooden_stairs.json | 2 +- .../wood_dust_from_wooden_trapdoors.json | 2 +- .../ragium/recipe/crushing/yellow_dye.json | 2 +- .../ragium/recipe/cutting/melon_slice.json | 2 +- .../recipe/cutting/paper_from_book.json | 18 +++-- .../recipe/cutting/stick_from_saplings.json | 2 +- .../ragium/recipe/planting/acacia_log.json | 18 +++-- .../data/ragium/recipe/planting/apple.json | 2 +- .../data/ragium/recipe/planting/beetroot.json | 18 +++-- .../ragium/recipe/planting/birch_log.json | 18 +++-- .../recipe/planting/brown_mushroom.json | 2 +- .../data/ragium/recipe/planting/cactus.json | 2 +- .../data/ragium/recipe/planting/carrot.json | 2 +- .../ragium/recipe/planting/cherry_log.json | 18 +++-- .../ragium/recipe/planting/chorus_fruit.json | 18 +++-- .../ragium/recipe/planting/cocoa_beans.json | 2 +- .../ragium/recipe/planting/crimson_stem.json | 18 +++-- .../ragium/recipe/planting/dark_oak_log.json | 18 +++-- .../ragium/recipe/planting/glow_berries.json | 2 +- .../ragium/recipe/planting/jungle_log.json | 18 +++-- .../ragium/recipe/planting/mangrove_log.json | 18 +++-- .../data/ragium/recipe/planting/melon.json | 18 +++-- .../ragium/recipe/planting/nether_wart.json | 2 +- .../data/ragium/recipe/planting/oak_log.json | 18 +++-- .../ragium/recipe/planting/pale_oak_log.json | 18 +++-- .../ragium/recipe/planting/pitcher_plant.json | 18 +++-- .../data/ragium/recipe/planting/potato.json | 2 +- .../data/ragium/recipe/planting/pumpkin.json | 18 +++-- .../ragium/recipe/planting/red_mushroom.json | 2 +- .../ragium/recipe/planting/spruce_log.json | 18 +++-- .../ragium/recipe/planting/sugar_cane.json | 2 +- .../ragium/recipe/planting/sweet_berries.json | 2 +- .../ragium/recipe/planting/torchflower.json | 18 +++-- .../ragium/recipe/planting/warped_stem.json | 18 +++-- .../data/ragium/recipe/planting/wheat.json | 18 +++-- .../hiiragi283/lib/collection/NonEmptyList.kt | 75 ++++++++++++++++++ .../lib/collection/NonEmptyLists.kt | 38 +++++++++ .../HTItemToDoubleItemRecipeBuilder.kt | 30 +++---- .../HTItemToDoubleItemRecipeCategory.kt | 4 +- .../recipe/base/HTItemToDoubleItemRecipe.kt | 19 ++--- .../lib/serialization/codec/Codecs.kt | 25 ++++++ .../lib/serialization/network/StreamCodecs.kt | 13 ++++ .../builder/RTElectrolyzingRecipeBuilder.kt | 3 +- .../ragium/api/recipe/RTCrushingRecipe.kt | 10 +-- .../ragium/api/recipe/RTCuttingRecipe.kt | 10 +-- .../api/recipe/RTElectrolyzingRecipe.kt | 26 ++++--- .../ragium/api/recipe/RTPlantingRecipe.kt | 10 +-- 138 files changed, 580 insertions(+), 405 deletions(-) create mode 100644 src/lib/kotlin/hiiragi283/lib/collection/NonEmptyList.kt create mode 100644 src/lib/kotlin/hiiragi283/lib/collection/NonEmptyLists.kt diff --git a/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumBioRecipeProvider.kt b/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumBioRecipeProvider.kt index 841eb992a..e052a4a3f 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumBioRecipeProvider.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumBioRecipeProvider.kt @@ -132,11 +132,11 @@ class RagiumBioRecipeProvider(packOutput: PackOutput, future: CompletableFuture< +holderSet(seedIn) count = 8 } - primary { + result { +crop count = 12 } - secondary { + result { +seedOut count = 12 } @@ -160,7 +160,7 @@ class RagiumBioRecipeProvider(packOutput: PackOutput, future: CompletableFuture< items { +crop } count = 8 } - primary { + result { +crop count = 16 } @@ -173,7 +173,7 @@ class RagiumBioRecipeProvider(packOutput: PackOutput, future: CompletableFuture< items { +crop } count = 8 } - primary { + result { +crop count = 24 } @@ -199,11 +199,11 @@ class RagiumBioRecipeProvider(packOutput: PackOutput, future: CompletableFuture< items { +sapling } count = 8 } - primary { + result { +log count = 48 } - secondary { + result { +sapling count = 12 } diff --git a/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumMechanicalRecipeProvider.kt b/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumMechanicalRecipeProvider.kt index 5820fa814..d9d37f374 100644 --- a/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumMechanicalRecipeProvider.kt +++ b/src/data/kotlin/hiiragi283/ragium/data/recipe/RagiumMechanicalRecipeProvider.kt @@ -348,7 +348,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable ).forEach { (block: Item, base: Item) -> RagiumRecipeBuilders.crushing { ingredient { items { +block } } - primary { + result { +base count = 4 } @@ -361,7 +361,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable ).forEach { (block: TagKey, base: Item) -> RagiumRecipeBuilders.crushing { ingredient { +holderSet(block) } - primary { + result { +base count = 4 } @@ -371,7 +371,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable // Book -> 3x Paper Pulp RagiumRecipeBuilders.crushing { ingredient { items { +Items.BOOK } } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Other.PAPER) count = 3 } @@ -380,7 +380,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable // Blaze Rod -> 4x Blaze Powder RagiumRecipeBuilders.crushing { ingredient { +holderSet(Tags.Items.RODS_BLAZE) } - primary { + result { +Items.BLAZE_POWDER count = 4 } @@ -388,7 +388,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable // Breeze Rod -> 6x Wind Charge RagiumRecipeBuilders.crushing { ingredient { +holderSet(Tags.Items.RODS_BREEZE) } - primary { + result { +Items.WIND_CHARGE count = 6 } @@ -401,14 +401,14 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable val baseItem: HTSimpleDeferredItem = RagiumMaterialHelper.getFuelBase(fuel) RagiumRecipeBuilders.crushing { ingredient { items { +baseItem } } - primary { +RagiumItems.getOrThrow(HTItemPart.DUST, fuel) } + result { +RagiumItems.getOrThrow(HTItemPart.DUST, fuel) } }.save(exporter) } for (gem: RagiumMaterial.Gem in RagiumMaterial.Gem.entries) { RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.GEM, gem) } - primary { +RagiumItems.getOrThrow(HTItemPart.DUST, gem) } + result { +RagiumItems.getOrThrow(HTItemPart.DUST, gem) } recipeId suffix "_from_gem" }.save(exporter) } @@ -417,14 +417,14 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable val dust: HTSimpleDeferredItem = RagiumItems.MATERIAL_ITEMS[HTItemPart.DUST, metal] ?: continue RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.INGOT, metal) } - primary { +dust } + result { +dust } recipeId suffix "_from_ingot" }.save(exporter) } RagiumRecipeBuilders.crushing { ingredient { +holderSet(Tags.Items.GLASS_BLOCKS) } - primary { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Other.GLASS) } + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Other.GLASS) } recipeId suffix "_from_block" }.save(exporter) RagiumRecipeBuilders.crushing { @@ -432,7 +432,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable +holderSet(Tags.Items.GLASS_PANES) count = 8 } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Other.GLASS) count = 3 } @@ -440,7 +440,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { +holderSet(Tags.Items.OBSIDIANS_NORMAL) } - primary { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Other.OBSIDIAN) } + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Other.OBSIDIAN) } }.save(exporter) // Gear -> Dust for (material: RagiumMaterial in RagiumMaterial.entries) { @@ -448,7 +448,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable if (RagiumItems.MATERIAL_ITEMS.contains(HTItemPart.GEAR, material)) { RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.GEAR, material) } - primary { + result { +dust count = 4 } @@ -485,7 +485,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable +holderSet(input) count = inputCount } - primary { + result { +woodPulp count = outputCount } @@ -500,7 +500,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable Ingredient.of(holderSet(ItemTags.CHEST_BOATS)) ) } - primary { + result { +woodPulp count = 5 } @@ -512,11 +512,11 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable // XX Ore -> XX Dust RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, RagiumMaterial.Fuel.COAL) } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Fuel.COAL) count = 2 } - secondary { + result { +RagiumItems.getOrThrow(HTItemPart.TINY, RagiumMaterial.Fuel.COAL) count = 3 } @@ -524,11 +524,11 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, RagiumMaterial.Mineral.REDSTONE) } - primary { + result { +Items.REDSTONE count = 6 } - secondary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Mineral.RAGINITE) } recipeId suffix "_from_ore" @@ -536,7 +536,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, RagiumMaterial.Gem.LAPIS) } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Gem.LAPIS) count = 6 } @@ -544,18 +544,18 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, RagiumMaterial.Gem.QUARTZ) } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Gem.QUARTZ) count = 4 } - secondary { + result { +Items.GOLD_NUGGET } recipeId suffix "_from_ore" }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, RagiumMaterial.Gem.DIAMOND) } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Gem.DIAMOND) count = 2 } @@ -563,7 +563,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, RagiumMaterial.Gem.EMERALD) } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Gem.EMERALD) count = 2 } @@ -572,11 +572,11 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, RagiumMaterial.Metal.COPPER) } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Metal.COPPER) count = 3 } - secondary { + result { +Items.GOLD_NUGGET count = 3 } @@ -584,16 +584,16 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, RagiumMaterial.Metal.IRON) } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Metal.IRON) count = 2 } - secondary { +Items.FLINT } + result { +Items.FLINT } recipeId suffix "_from_ore" }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, RagiumMaterial.Metal.GOLD) } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, RagiumMaterial.Metal.GOLD) count = 2 } @@ -607,7 +607,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable +holderSet(CommonTagPrefixes.RAW_MATERIALS, metal) count = 3 } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, metal) count = 4 } @@ -619,7 +619,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable for (mineral: RagiumMaterial.Mineral in setOf(RagiumMaterial.Mineral.SULFUR, RagiumMaterial.Mineral.NITER)) { RagiumRecipeBuilders.crushing { ingredient { +holderSet(CommonTagPrefixes.ORE, mineral) } - primary { + result { +RagiumItems.getOrThrow(HTItemPart.DUST, mineral) count = 6 } @@ -691,7 +691,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable val builder: HTItemIngredientBuilder.() -> Unit = single[color] ?: continue RagiumRecipeBuilders.crushing { ingredient(builder) - primary { + result { +VanillaColoredCollections.DYE[color] count = 2 } @@ -700,7 +700,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable // Double RagiumRecipeBuilders.crushing { ingredient { items { +Items.ROSE_BUSH } } - primary { + result { +Items.RED_DYE count = 4 } @@ -708,7 +708,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { items { +Items.SUNFLOWER } } - primary { + result { +Items.YELLOW_DYE count = 4 } @@ -716,7 +716,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { items { +Items.PITCHER_PLANT } } - primary { + result { +Items.CYAN_DYE count = 4 } @@ -724,7 +724,7 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable }.save(exporter) RagiumRecipeBuilders.crushing { ingredient { items { +Items.LILAC } } - primary { + result { +Items.PINK_DYE count = 4 } @@ -736,23 +736,23 @@ class RagiumMechanicalRecipeProvider(packOutput: PackOutput, future: Completable // Sapling -> Stick RagiumRecipeBuilders.cutting { ingredient { +holderSet(ItemTags.SAPLINGS) } - primary { +Items.STICK } + result { +Items.STICK } recipeId suffix "_from_saplings" }.save(exporter) // Book -> Leather + 3x Paper RagiumRecipeBuilders.cutting { ingredient { items { +Items.BOOK } } - primary { + result { +Items.PAPER count = 3 } - secondary { +Items.LEATHER } + result { +Items.LEATHER } recipeId suffix "_from_book" }.save(exporter) // Melon -> Sliced Melon RagiumRecipeBuilders.cutting { ingredient { items { +Items.MELON } } - primary { + result { +Items.MELON_SLICE count = 9 } diff --git a/src/generated/resources/data/ragium/recipe/crushing/amethyst_dust_from_gem.json b/src/generated/resources/data/ragium/recipe/crushing/amethyst_dust_from_gem.json index da76a9ff3..3c1914e33 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/amethyst_dust_from_gem.json +++ b/src/generated/resources/data/ragium/recipe/crushing/amethyst_dust_from_gem.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gems/amethyst" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:amethyst_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/amethyst_shard.json b/src/generated/resources/data/ragium/recipe/crushing/amethyst_shard.json index b7d272033..0d8fbd162 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/amethyst_shard.json +++ b/src/generated/resources/data/ragium/recipe/crushing/amethyst_shard.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:amethyst_block" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:amethyst_shard" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/black_dye.json b/src/generated/resources/data/ragium/recipe/crushing/black_dye.json index c852479f2..6f05c860d 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/black_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/black_dye.json @@ -7,7 +7,7 @@ "minecraft:wither_rose" ] }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:black_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/blaze_powder.json b/src/generated/resources/data/ragium/recipe/crushing/blaze_powder.json index 4e7300531..fd244abee 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/blaze_powder.json +++ b/src/generated/resources/data/ragium/recipe/crushing/blaze_powder.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:rods/blaze" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:blaze_powder" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/blue_dye.json b/src/generated/resources/data/ragium/recipe/crushing/blue_dye.json index 080b409a9..df91e8809 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/blue_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/blue_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:cornflower" }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:blue_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/brick.json b/src/generated/resources/data/ragium/recipe/crushing/brick.json index 1aab33ee7..ebd241bb4 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/brick.json +++ b/src/generated/resources/data/ragium/recipe/crushing/brick.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:bricks" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:brick" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/brown_dye.json b/src/generated/resources/data/ragium/recipe/crushing/brown_dye.json index f763c3d89..e40afaaa5 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/brown_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/brown_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:cocoa_beans" }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:brown_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/charcoal_dust.json b/src/generated/resources/data/ragium/recipe/crushing/charcoal_dust.json index aa4eaba2c..603326733 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/charcoal_dust.json +++ b/src/generated/resources/data/ragium/recipe/crushing/charcoal_dust.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:charcoal" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:charcoal_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/clay_ball.json b/src/generated/resources/data/ragium/recipe/crushing/clay_ball.json index dbe50507a..efcd9df52 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/clay_ball.json +++ b/src/generated/resources/data/ragium/recipe/crushing/clay_ball.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:clay" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:clay_ball" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/coal_coke_dust.json b/src/generated/resources/data/ragium/recipe/crushing/coal_coke_dust.json index 7a020e257..d70d5b0b5 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/coal_coke_dust.json +++ b/src/generated/resources/data/ragium/recipe/crushing/coal_coke_dust.json @@ -4,7 +4,7 @@ "count": 1, "items": "ragium:coal_coke" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:coal_coke_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/coal_dust.json b/src/generated/resources/data/ragium/recipe/crushing/coal_dust.json index b760953ba..3a01d8f80 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/coal_dust.json +++ b/src/generated/resources/data/ragium/recipe/crushing/coal_dust.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:coal" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:coal_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/coal_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/coal_dust_from_ore.json index faf6345fe..9cf8e481c 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/coal_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/coal_dust_from_ore.json @@ -4,13 +4,15 @@ "count": 1, "items": "#c:ores/coal" }, - "primary_result": { - "count": 2, - "id": "ragium:coal_dust" - }, - "secondary_result": { - "count": 3, - "id": "ragium:tiny_coal" - }, + "results": [ + { + "count": 2, + "id": "ragium:coal_dust" + }, + { + "count": 3, + "id": "ragium:tiny_coal" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_gear.json b/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_gear.json index 6b6b81227..4dd59bcd2 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_gear.json +++ b/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_gear.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gears/copper" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:copper_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_ingot.json b/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_ingot.json index 9c1c2805c..6c3474f09 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_ingot.json +++ b/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_ingot.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ingots/copper" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:copper_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_ore.json index 8265d52a1..51bfe3154 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_ore.json @@ -4,13 +4,15 @@ "count": 1, "items": "#c:ores/copper" }, - "primary_result": { - "count": 3, - "id": "ragium:copper_dust" - }, - "secondary_result": { - "count": 3, - "id": "minecraft:gold_nugget" - }, + "results": [ + { + "count": 3, + "id": "ragium:copper_dust" + }, + { + "count": 3, + "id": "minecraft:gold_nugget" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_raw.json b/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_raw.json index f087300c3..1eef5863d 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_raw.json +++ b/src/generated/resources/data/ragium/recipe/crushing/copper_dust_from_raw.json @@ -4,7 +4,7 @@ "count": 3, "items": "#c:raw_materials/copper" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:copper_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_gear.json b/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_gear.json index 15464b9dd..f7ab6c7da 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_gear.json +++ b/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_gear.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gears/diamond" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:diamond_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_gem.json b/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_gem.json index 21a34d074..339fa9852 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_gem.json +++ b/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_gem.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gems/diamond" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:diamond_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_ore.json index 289176c45..e795088f8 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/diamond_dust_from_ore.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ores/diamond" }, - "primary_result": { + "results": { "count": 2, "id": "ragium:diamond_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/double_cyan_dye.json b/src/generated/resources/data/ragium/recipe/crushing/double_cyan_dye.json index 31cf8aa68..621f12402 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/double_cyan_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/double_cyan_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:pitcher_plant" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:cyan_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/double_pink_dye.json b/src/generated/resources/data/ragium/recipe/crushing/double_pink_dye.json index f2efaf4f7..472657240 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/double_pink_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/double_pink_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:lilac" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:pink_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/double_red_dye.json b/src/generated/resources/data/ragium/recipe/crushing/double_red_dye.json index ae716b328..0f738792e 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/double_red_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/double_red_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:rose_bush" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:red_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/double_yellow_dye.json b/src/generated/resources/data/ragium/recipe/crushing/double_yellow_dye.json index 83cbaf234..583ae522f 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/double_yellow_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/double_yellow_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:sunflower" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:yellow_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/echo_dust_from_gem.json b/src/generated/resources/data/ragium/recipe/crushing/echo_dust_from_gem.json index 8d033f05f..054d76ed7 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/echo_dust_from_gem.json +++ b/src/generated/resources/data/ragium/recipe/crushing/echo_dust_from_gem.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gems/echo" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:echo_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_gear.json b/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_gear.json index 1db7a0044..0e13b57ed 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_gear.json +++ b/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_gear.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gears/emerald" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:emerald_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_gem.json b/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_gem.json index 6e7a29b76..767f54506 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_gem.json +++ b/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_gem.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gems/emerald" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:emerald_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_ore.json index e978f28d0..8b610d00c 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/emerald_dust_from_ore.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ores/emerald" }, - "primary_result": { + "results": { "count": 2, "id": "ragium:emerald_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/glass_dust_from_block.json b/src/generated/resources/data/ragium/recipe/crushing/glass_dust_from_block.json index 757b4257d..b0d03f8b3 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/glass_dust_from_block.json +++ b/src/generated/resources/data/ragium/recipe/crushing/glass_dust_from_block.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:glass_blocks" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:glass_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/glass_dust_from_pane.json b/src/generated/resources/data/ragium/recipe/crushing/glass_dust_from_pane.json index a30f40a5c..c44ac5a0f 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/glass_dust_from_pane.json +++ b/src/generated/resources/data/ragium/recipe/crushing/glass_dust_from_pane.json @@ -4,7 +4,7 @@ "count": 8, "items": "#c:glass_panes" }, - "primary_result": { + "results": { "count": 3, "id": "ragium:glass_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/glowstone_dust.json b/src/generated/resources/data/ragium/recipe/crushing/glowstone_dust.json index 5507c0351..4c457e21f 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/glowstone_dust.json +++ b/src/generated/resources/data/ragium/recipe/crushing/glowstone_dust.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:glowstone" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:glowstone_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_gear.json b/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_gear.json index f9923e955..863e14efa 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_gear.json +++ b/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_gear.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gears/gold" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:gold_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_ingot.json b/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_ingot.json index 322343e27..ba0fe4661 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_ingot.json +++ b/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_ingot.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ingots/gold" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:gold_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_ore.json index d8e72d3ad..2c2cb5766 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_ore.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ores/gold" }, - "primary_result": { + "results": { "count": 2, "id": "ragium:gold_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_raw.json b/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_raw.json index a7eafb680..6c0338c98 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_raw.json +++ b/src/generated/resources/data/ragium/recipe/crushing/gold_dust_from_raw.json @@ -4,7 +4,7 @@ "count": 3, "items": "#c:raw_materials/gold" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:gold_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/gray_dye.json b/src/generated/resources/data/ragium/recipe/crushing/gray_dye.json index 7a5cf5571..7edb65b7a 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/gray_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/gray_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:closed_eyeblossom" }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:gray_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/green_dye.json b/src/generated/resources/data/ragium/recipe/crushing/green_dye.json index d76e8bebc..6c4c7556e 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/green_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/green_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:cactus" }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:green_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/honeycomb.json b/src/generated/resources/data/ragium/recipe/crushing/honeycomb.json index 76da760ff..a2cd9550a 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/honeycomb.json +++ b/src/generated/resources/data/ragium/recipe/crushing/honeycomb.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:honeycomb_block" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:honeycomb" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_gear.json b/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_gear.json index 336009a45..da6b1f934 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_gear.json +++ b/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_gear.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gears/iron" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:iron_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_ingot.json b/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_ingot.json index 0b2e807d9..396cf3021 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_ingot.json +++ b/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_ingot.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ingots/iron" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:iron_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_ore.json index f1f0fb4fd..e6930d042 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_ore.json @@ -4,13 +4,15 @@ "count": 1, "items": "#c:ores/iron" }, - "primary_result": { - "count": 2, - "id": "ragium:iron_dust" - }, - "secondary_result": { - "count": 1, - "id": "minecraft:flint" - }, + "results": [ + { + "count": 2, + "id": "ragium:iron_dust" + }, + { + "count": 1, + "id": "minecraft:flint" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_raw.json b/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_raw.json index 927793f4d..64f6c9a0e 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_raw.json +++ b/src/generated/resources/data/ragium/recipe/crushing/iron_dust_from_raw.json @@ -4,7 +4,7 @@ "count": 3, "items": "#c:raw_materials/iron" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:iron_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/lapis_dust_from_gem.json b/src/generated/resources/data/ragium/recipe/crushing/lapis_dust_from_gem.json index fab353091..01b438731 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/lapis_dust_from_gem.json +++ b/src/generated/resources/data/ragium/recipe/crushing/lapis_dust_from_gem.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gems/lapis" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:lapis_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/lapis_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/lapis_dust_from_ore.json index 2bb44bd9c..4bdf70c8b 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/lapis_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/lapis_dust_from_ore.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ores/lapis" }, - "primary_result": { + "results": { "count": 6, "id": "ragium:lapis_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/light_blue_dye.json b/src/generated/resources/data/ragium/recipe/crushing/light_blue_dye.json index a7e2e4b77..2d6233592 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/light_blue_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/light_blue_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:blue_orchid" }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:light_blue_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/light_gray_dye.json b/src/generated/resources/data/ragium/recipe/crushing/light_gray_dye.json index 7b38cddbc..2e5da6ae6 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/light_gray_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/light_gray_dye.json @@ -8,7 +8,7 @@ "minecraft:white_tulip" ] }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:light_gray_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/lime_dye.json b/src/generated/resources/data/ragium/recipe/crushing/lime_dye.json index d64cb4f56..5985a4445 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/lime_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/lime_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:sea_pickle" }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:lime_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/magenta_dye.json b/src/generated/resources/data/ragium/recipe/crushing/magenta_dye.json index 4d63e0cd1..d35006a52 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/magenta_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/magenta_dye.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:allium" }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:magenta_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/magma_cream.json b/src/generated/resources/data/ragium/recipe/crushing/magma_cream.json index 17c932226..b35c0c1a0 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/magma_cream.json +++ b/src/generated/resources/data/ragium/recipe/crushing/magma_cream.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:magma_block" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:magma_cream" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/nether_brick.json b/src/generated/resources/data/ragium/recipe/crushing/nether_brick.json index b1e41470a..851227fda 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/nether_brick.json +++ b/src/generated/resources/data/ragium/recipe/crushing/nether_brick.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:nether_bricks" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:nether_brick" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/netherite_dust_from_gear.json b/src/generated/resources/data/ragium/recipe/crushing/netherite_dust_from_gear.json index f128317d6..75590b3d8 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/netherite_dust_from_gear.json +++ b/src/generated/resources/data/ragium/recipe/crushing/netherite_dust_from_gear.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gears/netherite" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:netherite_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/netherite_dust_from_ingot.json b/src/generated/resources/data/ragium/recipe/crushing/netherite_dust_from_ingot.json index b7b203502..7a0a81eb4 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/netherite_dust_from_ingot.json +++ b/src/generated/resources/data/ragium/recipe/crushing/netherite_dust_from_ingot.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ingots/netherite" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:netherite_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/niter_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/niter_dust_from_ore.json index 03351d2e0..74cfd0391 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/niter_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/niter_dust_from_ore.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ores/niter" }, - "primary_result": { + "results": { "count": 6, "id": "ragium:niter_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/obsidian_dust.json b/src/generated/resources/data/ragium/recipe/crushing/obsidian_dust.json index 42c2a742e..4239d61a2 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/obsidian_dust.json +++ b/src/generated/resources/data/ragium/recipe/crushing/obsidian_dust.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:obsidians/normal" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:obsidian_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/orange_dye.json b/src/generated/resources/data/ragium/recipe/crushing/orange_dye.json index e390f1ca7..195f4b386 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/orange_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/orange_dye.json @@ -8,7 +8,7 @@ "minecraft:open_eyeblossom" ] }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:orange_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/paper_dust_from_book.json b/src/generated/resources/data/ragium/recipe/crushing/paper_dust_from_book.json index 4a397213a..66924509d 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/paper_dust_from_book.json +++ b/src/generated/resources/data/ragium/recipe/crushing/paper_dust_from_book.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:book" }, - "primary_result": { + "results": { "count": 3, "id": "ragium:paper_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/pink_dye.json b/src/generated/resources/data/ragium/recipe/crushing/pink_dye.json index c6b3abc1e..ee5fee5c8 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/pink_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/pink_dye.json @@ -8,7 +8,7 @@ "minecraft:pink_tulip" ] }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:pink_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/pointed_dripstone.json b/src/generated/resources/data/ragium/recipe/crushing/pointed_dripstone.json index 04e1afc66..63c0ed401 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/pointed_dripstone.json +++ b/src/generated/resources/data/ragium/recipe/crushing/pointed_dripstone.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:dripstone_block" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:pointed_dripstone" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/popped_chorus_fruit.json b/src/generated/resources/data/ragium/recipe/crushing/popped_chorus_fruit.json index 9fc509d1b..70a585dd6 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/popped_chorus_fruit.json +++ b/src/generated/resources/data/ragium/recipe/crushing/popped_chorus_fruit.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:purpur_block" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:popped_chorus_fruit" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/prismarine_dust_from_gem.json b/src/generated/resources/data/ragium/recipe/crushing/prismarine_dust_from_gem.json index 37f4e6c28..b83be6d9b 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/prismarine_dust_from_gem.json +++ b/src/generated/resources/data/ragium/recipe/crushing/prismarine_dust_from_gem.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gems/prismarine" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:prismarine_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/prismarine_shard.json b/src/generated/resources/data/ragium/recipe/crushing/prismarine_shard.json index c5b346e8c..383e19fcc 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/prismarine_shard.json +++ b/src/generated/resources/data/ragium/recipe/crushing/prismarine_shard.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:prismarine" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:prismarine_shard" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/quartz.json b/src/generated/resources/data/ragium/recipe/crushing/quartz.json index cccf6b0c4..c17d61a62 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/quartz.json +++ b/src/generated/resources/data/ragium/recipe/crushing/quartz.json @@ -4,7 +4,7 @@ "count": 1, "items": "#ragium:quartz_blocks" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:quartz" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/quartz_dust_from_gem.json b/src/generated/resources/data/ragium/recipe/crushing/quartz_dust_from_gem.json index f23f3c513..64b9ac078 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/quartz_dust_from_gem.json +++ b/src/generated/resources/data/ragium/recipe/crushing/quartz_dust_from_gem.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gems/quartz" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:quartz_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/quartz_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/quartz_dust_from_ore.json index 86bd231de..7b4a6160c 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/quartz_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/quartz_dust_from_ore.json @@ -4,13 +4,15 @@ "count": 1, "items": "#c:ores/quartz" }, - "primary_result": { - "count": 4, - "id": "ragium:quartz_dust" - }, - "secondary_result": { - "count": 1, - "id": "minecraft:gold_nugget" - }, + "results": [ + { + "count": 4, + "id": "ragium:quartz_dust" + }, + { + "count": 1, + "id": "minecraft:gold_nugget" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/crushing/red_dye.json b/src/generated/resources/data/ragium/recipe/crushing/red_dye.json index 6d6199370..7d6c35a2b 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/red_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/red_dye.json @@ -7,7 +7,7 @@ "minecraft:beetroot" ] }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:red_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/red_sand.json b/src/generated/resources/data/ragium/recipe/crushing/red_sand.json index cfae0461e..7d99b5464 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/red_sand.json +++ b/src/generated/resources/data/ragium/recipe/crushing/red_sand.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:sandstone/red_blocks" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:red_sand" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/redstone_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/redstone_from_ore.json index d2bc6e7e8..f1adad2e2 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/redstone_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/redstone_from_ore.json @@ -4,13 +4,15 @@ "count": 1, "items": "#c:ores/redstone" }, - "primary_result": { - "count": 6, - "id": "minecraft:redstone" - }, - "secondary_result": { - "count": 1, - "id": "ragium:raginite_dust" - }, + "results": [ + { + "count": 6, + "id": "minecraft:redstone" + }, + { + "count": 1, + "id": "ragium:raginite_dust" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/crushing/sand.json b/src/generated/resources/data/ragium/recipe/crushing/sand.json index 43f5ec640..dbeef0a38 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/sand.json +++ b/src/generated/resources/data/ragium/recipe/crushing/sand.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:sandstone/uncolored_blocks" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:sand" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/snowball.json b/src/generated/resources/data/ragium/recipe/crushing/snowball.json index 71907eddc..e0b6f4a03 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/snowball.json +++ b/src/generated/resources/data/ragium/recipe/crushing/snowball.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:snow_block" }, - "primary_result": { + "results": { "count": 4, "id": "minecraft:snowball" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/sulfur_dust_from_ore.json b/src/generated/resources/data/ragium/recipe/crushing/sulfur_dust_from_ore.json index 176250f12..99b4b73ac 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/sulfur_dust_from_ore.json +++ b/src/generated/resources/data/ragium/recipe/crushing/sulfur_dust_from_ore.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:ores/sulfur" }, - "primary_result": { + "results": { "count": 6, "id": "ragium:sulfur_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/white_dye.json b/src/generated/resources/data/ragium/recipe/crushing/white_dye.json index d996d7f9a..a1406aecb 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/white_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/white_dye.json @@ -7,7 +7,7 @@ "minecraft:lily_of_the_valley" ] }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:white_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wind_charge.json b/src/generated/resources/data/ragium/recipe/crushing/wind_charge.json index 56abc85cd..dd0f17730 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wind_charge.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wind_charge.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:rods/breeze" }, - "primary_result": { + "results": { "count": 6, "id": "minecraft:wind_charge" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_barrels_wooden.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_barrels_wooden.json index 02d811d09..9e97a915c 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_barrels_wooden.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_barrels_wooden.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:barrels/wooden" }, - "primary_result": { + "results": { "count": 7, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_boats.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_boats.json index d3b51e0dd..080632eff 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_boats.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_boats.json @@ -8,7 +8,7 @@ "subtracted": "#minecraft:chest_boats" } }, - "primary_result": { + "results": { "count": 5, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_chest_boats.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_chest_boats.json index 1f9644759..3fc1661db 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_chest_boats.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_chest_boats.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:chest_boats" }, - "primary_result": { + "results": { "count": 13, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_chests_wooden.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_chests_wooden.json index 8f5965d5a..743a4e449 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_chests_wooden.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_chests_wooden.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:chests/wooden" }, - "primary_result": { + "results": { "count": 8, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_fence_gates_wooden.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_fence_gates_wooden.json index de3e0d810..24f68bef1 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_fence_gates_wooden.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_fence_gates_wooden.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:fence_gates/wooden" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_fences_wooden.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_fences_wooden.json index 194b0efd3..318f545cd 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_fences_wooden.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_fences_wooden.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:fences/wooden" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_gear.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_gear.json index 9026f244e..8928a7306 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_gear.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_gear.json @@ -4,7 +4,7 @@ "count": 1, "items": "#c:gears/wood" }, - "primary_result": { + "results": { "count": 4, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_gears_wood.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_gears_wood.json index f5a798d3d..509a00549 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_gears_wood.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_gears_wood.json @@ -4,7 +4,7 @@ "count": 4, "items": "#c:gears/wood" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_hanging_signs.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_hanging_signs.json index b382f45af..6a1d23e2b 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_hanging_signs.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_hanging_signs.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:hanging_signs" }, - "primary_result": { + "results": { "count": 6, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_logs.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_logs.json index 9fa77fa1c..04d956e35 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_logs.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_logs.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:logs" }, - "primary_result": { + "results": { "count": 6, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_planks.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_planks.json index c6024e4a8..d62d372eb 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_planks.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_planks.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:planks" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_rods_wooden.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_rods_wooden.json index 49a657d9f..546edee62 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_rods_wooden.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_rods_wooden.json @@ -4,7 +4,7 @@ "count": 2, "items": "#c:rods/wooden" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_signs.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_signs.json index a2b716c1f..21744c9f1 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_signs.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_signs.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:signs" }, - "primary_result": { + "results": { "count": 2, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_buttons.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_buttons.json index d15344418..265ab9140 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_buttons.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_buttons.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:wooden_buttons" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_doors.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_doors.json index e12d54cee..74436a0b8 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_doors.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_doors.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:wooden_doors" }, - "primary_result": { + "results": { "count": 2, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_pressure_plates.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_pressure_plates.json index 8e2eb2391..2cac828df 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_pressure_plates.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_pressure_plates.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:wooden_pressure_plates" }, - "primary_result": { + "results": { "count": 2, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_shelves.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_shelves.json index dd7ee185a..bc01ccc87 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_shelves.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_shelves.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:wooden_shelves" }, - "primary_result": { + "results": { "count": 6, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_slabs.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_slabs.json index 553579311..26999d236 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_slabs.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_slabs.json @@ -4,7 +4,7 @@ "count": 2, "items": "#minecraft:wooden_slabs" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_stairs.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_stairs.json index 5ef313c85..7ca2ce341 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_stairs.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_stairs.json @@ -4,7 +4,7 @@ "count": 2, "items": "#minecraft:wooden_stairs" }, - "primary_result": { + "results": { "count": 3, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_trapdoors.json b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_trapdoors.json index 77981dc99..9bddf0b66 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_trapdoors.json +++ b/src/generated/resources/data/ragium/recipe/crushing/wood_dust_from_wooden_trapdoors.json @@ -4,7 +4,7 @@ "count": 3, "items": "#minecraft:wooden_trapdoors" }, - "primary_result": { + "results": { "count": 1, "id": "ragium:wood_dust" }, diff --git a/src/generated/resources/data/ragium/recipe/crushing/yellow_dye.json b/src/generated/resources/data/ragium/recipe/crushing/yellow_dye.json index ac2ca975c..e389539c0 100644 --- a/src/generated/resources/data/ragium/recipe/crushing/yellow_dye.json +++ b/src/generated/resources/data/ragium/recipe/crushing/yellow_dye.json @@ -8,7 +8,7 @@ "minecraft:wildflowers" ] }, - "primary_result": { + "results": { "count": 2, "id": "minecraft:yellow_dye" }, diff --git a/src/generated/resources/data/ragium/recipe/cutting/melon_slice.json b/src/generated/resources/data/ragium/recipe/cutting/melon_slice.json index d8ded56ad..53615e52b 100644 --- a/src/generated/resources/data/ragium/recipe/cutting/melon_slice.json +++ b/src/generated/resources/data/ragium/recipe/cutting/melon_slice.json @@ -4,7 +4,7 @@ "count": 1, "items": "minecraft:melon" }, - "primary_result": { + "results": { "count": 9, "id": "minecraft:melon_slice" }, diff --git a/src/generated/resources/data/ragium/recipe/cutting/paper_from_book.json b/src/generated/resources/data/ragium/recipe/cutting/paper_from_book.json index 430a5dc14..8fb22a299 100644 --- a/src/generated/resources/data/ragium/recipe/cutting/paper_from_book.json +++ b/src/generated/resources/data/ragium/recipe/cutting/paper_from_book.json @@ -4,13 +4,15 @@ "count": 1, "items": "minecraft:book" }, - "primary_result": { - "count": 3, - "id": "minecraft:paper" - }, - "secondary_result": { - "count": 1, - "id": "minecraft:leather" - }, + "results": [ + { + "count": 3, + "id": "minecraft:paper" + }, + { + "count": 1, + "id": "minecraft:leather" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/cutting/stick_from_saplings.json b/src/generated/resources/data/ragium/recipe/cutting/stick_from_saplings.json index 639f60e2c..50dc7ed14 100644 --- a/src/generated/resources/data/ragium/recipe/cutting/stick_from_saplings.json +++ b/src/generated/resources/data/ragium/recipe/cutting/stick_from_saplings.json @@ -4,7 +4,7 @@ "count": 1, "items": "#minecraft:saplings" }, - "primary_result": { + "results": { "count": 1, "id": "minecraft:stick" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/acacia_log.json b/src/generated/resources/data/ragium/recipe/planting/acacia_log.json index 1fc6250cc..bb9ede994 100644 --- a/src/generated/resources/data/ragium/recipe/planting/acacia_log.json +++ b/src/generated/resources/data/ragium/recipe/planting/acacia_log.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:acacia_sapling" }, - "primary_result": { - "count": 48, - "id": "minecraft:acacia_log" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:acacia_sapling" - }, + "results": [ + { + "count": 48, + "id": "minecraft:acacia_log" + }, + { + "count": 12, + "id": "minecraft:acacia_sapling" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/apple.json b/src/generated/resources/data/ragium/recipe/planting/apple.json index 78b1e8edc..e4e620d02 100644 --- a/src/generated/resources/data/ragium/recipe/planting/apple.json +++ b/src/generated/resources/data/ragium/recipe/planting/apple.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:apple" }, - "primary_result": { + "results": { "count": 16, "id": "minecraft:apple" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/beetroot.json b/src/generated/resources/data/ragium/recipe/planting/beetroot.json index 1c463d8e8..28e9d99e8 100644 --- a/src/generated/resources/data/ragium/recipe/planting/beetroot.json +++ b/src/generated/resources/data/ragium/recipe/planting/beetroot.json @@ -4,13 +4,15 @@ "count": 8, "items": "#c:seeds/beetroot" }, - "primary_result": { - "count": 12, - "id": "minecraft:beetroot" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:beetroot_seeds" - }, + "results": [ + { + "count": 12, + "id": "minecraft:beetroot" + }, + { + "count": 12, + "id": "minecraft:beetroot_seeds" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/birch_log.json b/src/generated/resources/data/ragium/recipe/planting/birch_log.json index 262b5a5fa..d2ec3645b 100644 --- a/src/generated/resources/data/ragium/recipe/planting/birch_log.json +++ b/src/generated/resources/data/ragium/recipe/planting/birch_log.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:birch_sapling" }, - "primary_result": { - "count": 48, - "id": "minecraft:birch_log" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:birch_sapling" - }, + "results": [ + { + "count": 48, + "id": "minecraft:birch_log" + }, + { + "count": 12, + "id": "minecraft:birch_sapling" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/brown_mushroom.json b/src/generated/resources/data/ragium/recipe/planting/brown_mushroom.json index e7e7281de..6d70716ea 100644 --- a/src/generated/resources/data/ragium/recipe/planting/brown_mushroom.json +++ b/src/generated/resources/data/ragium/recipe/planting/brown_mushroom.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:brown_mushroom" }, - "primary_result": { + "results": { "count": 16, "id": "minecraft:brown_mushroom" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/cactus.json b/src/generated/resources/data/ragium/recipe/planting/cactus.json index ded4b955d..b032c629e 100644 --- a/src/generated/resources/data/ragium/recipe/planting/cactus.json +++ b/src/generated/resources/data/ragium/recipe/planting/cactus.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:cactus" }, - "primary_result": { + "results": { "count": 24, "id": "minecraft:cactus" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/carrot.json b/src/generated/resources/data/ragium/recipe/planting/carrot.json index 4fc3f3c28..2755ed110 100644 --- a/src/generated/resources/data/ragium/recipe/planting/carrot.json +++ b/src/generated/resources/data/ragium/recipe/planting/carrot.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:carrot" }, - "primary_result": { + "results": { "count": 16, "id": "minecraft:carrot" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/cherry_log.json b/src/generated/resources/data/ragium/recipe/planting/cherry_log.json index d53d9f254..1773afd7f 100644 --- a/src/generated/resources/data/ragium/recipe/planting/cherry_log.json +++ b/src/generated/resources/data/ragium/recipe/planting/cherry_log.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:cherry_sapling" }, - "primary_result": { - "count": 48, - "id": "minecraft:cherry_log" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:cherry_sapling" - }, + "results": [ + { + "count": 48, + "id": "minecraft:cherry_log" + }, + { + "count": 12, + "id": "minecraft:cherry_sapling" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/chorus_fruit.json b/src/generated/resources/data/ragium/recipe/planting/chorus_fruit.json index 51d62b7a4..88043a047 100644 --- a/src/generated/resources/data/ragium/recipe/planting/chorus_fruit.json +++ b/src/generated/resources/data/ragium/recipe/planting/chorus_fruit.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:chorus_flower" }, - "primary_result": { - "count": 48, - "id": "minecraft:chorus_fruit" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:chorus_flower" - }, + "results": [ + { + "count": 48, + "id": "minecraft:chorus_fruit" + }, + { + "count": 12, + "id": "minecraft:chorus_flower" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/cocoa_beans.json b/src/generated/resources/data/ragium/recipe/planting/cocoa_beans.json index 0b33742e2..387818141 100644 --- a/src/generated/resources/data/ragium/recipe/planting/cocoa_beans.json +++ b/src/generated/resources/data/ragium/recipe/planting/cocoa_beans.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:cocoa_beans" }, - "primary_result": { + "results": { "count": 16, "id": "minecraft:cocoa_beans" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/crimson_stem.json b/src/generated/resources/data/ragium/recipe/planting/crimson_stem.json index 559fa3d04..331a859de 100644 --- a/src/generated/resources/data/ragium/recipe/planting/crimson_stem.json +++ b/src/generated/resources/data/ragium/recipe/planting/crimson_stem.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:crimson_fungus" }, - "primary_result": { - "count": 48, - "id": "minecraft:crimson_stem" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:crimson_fungus" - }, + "results": [ + { + "count": 48, + "id": "minecraft:crimson_stem" + }, + { + "count": 12, + "id": "minecraft:crimson_fungus" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/dark_oak_log.json b/src/generated/resources/data/ragium/recipe/planting/dark_oak_log.json index c57f07fcc..686189b13 100644 --- a/src/generated/resources/data/ragium/recipe/planting/dark_oak_log.json +++ b/src/generated/resources/data/ragium/recipe/planting/dark_oak_log.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:dark_oak_sapling" }, - "primary_result": { - "count": 48, - "id": "minecraft:dark_oak_log" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:dark_oak_sapling" - }, + "results": [ + { + "count": 48, + "id": "minecraft:dark_oak_log" + }, + { + "count": 12, + "id": "minecraft:dark_oak_sapling" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/glow_berries.json b/src/generated/resources/data/ragium/recipe/planting/glow_berries.json index ee60d024b..46413dd84 100644 --- a/src/generated/resources/data/ragium/recipe/planting/glow_berries.json +++ b/src/generated/resources/data/ragium/recipe/planting/glow_berries.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:glow_berries" }, - "primary_result": { + "results": { "count": 16, "id": "minecraft:glow_berries" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/jungle_log.json b/src/generated/resources/data/ragium/recipe/planting/jungle_log.json index c2076a8dc..87de91414 100644 --- a/src/generated/resources/data/ragium/recipe/planting/jungle_log.json +++ b/src/generated/resources/data/ragium/recipe/planting/jungle_log.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:jungle_sapling" }, - "primary_result": { - "count": 48, - "id": "minecraft:jungle_log" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:jungle_sapling" - }, + "results": [ + { + "count": 48, + "id": "minecraft:jungle_log" + }, + { + "count": 12, + "id": "minecraft:jungle_sapling" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/mangrove_log.json b/src/generated/resources/data/ragium/recipe/planting/mangrove_log.json index 0aa30ab9c..53c3d78bf 100644 --- a/src/generated/resources/data/ragium/recipe/planting/mangrove_log.json +++ b/src/generated/resources/data/ragium/recipe/planting/mangrove_log.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:mangrove_propagule" }, - "primary_result": { - "count": 48, - "id": "minecraft:mangrove_log" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:mangrove_propagule" - }, + "results": [ + { + "count": 48, + "id": "minecraft:mangrove_log" + }, + { + "count": 12, + "id": "minecraft:mangrove_propagule" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/melon.json b/src/generated/resources/data/ragium/recipe/planting/melon.json index 69516cb41..4025b261a 100644 --- a/src/generated/resources/data/ragium/recipe/planting/melon.json +++ b/src/generated/resources/data/ragium/recipe/planting/melon.json @@ -4,13 +4,15 @@ "count": 8, "items": "#c:seeds/melon" }, - "primary_result": { - "count": 12, - "id": "minecraft:melon" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:melon_seeds" - }, + "results": [ + { + "count": 12, + "id": "minecraft:melon" + }, + { + "count": 12, + "id": "minecraft:melon_seeds" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/nether_wart.json b/src/generated/resources/data/ragium/recipe/planting/nether_wart.json index edbea9dde..0f58e924b 100644 --- a/src/generated/resources/data/ragium/recipe/planting/nether_wart.json +++ b/src/generated/resources/data/ragium/recipe/planting/nether_wart.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:nether_wart" }, - "primary_result": { + "results": { "count": 16, "id": "minecraft:nether_wart" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/oak_log.json b/src/generated/resources/data/ragium/recipe/planting/oak_log.json index badde88aa..97846dc05 100644 --- a/src/generated/resources/data/ragium/recipe/planting/oak_log.json +++ b/src/generated/resources/data/ragium/recipe/planting/oak_log.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:oak_sapling" }, - "primary_result": { - "count": 48, - "id": "minecraft:oak_log" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:oak_sapling" - }, + "results": [ + { + "count": 48, + "id": "minecraft:oak_log" + }, + { + "count": 12, + "id": "minecraft:oak_sapling" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/pale_oak_log.json b/src/generated/resources/data/ragium/recipe/planting/pale_oak_log.json index a289cf24c..cfe3a401e 100644 --- a/src/generated/resources/data/ragium/recipe/planting/pale_oak_log.json +++ b/src/generated/resources/data/ragium/recipe/planting/pale_oak_log.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:pale_oak_sapling" }, - "primary_result": { - "count": 48, - "id": "minecraft:pale_oak_log" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:pale_oak_sapling" - }, + "results": [ + { + "count": 48, + "id": "minecraft:pale_oak_log" + }, + { + "count": 12, + "id": "minecraft:pale_oak_sapling" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/pitcher_plant.json b/src/generated/resources/data/ragium/recipe/planting/pitcher_plant.json index 51490b174..63ea62562 100644 --- a/src/generated/resources/data/ragium/recipe/planting/pitcher_plant.json +++ b/src/generated/resources/data/ragium/recipe/planting/pitcher_plant.json @@ -4,13 +4,15 @@ "count": 8, "items": "#c:seeds/pitcher_plant" }, - "primary_result": { - "count": 12, - "id": "minecraft:pitcher_plant" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:pitcher_pod" - }, + "results": [ + { + "count": 12, + "id": "minecraft:pitcher_plant" + }, + { + "count": 12, + "id": "minecraft:pitcher_pod" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/potato.json b/src/generated/resources/data/ragium/recipe/planting/potato.json index a198041ff..ca8461be7 100644 --- a/src/generated/resources/data/ragium/recipe/planting/potato.json +++ b/src/generated/resources/data/ragium/recipe/planting/potato.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:potato" }, - "primary_result": { + "results": { "count": 16, "id": "minecraft:potato" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/pumpkin.json b/src/generated/resources/data/ragium/recipe/planting/pumpkin.json index 95688ea9c..b25005bdb 100644 --- a/src/generated/resources/data/ragium/recipe/planting/pumpkin.json +++ b/src/generated/resources/data/ragium/recipe/planting/pumpkin.json @@ -4,13 +4,15 @@ "count": 8, "items": "#c:seeds/pumpkin" }, - "primary_result": { - "count": 12, - "id": "minecraft:pumpkin" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:pumpkin_seeds" - }, + "results": [ + { + "count": 12, + "id": "minecraft:pumpkin" + }, + { + "count": 12, + "id": "minecraft:pumpkin_seeds" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/red_mushroom.json b/src/generated/resources/data/ragium/recipe/planting/red_mushroom.json index a12111453..f99bd1369 100644 --- a/src/generated/resources/data/ragium/recipe/planting/red_mushroom.json +++ b/src/generated/resources/data/ragium/recipe/planting/red_mushroom.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:red_mushroom" }, - "primary_result": { + "results": { "count": 16, "id": "minecraft:red_mushroom" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/spruce_log.json b/src/generated/resources/data/ragium/recipe/planting/spruce_log.json index 42d6fad52..6dc239ac4 100644 --- a/src/generated/resources/data/ragium/recipe/planting/spruce_log.json +++ b/src/generated/resources/data/ragium/recipe/planting/spruce_log.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:spruce_sapling" }, - "primary_result": { - "count": 48, - "id": "minecraft:spruce_log" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:spruce_sapling" - }, + "results": [ + { + "count": 48, + "id": "minecraft:spruce_log" + }, + { + "count": 12, + "id": "minecraft:spruce_sapling" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/sugar_cane.json b/src/generated/resources/data/ragium/recipe/planting/sugar_cane.json index 270ea32ac..11234cdb7 100644 --- a/src/generated/resources/data/ragium/recipe/planting/sugar_cane.json +++ b/src/generated/resources/data/ragium/recipe/planting/sugar_cane.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:sugar_cane" }, - "primary_result": { + "results": { "count": 24, "id": "minecraft:sugar_cane" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/sweet_berries.json b/src/generated/resources/data/ragium/recipe/planting/sweet_berries.json index fd27c1126..c7eec66a6 100644 --- a/src/generated/resources/data/ragium/recipe/planting/sweet_berries.json +++ b/src/generated/resources/data/ragium/recipe/planting/sweet_berries.json @@ -4,7 +4,7 @@ "count": 8, "items": "minecraft:sweet_berries" }, - "primary_result": { + "results": { "count": 16, "id": "minecraft:sweet_berries" }, diff --git a/src/generated/resources/data/ragium/recipe/planting/torchflower.json b/src/generated/resources/data/ragium/recipe/planting/torchflower.json index 9649b7401..c53e52431 100644 --- a/src/generated/resources/data/ragium/recipe/planting/torchflower.json +++ b/src/generated/resources/data/ragium/recipe/planting/torchflower.json @@ -4,13 +4,15 @@ "count": 8, "items": "#c:seeds/torchflower" }, - "primary_result": { - "count": 12, - "id": "minecraft:torchflower" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:torchflower_seeds" - }, + "results": [ + { + "count": 12, + "id": "minecraft:torchflower" + }, + { + "count": 12, + "id": "minecraft:torchflower_seeds" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/warped_stem.json b/src/generated/resources/data/ragium/recipe/planting/warped_stem.json index d046b81b4..94ef96e67 100644 --- a/src/generated/resources/data/ragium/recipe/planting/warped_stem.json +++ b/src/generated/resources/data/ragium/recipe/planting/warped_stem.json @@ -4,13 +4,15 @@ "count": 8, "items": "minecraft:warped_fungus" }, - "primary_result": { - "count": 48, - "id": "minecraft:warped_stem" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:warped_fungus" - }, + "results": [ + { + "count": 48, + "id": "minecraft:warped_stem" + }, + { + "count": 12, + "id": "minecraft:warped_fungus" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/generated/resources/data/ragium/recipe/planting/wheat.json b/src/generated/resources/data/ragium/recipe/planting/wheat.json index d5fa3316a..c53b43c64 100644 --- a/src/generated/resources/data/ragium/recipe/planting/wheat.json +++ b/src/generated/resources/data/ragium/recipe/planting/wheat.json @@ -4,13 +4,15 @@ "count": 8, "items": "#c:seeds/wheat" }, - "primary_result": { - "count": 12, - "id": "minecraft:wheat" - }, - "secondary_result": { - "count": 12, - "id": "minecraft:wheat_seeds" - }, + "results": [ + { + "count": 12, + "id": "minecraft:wheat" + }, + { + "count": 12, + "id": "minecraft:wheat_seeds" + } + ], "time": 200 } \ No newline at end of file diff --git a/src/lib/kotlin/hiiragi283/lib/collection/NonEmptyList.kt b/src/lib/kotlin/hiiragi283/lib/collection/NonEmptyList.kt new file mode 100644 index 000000000..bbc779fa9 --- /dev/null +++ b/src/lib/kotlin/hiiragi283/lib/collection/NonEmptyList.kt @@ -0,0 +1,75 @@ +@file:Suppress("JavaDefaultMethodsNotOverriddenByDelegation") + +package hiiragi283.lib.collection + +/** + * [NonEmptyList]を省略したエイリアスです。 + * @author Hiiragi Tsubasa + * @since 26.1.6 + */ +typealias Nel = NonEmptyList + +/** + * 常に一つ以上の値を保持する[List]の実装クラスです。 + * @param E リストの要素のクラス + * @author Hiiragi Tsubasa + * @since 26.1.6 + */ +class NonEmptyList @PublishedApi internal constructor(val head: E, val tail: List) : List { + constructor(head: E) : this(head, listOf()) + + val all: List get() = listOf(head) + tail + + override fun equals(other: Any?): Boolean = when (other) { + is Nel<*> -> this.all == other.all + else -> this.all == other + } + + override fun hashCode(): Int = all.hashCode() + + override fun toString(): String = all.toString() + + // List // + + override val size: Int get() = all.size + + override fun isEmpty(): Boolean = false + + override fun contains(element: @UnsafeVariance E): Boolean = all.contains(element) + + override fun iterator(): Iterator = all.iterator() + + override fun containsAll(elements: Collection<@UnsafeVariance E>): Boolean = all.containsAll(elements) + + override fun get(index: Int): E = all[index] + + override fun indexOf(element: @UnsafeVariance E): Int = all.indexOf(element) + + override fun lastIndexOf(element: @UnsafeVariance E): Int = all.lastIndexOf(element) + + override fun listIterator(): ListIterator = all.listIterator() + + override fun listIterator(index: Int): ListIterator = all.listIterator(index) + + override fun subList(fromIndex: Int, toIndex: Int): List = all.subList(fromIndex, toIndex) + + // Extensions // + + fun first(): E = head + + fun firstOrNull(): E = head + + inline fun map(transform: (E) -> R): Nel = Nel(transform(this.head), this.tail.map(transform)) + + inline fun mapIndexed(transform: (index: Int, E) -> R): Nel = this.all.mapIndexed(transform).toNel() + + fun distinct(): Nel = this.toMutableSet().toNel() + + operator fun plus(element: @UnsafeVariance E): Nel = Nel(this.head, this.tail + element) + + operator fun plus(elements: Array): Nel = Nel(this.head, this.tail + elements) + + operator fun plus(elements: Iterable<@UnsafeVariance E>): Nel = Nel(this.head, this.tail + elements) + + operator fun plus(elements: Sequence<@UnsafeVariance E>): Nel = Nel(this.head, this.tail + elements) +} diff --git a/src/lib/kotlin/hiiragi283/lib/collection/NonEmptyLists.kt b/src/lib/kotlin/hiiragi283/lib/collection/NonEmptyLists.kt new file mode 100644 index 000000000..de3a9d110 --- /dev/null +++ b/src/lib/kotlin/hiiragi283/lib/collection/NonEmptyLists.kt @@ -0,0 +1,38 @@ +package hiiragi283.lib.collection + +/** + * @param E リストの要素のクラス + * @author Hiiragi Tsubasa + * @since 26.1.6 + */ +fun nelOf(head: E, vararg tail: E): Nel = Nel(head, listOf(*tail)) + +/** + * @param E リストの要素のクラス + * @author Hiiragi Tsubasa + * @since 26.1.6 + */ +fun E.toNel(): Nel = NonEmptyList(this) + +// Iterable <-> Nel // + +/** + * この[Iterable][this]を[Nel]に変換します。 + * @param E リストの要素のクラス + * @throws NoSuchElementException [Iterable.none]の場合 + * @author Hiiragi Tsubasa + * @since 26.1.6 + */ +fun Iterable.toNel(): Nel = NonEmptyList(this.first(), this.drop(1)) + +/** + * この[Iterable][this]を[Nel]に変換します。 + * @param E リストの要素のクラス + * @return [Iterable.none]の場合は`null` + * @author Hiiragi Tsubasa + * @since 26.1.6 + */ +fun Iterable.toNelOrNull(): Nel? { + val head: E = this.firstOrNull() ?: return null + return NonEmptyList(head, this.drop(1)) +} diff --git a/src/lib/kotlin/hiiragi283/lib/data/recipe/builder/HTItemToDoubleItemRecipeBuilder.kt b/src/lib/kotlin/hiiragi283/lib/data/recipe/builder/HTItemToDoubleItemRecipeBuilder.kt index c2d02589a..5c1739b3f 100644 --- a/src/lib/kotlin/hiiragi283/lib/data/recipe/builder/HTItemToDoubleItemRecipeBuilder.kt +++ b/src/lib/kotlin/hiiragi283/lib/data/recipe/builder/HTItemToDoubleItemRecipeBuilder.kt @@ -2,15 +2,17 @@ package hiiragi283.lib.data.recipe.builder +import hiiragi283.lib.collection.Nel +import hiiragi283.lib.collection.toNel import hiiragi283.lib.data.recipe.ingredient.HTItemIngredientBuilder import hiiragi283.lib.data.recipe.result.HTItemResultBuilder import hiiragi283.lib.recipe.base.HTProgressData import hiiragi283.lib.recipe.ingredient.HTItemIngredient import hiiragi283.lib.recipe.result.HTItemResult import hiiragi283.lib.util.HTDelegates +import it.unimi.dsi.fastutil.objects.ObjectArrayList import net.minecraft.resources.Identifier import net.minecraft.world.item.crafting.Recipe -import java.util.Optional import kotlin.contracts.ExperimentalContracts import kotlin.contracts.InvocationKind import kotlin.contracts.contract @@ -23,9 +25,9 @@ import kotlin.contracts.contract */ class HTItemToDoubleItemRecipeBuilder>(prefix: String, private val factory: Factory) : HTProgressRecipeBuilder(prefix) { - override fun getRecipeId(): Identifier? = primary.getId() + override fun getRecipeId(): Identifier? = results.first().getId() - override fun createRecipe(): RECIPE = factory.create(ingredient, primary, secondary, progressData) + override fun createRecipe(): RECIPE = factory.create(ingredient, results.toNel(), progressData) // Ingredient @PublishedApi internal var ingredient: HTItemIngredient by HTDelegates.onceInitialize() @@ -42,22 +44,13 @@ class HTItemToDoubleItemRecipeBuilder>(prefix: String, pr } // Result - @PublishedApi internal var primary: HTItemResult by HTDelegates.onceInitialize() + @PublishedApi internal val results: MutableList = ObjectArrayList() - @PublishedApi internal var secondary: Optional by HTDelegates.optionalInitialize() - - inline fun primary(builderAction: HTItemResultBuilder.() -> Unit) { - contract { - callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) - } - primary = HTItemResultBuilder.build(builderAction) - } - - inline fun secondary(builderAction: HTItemResultBuilder.() -> Unit) { + inline fun result(builderAction: HTItemResultBuilder.() -> Unit) { contract { callsInPlace(builderAction, InvocationKind.EXACTLY_ONCE) } - secondary = Optional.of(HTItemResultBuilder.build(builderAction)) + results += HTItemResultBuilder.build(builderAction) } // Factory // @@ -68,11 +61,6 @@ class HTItemToDoubleItemRecipeBuilder>(prefix: String, pr * @since 26.1.0 */ fun interface Factory { - fun create( - ingredient: HTItemIngredient, - primary: HTItemResult, - secondary: Optional, - progressData: HTProgressData - ): RECIPE + fun create(ingredient: HTItemIngredient, results: Nel, progressData: HTProgressData): RECIPE } } diff --git a/src/lib/kotlin/hiiragi283/lib/integration/jei/category/HTItemToDoubleItemRecipeCategory.kt b/src/lib/kotlin/hiiragi283/lib/integration/jei/category/HTItemToDoubleItemRecipeCategory.kt index e41abb576..dfe2070df 100644 --- a/src/lib/kotlin/hiiragi283/lib/integration/jei/category/HTItemToDoubleItemRecipeCategory.kt +++ b/src/lib/kotlin/hiiragi283/lib/integration/jei/category/HTItemToDoubleItemRecipeCategory.kt @@ -33,13 +33,13 @@ class HTItemToDoubleItemRecipeCategory( // output builder .addOutputSlot(getPosition(3), getPosition(0)) - .add(recipe.primary) + .add(recipe.result.head) .setSlotBackground(HTBackgroundType.OUTPUT) val slot: IRecipeSlotBuilder = builder .addOutputSlot(getPosition(5), getPosition(0)) .setSlotBackground(HTBackgroundType.EXTRA_OUTPUT) - recipe.secondary.ifPresent(slot::add) + recipe.result.getOrNull(1)?.let(slot::add) } override fun setupRecipeExtras( diff --git a/src/lib/kotlin/hiiragi283/lib/recipe/base/HTItemToDoubleItemRecipe.kt b/src/lib/kotlin/hiiragi283/lib/recipe/base/HTItemToDoubleItemRecipe.kt index 6d6e09ea6..766786c7f 100644 --- a/src/lib/kotlin/hiiragi283/lib/recipe/base/HTItemToDoubleItemRecipe.kt +++ b/src/lib/kotlin/hiiragi283/lib/recipe/base/HTItemToDoubleItemRecipe.kt @@ -2,18 +2,19 @@ package hiiragi283.lib.recipe.base import com.mojang.serialization.MapCodec import hiiragi283.lib.HTConstants +import hiiragi283.lib.collection.Nel import hiiragi283.lib.data.recipe.builder.HTItemToDoubleItemRecipeBuilder import hiiragi283.lib.recipe.ingredient.HTItemIngredient import hiiragi283.lib.recipe.result.HTItemResult import hiiragi283.lib.recipe.result.createOrEmpty import hiiragi283.lib.serialization.codec.HTCodecs -import hiiragi283.lib.serialization.network.HTStreamCodecs +import hiiragi283.lib.serialization.codec.nelOrElement +import hiiragi283.lib.serialization.network.nelOf import net.minecraft.network.RegistryFriendlyByteBuf import net.minecraft.network.codec.StreamCodec import net.minecraft.world.item.ItemInstance import net.minecraft.world.item.ItemStack import net.minecraft.world.item.crafting.SingleRecipeInput -import java.util.Optional /** * 1種類のアイテムから2種類のアイテムを作成するレシピを表すインターフェースです。 @@ -43,8 +44,7 @@ interface HTItemToDoubleItemRecipe : */ open class Basic( val ingredient: HTItemIngredient, - val primary: HTItemResult, - val secondary: Optional, + val result: Nel, override val progressData: HTProgressData ) : HTItemToDoubleItemRecipe, HTProgressRecipe.Simple { @@ -54,8 +54,7 @@ interface HTItemToDoubleItemRecipe : HTCodecs.recordMap { instance -> instance.group( HTItemIngredient.CODEC.fieldOf(HTConstants.INGREDIENT).forGetter(Basic::ingredient), - HTItemResult.CODEC.fieldOf(HTConstants.PRIMARY_RESULT).forGetter(Basic::primary), - HTItemResult.CODEC.optionalFieldOf(HTConstants.SECONDARY_RESULT).forGetter(Basic::secondary), + HTItemResult.CODEC.nelOrElement(2).fieldOf(HTConstants.RESULTS).forGetter(Basic::result), HTProgressData.CODEC.forGetter(Basic::progressData) ).apply(instance, factory::create) } @@ -69,10 +68,8 @@ interface HTItemToDoubleItemRecipe : ): StreamCodec = StreamCodec.composite( HTItemIngredient.STREAM_CODEC, Basic::ingredient, - HTItemResult.STREAM_CODEC, - Basic::primary, - HTStreamCodecs.optional(HTItemResult.STREAM_CODEC), - Basic::secondary, + HTItemResult.STREAM_CODEC.nelOf(), + Basic::result, HTProgressData.STREAM_CODEC, Basic::progressData, factory::create @@ -84,6 +81,6 @@ interface HTItemToDoubleItemRecipe : override fun getRequiredAmount(input: ItemInstance): Int = ingredient.getRequiredAmount(input) override fun apply(input: ItemInstance): Pair = - primary.create() to secondary.createOrEmpty() + result.head.create() to result.getOrNull(1).createOrEmpty() } } diff --git a/src/lib/kotlin/hiiragi283/lib/serialization/codec/Codecs.kt b/src/lib/kotlin/hiiragi283/lib/serialization/codec/Codecs.kt index bbe7347c2..33adcb2ae 100644 --- a/src/lib/kotlin/hiiragi283/lib/serialization/codec/Codecs.kt +++ b/src/lib/kotlin/hiiragi283/lib/serialization/codec/Codecs.kt @@ -1,6 +1,9 @@ package hiiragi283.lib.serialization.codec import com.mojang.serialization.Codec +import hiiragi283.lib.collection.Nel +import hiiragi283.lib.collection.toNel +import hiiragi283.lib.util.identity import net.minecraft.util.ExtraCodecs // List // @@ -41,6 +44,28 @@ fun Codec.listOrElement(range: IntRange): Codec> = this.lis fun Codec.listOrElement(min: Int, max: Int): Codec> = ExtraCodecs.compactListCodec(this, this.listOf(min, max)) +// NonEmptyList // + +/** + * この[Codec][this]を,要素が一つの場合はそのままコーデックする[Nel]の[Codec]に変換します。 + * @param max リストの[長さ][List.size]の最大値 + * @return リストの[長さ][List.size]が制限された[List]の[Codec] + * @author Hiiragi Tsubasa + * @since 26.1.6 + */ +fun Codec.nelOrElement(max: Int = Int.MAX_VALUE): Codec> = + this.listOrElement(1, max).xmap(List::toNel, identity()) + +/** + * この[Codec][this]を[Nel]の[Codec]に変換します。 + * @param max リストの[長さ][List.size]の最大値 + * @return リストの[長さ][List.size]が制限された[List]の[Codec] + * @author Hiiragi Tsubasa + * @since 26.1.6 + */ +fun Codec.nelOf(max: Int = Int.MAX_VALUE): Codec> = + this.listOf(1, max).xmap(List::toNel, identity()) + // Set // /** diff --git a/src/lib/kotlin/hiiragi283/lib/serialization/network/StreamCodecs.kt b/src/lib/kotlin/hiiragi283/lib/serialization/network/StreamCodecs.kt index af2dc8a2e..9ea493640 100644 --- a/src/lib/kotlin/hiiragi283/lib/serialization/network/StreamCodecs.kt +++ b/src/lib/kotlin/hiiragi283/lib/serialization/network/StreamCodecs.kt @@ -1,5 +1,8 @@ package hiiragi283.lib.serialization.network +import hiiragi283.lib.collection.Nel +import hiiragi283.lib.collection.toNel +import hiiragi283.lib.util.identity import io.netty.buffer.ByteBuf import net.minecraft.network.codec.ByteBufCodecs import net.minecraft.network.codec.StreamCodec @@ -14,3 +17,13 @@ import net.minecraft.network.codec.StreamCodec * @since 26.1.0 */ fun StreamCodec.listOf(): StreamCodec> = this.apply(ByteBufCodecs.list()) + +/** + * この[StreamCodec][this]を[Nel]の[StreamCodec]に変換します。 + * @param B パケットのクラス + * @param V 値のクラス + * @author Hiiragi Tsubasa + * @since 26.1.6 + */ +fun StreamCodec.nelOf(): StreamCodec> = + this.listOf().map(List::toNel, identity()) diff --git a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RTElectrolyzingRecipeBuilder.kt b/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RTElectrolyzingRecipeBuilder.kt index 1431bf7d9..daa089d8a 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RTElectrolyzingRecipeBuilder.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/data/recipe/builder/RTElectrolyzingRecipeBuilder.kt @@ -2,6 +2,7 @@ package hiiragi283.ragium.api.data.recipe.builder +import hiiragi283.lib.collection.toNel import hiiragi283.lib.data.recipe.builder.HTProgressRecipeBuilder import hiiragi283.lib.data.recipe.ingredient.HTFluidIngredientBuilder import hiiragi283.lib.data.recipe.ingredient.HTItemIngredientBuilder @@ -23,7 +24,7 @@ class RTElectrolyzingRecipeBuilder : HTProgressRecipeBuilder by HTDelegates.optionalInitialize() diff --git a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTCrushingRecipe.kt b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTCrushingRecipe.kt index c9a51b4d5..5f413883f 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTCrushingRecipe.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTCrushingRecipe.kt @@ -1,5 +1,6 @@ package hiiragi283.ragium.api.recipe +import hiiragi283.lib.collection.Nel import hiiragi283.lib.recipe.HTRecipeType import hiiragi283.lib.recipe.HTSerializableRecipe import hiiragi283.lib.recipe.base.HTItemToDoubleItemRecipe @@ -8,14 +9,9 @@ import hiiragi283.lib.recipe.ingredient.HTItemIngredient import hiiragi283.lib.recipe.result.HTItemResult import net.minecraft.world.item.crafting.RecipeSerializer import net.minecraft.world.item.crafting.SingleRecipeInput -import java.util.Optional -class RTCrushingRecipe( - ingredient: HTItemIngredient, - primary: HTItemResult, - secondary: Optional, - progressData: HTProgressData -) : HTItemToDoubleItemRecipe.Basic(ingredient, primary, secondary, progressData), +class RTCrushingRecipe(ingredient: HTItemIngredient, result: Nel, progressData: HTProgressData) : + HTItemToDoubleItemRecipe.Basic(ingredient, result, progressData), HTSerializableRecipe { companion object { @JvmField diff --git a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTCuttingRecipe.kt b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTCuttingRecipe.kt index 5f43f9b04..fc4b53e52 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTCuttingRecipe.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTCuttingRecipe.kt @@ -1,5 +1,6 @@ package hiiragi283.ragium.api.recipe +import hiiragi283.lib.collection.Nel import hiiragi283.lib.recipe.HTRecipeType import hiiragi283.lib.recipe.HTSerializableRecipe import hiiragi283.lib.recipe.base.HTItemToDoubleItemRecipe @@ -8,14 +9,9 @@ import hiiragi283.lib.recipe.ingredient.HTItemIngredient import hiiragi283.lib.recipe.result.HTItemResult import net.minecraft.world.item.crafting.RecipeSerializer import net.minecraft.world.item.crafting.SingleRecipeInput -import java.util.Optional -class RTCuttingRecipe( - ingredient: HTItemIngredient, - primary: HTItemResult, - secondary: Optional, - progressData: HTProgressData -) : HTItemToDoubleItemRecipe.Basic(ingredient, primary, secondary, progressData), +class RTCuttingRecipe(ingredient: HTItemIngredient, result: Nel, progressData: HTProgressData) : + HTItemToDoubleItemRecipe.Basic(ingredient, result, progressData), HTSerializableRecipe { companion object { @JvmField diff --git a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTElectrolyzingRecipe.kt b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTElectrolyzingRecipe.kt index ec539b5a7..90574283b 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTElectrolyzingRecipe.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTElectrolyzingRecipe.kt @@ -2,6 +2,7 @@ package hiiragi283.ragium.api.recipe import com.mojang.serialization.MapCodec import hiiragi283.lib.HTConstants +import hiiragi283.lib.collection.Nel import hiiragi283.lib.recipe.HTRecipeType import hiiragi283.lib.recipe.HTSerializableRecipe import hiiragi283.lib.recipe.base.HTProgressData @@ -15,8 +16,9 @@ import hiiragi283.lib.recipe.input.HTItemAndFluidRecipeInput import hiiragi283.lib.recipe.result.HTFluidResult import hiiragi283.lib.recipe.result.createOrEmpty import hiiragi283.lib.serialization.codec.HTCodecs +import hiiragi283.lib.serialization.codec.nelOf import hiiragi283.lib.serialization.network.HTStreamCodecs -import hiiragi283.lib.serialization.network.listOf +import hiiragi283.lib.serialization.network.nelOf import hiiragi283.lib.util.fold import net.minecraft.network.RegistryFriendlyByteBuf import net.minecraft.network.codec.StreamCodec @@ -30,7 +32,7 @@ import java.util.Optional data class RTElectrolyzingRecipe( val itemIngredient: Optional, val fluidIngredient: HTFluidIngredient, - val results: List, + val results: Nel, override val progressData: HTProgressData ) : HTRecipePredicates.ItemAndFluid, HTRecipeFactories.ItemAndFluid>, @@ -40,13 +42,13 @@ data class RTElectrolyzingRecipe( @JvmField val CODEC: MapCodec = HTCodecs.recordMap { instance -> instance.group( - HTItemIngredient.CODEC.optionalFieldOf( - HTConstants.ITEM_INGREDIENT - ).forGetter(RTElectrolyzingRecipe::itemIngredient), - HTFluidIngredient.CODEC.fieldOf( - HTConstants.FLUID_INGREDIENT - ).forGetter(RTElectrolyzingRecipe::fluidIngredient), - HTFluidResult.CODEC.listOf(2, 3).fieldOf(HTConstants.RESULTS).forGetter(RTElectrolyzingRecipe::results), + HTItemIngredient.CODEC + .optionalFieldOf(HTConstants.ITEM_INGREDIENT) + .forGetter(RTElectrolyzingRecipe::itemIngredient), + HTFluidIngredient.CODEC + .fieldOf(HTConstants.FLUID_INGREDIENT) + .forGetter(RTElectrolyzingRecipe::fluidIngredient), + HTFluidResult.CODEC.nelOf(3).fieldOf(HTConstants.RESULTS).forGetter(RTElectrolyzingRecipe::results), HTProgressData.CODEC.forGetter(RTElectrolyzingRecipe::progressData) ).apply(instance, ::RTElectrolyzingRecipe) } @@ -57,7 +59,7 @@ data class RTElectrolyzingRecipe( RTElectrolyzingRecipe::itemIngredient, HTFluidIngredient.STREAM_CODEC, RTElectrolyzingRecipe::fluidIngredient, - HTFluidResult.STREAM_CODEC.listOf(), + HTFluidResult.STREAM_CODEC.nelOf(), RTElectrolyzingRecipe::results, HTProgressData.STREAM_CODEC, RTElectrolyzingRecipe::progressData, @@ -77,8 +79,8 @@ data class RTElectrolyzingRecipe( ) override fun apply(first: ItemInstance, second: FluidInstance): Triple = Triple( - results[0].create(), - results[1].create(), + results.head.create(), + results.getOrNull(1).createOrEmpty(), results.getOrNull(2).createOrEmpty() ) diff --git a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTPlantingRecipe.kt b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTPlantingRecipe.kt index 94eafed96..8ed2209e3 100644 --- a/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTPlantingRecipe.kt +++ b/src/lib/kotlin/hiiragi283/ragium/api/recipe/RTPlantingRecipe.kt @@ -1,5 +1,6 @@ package hiiragi283.ragium.api.recipe +import hiiragi283.lib.collection.Nel import hiiragi283.lib.recipe.HTRecipeType import hiiragi283.lib.recipe.HTSerializableRecipe import hiiragi283.lib.recipe.base.HTItemToDoubleItemRecipe @@ -8,14 +9,9 @@ import hiiragi283.lib.recipe.ingredient.HTItemIngredient import hiiragi283.lib.recipe.result.HTItemResult import net.minecraft.world.item.crafting.RecipeSerializer import net.minecraft.world.item.crafting.SingleRecipeInput -import java.util.Optional -class RTPlantingRecipe( - ingredient: HTItemIngredient, - primary: HTItemResult, - secondary: Optional, - progressData: HTProgressData -) : HTItemToDoubleItemRecipe.Basic(ingredient, primary, secondary, progressData), +class RTPlantingRecipe(ingredient: HTItemIngredient, result: Nel, progressData: HTProgressData) : + HTItemToDoubleItemRecipe.Basic(ingredient, result, progressData), HTSerializableRecipe { companion object { @JvmField