Interface CompatRecipeDeserializer<R extends net.minecraft.world.item.crafting.Recipe<?>>
- All Known Implementing Classes:
BnCFermentingRecipeDeserializer,BnCPouringRecipeDeserializer,YoukaisHomecomingSimpleFermentationRecipeDeserializer
public interface CompatRecipeDeserializer<R extends net.minecraft.world.item.crafting.Recipe<?>>
Convert Recipes added by other mods to Recipes in your own mod by emulating their Codecs and reading the JSON files as they are loaded.
These should be
registered to Petrolpark.COMPAT_RECIPES during mod intialization.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.resources.ResourceLocationcreateId(net.minecraft.resources.ResourceLocation baseId) decoder()Decoder that should emulate the Codec used by the other mod'sRecipe Serializer.net.minecraft.resources.ResourceLocationThe ID of the other mod'sRecipe Serializerthat thisCompatRecipeDeserializershould emulate.default booleanshouldDeserialize(com.google.gson.JsonElement element, net.minecraft.resources.ResourceLocation id)
-
Method Details
-
serializerId
net.minecraft.resources.ResourceLocation serializerId()The ID of the other mod'sRecipe Serializerthat thisCompatRecipeDeserializershould emulate. -
decoder
Decoder that should emulate the Codec used by the other mod'sRecipe Serializer. This Decoder should return aDataResult.error(java.util.function.Supplier<java.lang.String>, R)if there is a formatting issue with the Recipe, but aDataResult.success(R)containing an empty Optional if there is nothing unexpected with the JSON but it cannot be converted (for example, if the other mod's Recipe may optionally include Fluids but your Recipe cannot). -
shouldDeserialize
default boolean shouldDeserialize(com.google.gson.JsonElement element, net.minecraft.resources.ResourceLocation id) -
createId
net.minecraft.resources.ResourceLocation createId(net.minecraft.resources.ResourceLocation baseId)
-