Class RecipeMerger
java.lang.Object
com.example.uselocalrecipes.recipe.RecipeMerger
Combines the recipes the server sent with the recipes that were read from local files.
-
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.item.crafting.RecipeMapmerge(net.minecraft.world.item.crafting.RecipeMap serverRecipes, Set<net.minecraft.world.item.crafting.RecipeType<?>> serverTypes, net.minecraft.world.item.crafting.RecipeMap localRecipes, boolean preferServerTypes) Deduplicates by id with the server always winning.static net.minecraft.world.item.crafting.RecipeMaptoRecipeMap(Collection<net.minecraft.world.item.crafting.RecipeHolder<?>> holders) Since 26.3 recipes are registry entries, the map has to be built through a lookup keyed by recipe id.static Set<net.minecraft.world.item.crafting.RecipeType<?>> typesOf(net.minecraft.world.item.crafting.RecipeMap recipes)
-
Method Details
-
merge
public static net.minecraft.world.item.crafting.RecipeMap merge(net.minecraft.world.item.crafting.RecipeMap serverRecipes, Set<net.minecraft.world.item.crafting.RecipeType<?>> serverTypes, net.minecraft.world.item.crafting.RecipeMap localRecipes, boolean preferServerTypes) Deduplicates by id with the server always winning. WithpreferServerTypes, locally read recipes of a type the server sent are dropped, the server knows that type better. -
toRecipeMap
public static net.minecraft.world.item.crafting.RecipeMap toRecipeMap(Collection<net.minecraft.world.item.crafting.RecipeHolder<?>> holders) Since 26.3 recipes are registry entries, the map has to be built through a lookup keyed by recipe id. -
typesOf
public static Set<net.minecraft.world.item.crafting.RecipeType<?>> typesOf(net.minecraft.world.item.crafting.RecipeMap recipes)
-