Fixed the trick apple recipes

This commit is contained in:
Sollace 2024-10-10 18:59:37 +01:00
parent 0995d01a2f
commit 8c90991214
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 7 additions and 1 deletions

View file

@ -5,6 +5,7 @@ import java.util.Map;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.spongepowered.include.com.google.common.base.Preconditions; import org.spongepowered.include.com.google.common.base.Preconditions;
import com.minelittlepony.unicopia.item.UItems;
import com.minelittlepony.unicopia.recipe.ZapAppleRecipe; import com.minelittlepony.unicopia.recipe.ZapAppleRecipe;
import net.minecraft.advancement.Advancement; import net.minecraft.advancement.Advancement;
@ -71,7 +72,7 @@ public class TrickCraftingRecipeJsonBuilder implements CraftingRecipeJsonBuilder
.criteriaMerger(AdvancementRequirements.CriterionMerger.OR); .criteriaMerger(AdvancementRequirements.CriterionMerger.OR);
criterions.forEach(builder::criterion); criterions.forEach(builder::criterion);
exporter.accept(id, 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() + "/")) builder.build(id.withPrefixedPath("recipes/" + category.getName() + "/"))
); );
} }

View file

@ -18,6 +18,11 @@ public class ZapAppleRecipe extends ShapelessRecipe {
super(group, category, output, input); super(group, category, output, input);
} }
@Override
public RecipeSerializer<?> getSerializer() {
return URecipes.ZAP_APPLE_SERIALIZER;
}
public static class Serializer implements RecipeSerializer<ZapAppleRecipe> { public static class Serializer implements RecipeSerializer<ZapAppleRecipe> {
private static final Codec<ZapAppleRecipe> CODEC = RecordCodecBuilder.create(instance -> instance.group( private static final Codec<ZapAppleRecipe> CODEC = RecordCodecBuilder.create(instance -> instance.group(
Codec.STRING.optionalFieldOf("group", "").forGetter(ZapAppleRecipe::getGroup), Codec.STRING.optionalFieldOf("group", "").forGetter(ZapAppleRecipe::getGroup),