Fixed the trick apple recipes

This commit is contained in:
Sollace 2024-10-10 19:15:12 +01:00
parent 340227b1c4
commit 23577c1c02
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 9 additions and 1 deletions

View file

@ -5,6 +5,8 @@ import java.util.Map;
import org.jetbrains.annotations.Nullable;
import org.spongepowered.include.com.google.common.base.Preconditions;
import com.minelittlepony.unicopia.item.UItems;
import com.minelittlepony.unicopia.item.component.Appearance;
import com.minelittlepony.unicopia.recipe.ZapAppleRecipe;
import net.minecraft.advancement.Advancement;
@ -71,7 +73,7 @@ public class TrickCraftingRecipeJsonBuilder implements CraftingRecipeJsonBuilder
.criteriaMerger(AdvancementRequirements.CriterionMerger.OR);
criterions.forEach(builder::criterion);
exporter.accept(id,
new ZapAppleRecipe(group == null ? "" : group, CraftingRecipeCategory.MISC, output.getDefaultStack(), inputs),
new ZapAppleRecipe(group == null ? "" : group, CraftingRecipeCategory.MISC, Appearance.set(UItems.ZAP_APPLE.getDefaultStack(), output.getDefaultStack()), inputs),
builder.build(id.withPrefixedPath("recipes/" + category.getName() + "/"))
);
}

View file

@ -11,6 +11,7 @@ import net.minecraft.network.RegistryByteBuf;
import net.minecraft.network.codec.PacketCodec;
import net.minecraft.network.codec.PacketCodecs;
import net.minecraft.recipe.Ingredient;
import net.minecraft.recipe.RecipeSerializer;
import net.minecraft.recipe.ShapelessRecipe;
import net.minecraft.recipe.book.CraftingRecipeCategory;
import net.minecraft.util.collection.DefaultedList;
@ -37,4 +38,9 @@ public class ZapAppleRecipe extends ShapelessRecipe {
public ZapAppleRecipe(String group, CraftingRecipeCategory category, ItemStack output, DefaultedList<Ingredient> input) {
super(group, category, output, input);
}
@Override
public RecipeSerializer<?> getSerializer() {
return URecipes.ZAP_APPLE_SERIALIZER;
}
}