package info.u_team.u_team_core.util;

import com.google.gson.JsonObject;

import net.minecraft.data.recipes.FinishedRecipe;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeSerializer;

public class RecipeBuilderUtil {
	
	public static FinishedRecipe getRecipeWithSerializer(FinishedRecipe recipe, RecipeSerializer<?> serializer) {
		return new FinishedRecipe() {
			
			@Override
			public void serializeRecipeData(JsonObject json) {
				recipe.serializeRecipeData(json);
			}
			
			@Override
			public RecipeSerializer<?> getType() {
				return serializer;
			}
			
			@Override
			public ResourceLocation getId() {
				return recipe.getId();
			}
			
			@Override
			public JsonObject serializeAdvancement() {
				return recipe.serializeAdvancement();
			}
			
			@Override
			public ResourceLocation getAdvancementId() {
				return recipe.getAdvancementId();
			}
		};
	}
	
}

@@ -231,42 +231,295 @@
 r;%0A%0A
-public class RecipeBuilderUtil %7B%0A%09
+/**%0A * Utility methods for recipes%0A * %0A * @author HyCraftHD%0A */%0Apublic class RecipeBuilderUtil %7B%0A%09%0A%09/**%0A%09 * Returns a %7B@link FinishedRecipe%7D with a custom serializer.%0A%09 * %0A%09 * @param recipe Finished recipe%0A%09 * @param serializer Serializer%0A%09 * @return Finished recipe with serializer%0A%09 */
 %0A%09pu

Document recipe util