From fc6c376d37cdadb120ff71475d2084ac3759fd5b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 12 Mar 2024 20:09:56 +0100 Subject: [PATCH] fixed recipes --- .../blocks/tiles/BlockEntityWoodStand.java | 2 +- .../naturesaura/compat/jei/TreeRitualCategory.java | 2 +- .../compat/patchouli/ProcessorTreeRitual.java | 4 ++-- .../de/ellpeck/naturesaura/recipes/AltarRecipe.java | 4 ++-- .../ellpeck/naturesaura/recipes/OfferingRecipe.java | 2 +- .../naturesaura/recipes/TreeRitualRecipe.java | 12 ++++++------ .../data/naturesaura/recipes/gold_fiber.json | 4 ++-- 7 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityWoodStand.java b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityWoodStand.java index ddc8e414..baefc512 100644 --- a/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityWoodStand.java +++ b/src/main/java/de/ellpeck/naturesaura/blocks/tiles/BlockEntityWoodStand.java @@ -83,7 +83,7 @@ public class BlockEntityWoodStand extends BlockEntityImpl implements ITickableBl var item = new ItemEntity(this.level, this.ritualPos.getX() + 0.5, this.ritualPos.getY() + 4.5, this.ritualPos.getZ() + 0.5, - this.recipe.value().result.copy()); + this.recipe.value().output.copy()); this.level.addFreshEntity(item); PacketHandler.sendToAllAround(this.level, this.worldPosition, 32, diff --git a/src/main/java/de/ellpeck/naturesaura/compat/jei/TreeRitualCategory.java b/src/main/java/de/ellpeck/naturesaura/compat/jei/TreeRitualCategory.java index 623273b8..86818e9e 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/jei/TreeRitualCategory.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/jei/TreeRitualCategory.java @@ -45,7 +45,7 @@ public class TreeRitualCategory implements IRecipeCategory { @Override public void setRecipe(IRecipeLayoutBuilder builder, TreeRitualRecipe recipe, IFocusGroup focuses) { builder.addSlot(RecipeIngredientRole.CATALYST, 35, 35).addItemStacks(Arrays.asList(recipe.saplingType.getItems())); - builder.addSlot(RecipeIngredientRole.OUTPUT, 125, 35).addItemStack(recipe.result); + builder.addSlot(RecipeIngredientRole.OUTPUT, 125, 35).addItemStack(recipe.output); var positions = new int[][]{{35, 1}, {35, 69}, {1, 35}, {69, 35}, {12, 12}, {58, 58}, {58, 12}, {12, 58}}; for (var i = 0; i < recipe.ingredients.size(); i++) diff --git a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorTreeRitual.java b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorTreeRitual.java index 4691f24c..01bda960 100644 --- a/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorTreeRitual.java +++ b/src/main/java/de/ellpeck/naturesaura/compat/patchouli/ProcessorTreeRitual.java @@ -24,9 +24,9 @@ public class ProcessorTreeRitual implements IComponentProcessor { return this.recipe.ingredients.size() > id ? PatchouliCompat.ingredientVariable(this.recipe.ingredients.get(id)) : null; } else { return switch (key) { - case "output" -> IVariable.from(this.recipe.result); + case "output" -> IVariable.from(this.recipe.output); case "sapling" -> PatchouliCompat.ingredientVariable(this.recipe.saplingType); - case "name" -> IVariable.wrap(this.recipe.result.getHoverName().getString()); + case "name" -> IVariable.wrap(this.recipe.output.getHoverName().getString()); default -> null; }; } diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java index fd0ef49c..8b00bd1d 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/AltarRecipe.java @@ -46,8 +46,8 @@ public class AltarRecipe extends ModRecipe { private static final Codec CODEC = RecordCodecBuilder.create(i -> i.group( Ingredient.CODEC.fieldOf("input").forGetter(r -> r.input), - ItemStack.CODEC.fieldOf("output").forGetter(r -> r.output), - Ingredient.CODEC.fieldOf("catalyst").forGetter(r -> r.catalyst), + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("output").forGetter(r -> r.output), + Ingredient.CODEC.optionalFieldOf("catalyst", Ingredient.EMPTY).forGetter(r -> r.catalyst), Codec.INT.fieldOf("aura").forGetter(r -> r.aura), Codec.INT.fieldOf("time").forGetter(r -> r.time) ).apply(i, AltarRecipe::new)); diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/OfferingRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/OfferingRecipe.java index a3015cc0..18e671de 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/OfferingRecipe.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/OfferingRecipe.java @@ -43,7 +43,7 @@ public class OfferingRecipe extends ModRecipe { private static final Codec CODEC = RecordCodecBuilder.create(i -> i.group( Ingredient.CODEC.fieldOf("input").forGetter(r -> r.input), Ingredient.CODEC.fieldOf("start_item").forGetter(r -> r.startItem), - ItemStack.CODEC.fieldOf("output").forGetter(r -> r.output) + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("output").forGetter(r -> r.output) ).apply(i, OfferingRecipe::new)); @Override diff --git a/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java b/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java index d2a11b05..4e3fcf0b 100644 --- a/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java +++ b/src/main/java/de/ellpeck/naturesaura/recipes/TreeRitualRecipe.java @@ -17,19 +17,19 @@ public class TreeRitualRecipe extends ModRecipe { public final Ingredient saplingType; public final List ingredients; - public final ItemStack result; + public final ItemStack output; public final int time; - public TreeRitualRecipe(Ingredient saplingType, ItemStack result, int time, List ingredients) { + public TreeRitualRecipe(Ingredient saplingType, ItemStack output, int time, List ingredients) { this.saplingType = saplingType; this.ingredients = ingredients; - this.result = result; + this.output = output; this.time = time; } @Override public ItemStack getResultItem(RegistryAccess access) { - return this.result; + return this.output; } @Override @@ -46,7 +46,7 @@ public class TreeRitualRecipe extends ModRecipe { private static final Codec CODEC = RecordCodecBuilder.create(i -> i.group( Ingredient.CODEC.fieldOf("sapling").forGetter(r -> r.saplingType), - ItemStack.CODEC.fieldOf("result").forGetter(r -> r.result), + ItemStack.ITEM_WITH_COUNT_CODEC.fieldOf("output").forGetter(r -> r.output), Codec.INT.fieldOf("time").forGetter(r -> r.time), Ingredient.CODEC.listOf().fieldOf("ingredients").forGetter(recipe -> recipe.ingredients) ).apply(i, TreeRitualRecipe::new)); @@ -71,7 +71,7 @@ public class TreeRitualRecipe extends ModRecipe { for (var ing : recipe.ingredients) ing.toNetwork(buffer); recipe.saplingType.toNetwork(buffer); - buffer.writeItem(recipe.result); + buffer.writeItem(recipe.output); buffer.writeInt(recipe.time); } diff --git a/src/main/resources/data/naturesaura/recipes/gold_fiber.json b/src/main/resources/data/naturesaura/recipes/gold_fiber.json index 0ccb7f7d..ca185a9b 100644 --- a/src/main/resources/data/naturesaura/recipes/gold_fiber.json +++ b/src/main/resources/data/naturesaura/recipes/gold_fiber.json @@ -10,7 +10,7 @@ "tag": "forge:nuggets/gold" }, "G": { - "item": "minecraft:grass" + "item": "minecraft:grass_block" }, "L": { "tag": "minecraft:leaves" @@ -20,4 +20,4 @@ "item": "naturesaura:gold_fiber", "count": 4 } -} \ No newline at end of file +}