Skip to content

Commit

Permalink
Fixed the trick apple recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
Sollace committed Oct 10, 2024
1 parent 0995d01 commit 8c90991
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import org.jetbrains.annotations.Nullable;
import org.spongepowered.include.com.google.common.base.Preconditions;

import com.minelittlepony.unicopia.item.UItems;
import com.minelittlepony.unicopia.recipe.ZapAppleRecipe;

import net.minecraft.advancement.Advancement;
Expand Down Expand Up @@ -71,7 +72,7 @@ public void offerTo(RecipeExporter exporter, Identifier id) {
.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, UItems.ZAP_APPLE.setAppearance(UItems.ZAP_APPLE.getDefaultStack(), output.getDefaultStack()), inputs),
builder.build(id.withPrefixedPath("recipes/" + category.getName() + "/"))
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public ZapAppleRecipe(String group, CraftingRecipeCategory category, ItemStack o
super(group, category, output, input);
}

@Override
public RecipeSerializer<?> getSerializer() {
return URecipes.ZAP_APPLE_SERIALIZER;
}

public static class Serializer implements RecipeSerializer<ZapAppleRecipe> {
private static final Codec<ZapAppleRecipe> CODEC = RecordCodecBuilder.create(instance -> instance.group(
Codec.STRING.optionalFieldOf("group", "").forGetter(ZapAppleRecipe::getGroup),
Expand Down

0 comments on commit 8c90991

Please sign in to comment.