Not used yet, will be used in a future commit
---
Figured i'll just send these one by one, more commits incoming
.../cc3f2b57729a50761cd506b810b841f2b4fbd4d1 | 34 ++++++-------
.../data/botania/recipes/runic_altar/air.json | 3 ++
.../botania/recipes/runic_altar/autumn.json | 3 ++
.../botania/recipes/runic_altar/earth.json | 3 ++
.../botania/recipes/runic_altar/envy.json | 3 ++
.../botania/recipes/runic_altar/fire.json | 3 ++
.../botania/recipes/runic_altar/gluttony.json | 3 ++
.../botania/recipes/runic_altar/greed.json | 3 ++
.../botania/recipes/runic_altar/head.json | 3 ++
.../botania/recipes/runic_altar/lust.json | 3 ++
.../botania/recipes/runic_altar/mana.json | 3 ++
.../botania/recipes/runic_altar/pride.json | 3 ++
.../botania/recipes/runic_altar/sloth.json | 3 ++
.../botania/recipes/runic_altar/spring.json | 3 ++
.../botania/recipes/runic_altar/summer.json | 3 ++
.../botania/recipes/runic_altar/water.json | 3 ++
.../botania/recipes/runic_altar/winter.json | 3 ++
.../botania/recipes/runic_altar/wrath.json | 3 ++
.../botania/api/recipe/RunicAltarRecipe.java | 7 +++
.../common/crafting/RunicAltarRecipe.java | 17 +++++--
.../common/crafting/recipe/HeadRecipe.java | 10 ++--
.../data/recipes/RunicAltarProvider.java | 50 +++++++++++--------
22 files changed, 125 insertions(+), 44 deletions(-)
diff --git a/Xplat/src/generated/resources/.cache/cc3f2b57729a50761cd506b810b841f2b4fbd4d1 b/Xplat/src/generated/resources/.cache/cc3f2b57729a50761cd506b810b841f2b4fbd4d1
index abb0c51d5..4df5737e5 100644
--- a/Xplat/src/generated/resources/.cache/cc3f2b57729a50761cd506b810b841f2b4fbd4d1
+++ b/Xplat/src/generated/resources/.cache/cc3f2b57729a50761cd506b810b841f2b4fbd4d1
@@ -1,18 +1,18 @@
// 1.20.1 Botania/Botania runic altar recipes
-d3e8d746a742c5d7dd5e193d509152c4f9f72579 data/botania/recipes/runic_altar/air.json
-1e435d483560295df329b0492e273c96684ebc31 data/botania/recipes/runic_altar/autumn.json
-c4d5f2f0463e30f027633f823206abdcbad51615 data/botania/recipes/runic_altar/earth.json
-33e0e91504b99b4aa1b774ff15a09cd7784bc5a7 data/botania/recipes/runic_altar/envy.json
-c338f61ea4e5a71f8a077f441d22876a3210d883 data/botania/recipes/runic_altar/fire.json
-60c53a002299c3c09834ae064fea39f2b27d0b43 data/botania/recipes/runic_altar/gluttony.json
-c1fc0e465c8841a957fd089ff03cc4016495d02d data/botania/recipes/runic_altar/greed.json
-6b78f960968e8ecf702133fbe5eab7d2d69e0f90 data/botania/recipes/runic_altar/head.json
-e3fbdc270b0f4683037339c343a66f4cd164a0f9 data/botania/recipes/runic_altar/lust.json
-01f95a3f44dfe54a8decd884b59ae6eff1a9e630 data/botania/recipes/runic_altar/mana.json
-afd58f8ffe62da670ae78440894df295a91abbf3 data/botania/recipes/runic_altar/pride.json
-be172e445b8a4163dde39e9bda7d423c2969e432 data/botania/recipes/runic_altar/sloth.json
-3ee7f564c4648730da8485ddd4c2b7d7e344fd97 data/botania/recipes/runic_altar/spring.json
-c24445c4e8604d6ae389c44bcc31a8b5b4ca1a43 data/botania/recipes/runic_altar/summer.json
-ff2aecc043e973846581df1e71b8f06bd0baec49 data/botania/recipes/runic_altar/water.json
-ce03fd7559ca0b69ad015771dde3e0302a5b3fe1 data/botania/recipes/runic_altar/winter.json
-6f42dd5896ea2edb2f2de1002f321fcac20af64e data/botania/recipes/runic_altar/wrath.json
+d3324e594d2e5ed2895639902d32c83709d8e648 data/botania/recipes/runic_altar/air.json
+325af549ac5c1cea1169867b71c8fc68eb836ccb data/botania/recipes/runic_altar/autumn.json
+61f99973d60f283c8e3a256d3adc162d24dcfcf7 data/botania/recipes/runic_altar/earth.json
+453248fc5f8692bfc6bfa0f2d63d6bcef29c7017 data/botania/recipes/runic_altar/envy.json
+4cfa28ba8be3f462f36a8b1ac988c0e264827287 data/botania/recipes/runic_altar/fire.json
+297764f3e04560bc86e8a138605512cceb866c3c data/botania/recipes/runic_altar/gluttony.json
+a54174d121d45647852ea6435f07daebc2036061 data/botania/recipes/runic_altar/greed.json
+d4eb2be08a9d31d11a3c593dbdf7dde2337c7114 data/botania/recipes/runic_altar/head.json
+e491486adb868deb0db10007377cb84d689846db data/botania/recipes/runic_altar/lust.json
+d029d639444bf99453bda243849a653fff3f7147 data/botania/recipes/runic_altar/mana.json
+bc8be6b5f96851c757303754a33734a1fd84c723 data/botania/recipes/runic_altar/pride.json
+cf532a1ce35acee3e362d898ae7a8ba020cca895 data/botania/recipes/runic_altar/sloth.json
+315617047d505132e08a9bdc1008c1e526a97816 data/botania/recipes/runic_altar/spring.json
+f1b003e65557d2bb8b29278238e4f29b59b82fcf data/botania/recipes/runic_altar/summer.json
+692ce35000fcffa39049aaa85af8c017ab2f43aa data/botania/recipes/runic_altar/water.json
+278b820df4d0b34df0e3102b5f31ff9819e206e1 data/botania/recipes/runic_altar/winter.json
+1056f240a8335fb0a850ba7109a8c47956bd90f0 data/botania/recipes/runic_altar/wrath.json
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/air.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/air.json
index 7526686d9..86796a3da 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/air.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/air.json
@@ -21,5 +21,8 @@
"output": {
"count": 2,
"item": "botania:rune_air"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/autumn.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/autumn.json
index 70b08123b..2c97104d4 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/autumn.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/autumn.json
@@ -23,5 +23,8 @@
"mana": 8000,
"output": {
"item": "botania:rune_autumn"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/earth.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/earth.json
index ff2ae9761..3b8bb7504 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/earth.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/earth.json
@@ -26,5 +26,8 @@
"output": {
"count": 2,
"item": "botania:rune_earth"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/envy.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/envy.json
index 1ab9277e3..f985a4086 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/envy.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/envy.json
@@ -17,5 +17,8 @@
"mana": 12000,
"output": {
"item": "botania:rune_envy"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/fire.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/fire.json
index 064ee0e09..1a6d6420e 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/fire.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/fire.json
@@ -21,5 +21,8 @@
"output": {
"count": 2,
"item": "botania:rune_fire"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/gluttony.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/gluttony.json
index e1d408ce5..884768fcf 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/gluttony.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/gluttony.json
@@ -17,5 +17,8 @@
"mana": 12000,
"output": {
"item": "botania:rune_gluttony"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/greed.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/greed.json
index 247c6a2a5..cfb8deb01 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/greed.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/greed.json
@@ -17,5 +17,8 @@
"mana": 12000,
"output": {
"item": "botania:rune_greed"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/head.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/head.json
index 969dc2b3e..3469a370a 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/head.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/head.json
@@ -20,5 +20,8 @@
"mana": 22500,
"output": {
"item": "minecraft:player_head"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/lust.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/lust.json
index c443c522e..252d79a41 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/lust.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/lust.json
@@ -17,5 +17,8 @@
"mana": 12000,
"output": {
"item": "botania:rune_lust"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/mana.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/mana.json
index fabc17782..811547c0f 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/mana.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/mana.json
@@ -23,5 +23,8 @@
"mana": 8000,
"output": {
"item": "botania:rune_mana"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/pride.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/pride.json
index 09e373285..fac43967e 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/pride.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/pride.json
@@ -17,5 +17,8 @@
"mana": 12000,
"output": {
"item": "botania:rune_pride"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/sloth.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/sloth.json
index a763a5d92..630edde4d 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/sloth.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/sloth.json
@@ -17,5 +17,8 @@
"mana": 12000,
"output": {
"item": "botania:rune_sloth"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/spring.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/spring.json
index e8de0ce3a..0fafd22e5 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/spring.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/spring.json
@@ -23,5 +23,8 @@
"mana": 8000,
"output": {
"item": "botania:rune_spring"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/summer.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/summer.json
index cbc7c6f3d..20edae600 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/summer.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/summer.json
@@ -23,5 +23,8 @@
"mana": 8000,
"output": {
"item": "botania:rune_summer"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/water.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/water.json
index 6becffcbc..c984cdcbf 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/water.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/water.json
@@ -21,5 +21,8 @@
"output": {
"count": 2,
"item": "botania:rune_water"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/winter.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/winter.json
index fbe81fc12..6317f49b2 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/winter.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/winter.json
@@ -23,5 +23,8 @@
"mana": 8000,
"output": {
"item": "botania:rune_winter"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/wrath.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/wrath.json
index 9e6c6edd9..e08340960 100644
--- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/wrath.json
+++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/wrath.json
@@ -17,5 +17,8 @@
"mana": 12000,
"output": {
"item": "botania:rune_wrath"
+ },
+ "reagent": {
+ "item": "botania:livingrock"
}
}
\ No newline at end of file
diff --git a/Xplat/src/main/java/vazkii/botania/api/recipe/RunicAltarRecipe.java b/Xplat/src/main/java/vazkii/botania/api/recipe/RunicAltarRecipe.java
index fa9dfc033..18aab9501 100644
--- a/Xplat/src/main/java/vazkii/botania/api/recipe/RunicAltarRecipe.java
+++ b/Xplat/src/main/java/vazkii/botania/api/recipe/RunicAltarRecipe.java
@@ -11,6 +11,7 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.Container;
+import net.minecraft.world.item.crafting.Ingredient;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeType;
@@ -23,6 +24,12 @@ public interface RunicAltarRecipe extends Recipe<Container> {
int getManaUsage();
+ /**
+ * @return Ingredient matching the final item that needs to be set on top of the
+ * altar to perform a craft after a matching recipe has been supplied its mana.
+ */
+ Ingredient getReagent();
+
@NotNull
@Override
default RecipeType<?> getType() {
diff --git a/Xplat/src/main/java/vazkii/botania/common/crafting/RunicAltarRecipe.java b/Xplat/src/main/java/vazkii/botania/common/crafting/RunicAltarRecipe.java
index 793351d92..0ab1b7c27 100644
--- a/Xplat/src/main/java/vazkii/botania/common/crafting/RunicAltarRecipe.java
+++ b/Xplat/src/main/java/vazkii/botania/common/crafting/RunicAltarRecipe.java
@@ -36,13 +36,15 @@
public class RunicAltarRecipe implements vazkii.botania.api.recipe.RunicAltarRecipe {
private final ResourceLocation id;
private final ItemStack output;
+ private final Ingredient reagent;
private final NonNullList<Ingredient> inputs;
private final int mana;
- public RunicAltarRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient... inputs) {
+ public RunicAltarRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient reagent, Ingredient... inputs) {
Preconditions.checkArgument(inputs.length <= 16, "Cannot have more than 16 ingredients");
this.id = id;
this.output = output;
+ this.reagent = reagent;
this.inputs = NonNullList.of(Ingredient.EMPTY, inputs);
this.mana = mana;
}
@@ -64,6 +66,12 @@ public ItemStack assemble(@NotNull Container inv, @NotNull RegistryAccess regist
return getResultItem(registries).copy();
}
+ @NotNull
+ @Override
+ public Ingredient getReagent() {
+ return reagent;
+ }
+
@NotNull
@Override
public NonNullList<Ingredient> getIngredients() {
@@ -98,13 +106,14 @@ public static class Serializer implements RecipeSerializer<RunicAltarRecipe> {
@Override
public RunicAltarRecipe fromJson(@NotNull ResourceLocation id, @NotNull JsonObject json) {
ItemStack output = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(json, "output"));
+ Ingredient reagent = Ingredient.fromJson(json.get("reagent"));
int mana = GsonHelper.getAsInt(json, "mana");
JsonArray ingrs = GsonHelper.getAsJsonArray(json, "ingredients");
List<Ingredient> inputs = new ArrayList<>();
for (JsonElement e : ingrs) {
inputs.add(Ingredient.fromJson(e));
}
- return new RunicAltarRecipe(id, output, mana, inputs.toArray(new Ingredient[0]));
+ return new RunicAltarRecipe(id, output, mana, reagent, inputs.toArray(new Ingredient[0]));
}
@Override
@@ -113,9 +122,10 @@ public RunicAltarRecipe fromNetwork(@NotNull ResourceLocation id, @NotNull Frien
for (int i = 0; i < inputs.length; i++) {
inputs[i] = Ingredient.fromNetwork(buf);
}
+ Ingredient reagent = Ingredient.fromNetwork(buf);
ItemStack output = buf.readItem();
int mana = buf.readVarInt();
- return new RunicAltarRecipe(id, output, mana, inputs);
+ return new RunicAltarRecipe(id, output, mana, reagent, inputs);
}
@Override
@@ -124,6 +134,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buf, @NotNull RunicAltarRecipe re
for (Ingredient input : recipe.getIngredients()) {
input.toNetwork(buf);
}
+ recipe.reagent.toNetwork(buf);
buf.writeItem(recipe.output);
buf.writeVarInt(recipe.getManaUsage());
}
diff --git a/Xplat/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java b/Xplat/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java
index cb2b4853e..c7d56ae8f 100644
--- a/Xplat/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java
+++ b/Xplat/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java
@@ -36,8 +36,8 @@
public class HeadRecipe extends RunicAltarRecipe {
- public HeadRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient... inputs) {
- super(id, output, mana, inputs);
+ public HeadRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient reagent, Ingredient... inputs) {
+ super(id, output, mana, reagent, inputs);
}
@Override
@@ -83,13 +83,14 @@ public static class Serializer implements RecipeSerializer<HeadRecipe> {
@Override
public HeadRecipe fromJson(@NotNull ResourceLocation id, @NotNull JsonObject json) {
ItemStack output = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(json, "output"));
+ Ingredient reagent = Ingredient.fromJson(json.get("reagent"));
int mana = GsonHelper.getAsInt(json, "mana");
JsonArray ingrs = GsonHelper.getAsJsonArray(json, "ingredients");
List<Ingredient> inputs = new ArrayList<>();
for (JsonElement e : ingrs) {
inputs.add(Ingredient.fromJson(e));
}
- return new HeadRecipe(id, output, mana, inputs.toArray(new Ingredient[0]));
+ return new HeadRecipe(id, output, mana, reagent, inputs.toArray(new Ingredient[0]));
}
@Override
@@ -98,9 +99,10 @@ public HeadRecipe fromNetwork(@NotNull ResourceLocation id, @NotNull FriendlyByt
for (int i = 0; i < inputs.length; i++) {
inputs[i] = Ingredient.fromNetwork(buf);
}
+ Ingredient reagent = Ingredient.fromNetwork(buf);
ItemStack output = buf.readItem();
int mana = buf.readVarInt();
- return new HeadRecipe(id, output, mana, inputs);
+ return new HeadRecipe(id, output, mana, reagent, inputs);
}
@Override
diff --git a/Xplat/src/main/java/vazkii/botania/data/recipes/RunicAltarProvider.java b/Xplat/src/main/java/vazkii/botania/data/recipes/RunicAltarProvider.java
index bca9373ca..268fce6f0 100644
--- a/Xplat/src/main/java/vazkii/botania/data/recipes/RunicAltarProvider.java
+++ b/Xplat/src/main/java/vazkii/botania/data/recipes/RunicAltarProvider.java
@@ -22,6 +22,7 @@
import org.jetbrains.annotations.Nullable;
+import vazkii.botania.common.block.BotaniaBlocks;
import vazkii.botania.common.crafting.BotaniaRecipeTypes;
import vazkii.botania.common.helper.ItemNBTHelper;
import vazkii.botania.common.item.BotaniaItems;
@@ -32,6 +33,8 @@
import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;
public class RunicAltarProvider extends BotaniaRecipeProvider {
+ private static final Ingredient DEFAULT_REAGENT = Ingredient.of(BotaniaBlocks.livingrock.asItem());
+
public RunicAltarProvider(PackOutput packOutput) {
super(packOutput);
}
@@ -50,14 +53,14 @@ public void buildRecipes(Consumer<net.minecraft.data.recipes.FinishedRecipe> con
Ingredient manaSteel = Ingredient.of(BotaniaTags.Items.INGOTS_MANASTEEL);
Ingredient manaDiamond = Ingredient.of(BotaniaTags.Items.GEMS_MANA_DIAMOND);
Ingredient manaPowder = Ingredient.of(BotaniaTags.Items.DUSTS_MANA);
- consumer.accept(new FinishedRecipe(idFor("water"), new ItemStack(BotaniaItems.runeWater, 2), costTier1, manaPowder, manaSteel, Ingredient.of(Items.BONE_MEAL), Ingredient.of(Blocks.SUGAR_CANE), Ingredient.of(Items.FISHING_ROD)));
- consumer.accept(new FinishedRecipe(idFor("fire"), new ItemStack(BotaniaItems.runeFire, 2), costTier1, manaPowder, manaSteel, Ingredient.of(Items.NETHER_BRICK), Ingredient.of(Items.GUNPOWDER), Ingredient.of(Items.NETHER_WART)));
+ consumer.accept(make("water", new ItemStack(BotaniaItems.runeWater, 2), costTier1, manaPowder, manaSteel, Ingredient.of(Items.BONE_MEAL), Ingredient.of(Blocks.SUGAR_CANE), Ingredient.of(Items.FISHING_ROD)));
+ consumer.accept(make("fire", new ItemStack(BotaniaItems.runeFire, 2), costTier1, manaPowder, manaSteel, Ingredient.of(Items.NETHER_BRICK), Ingredient.of(Items.GUNPOWDER), Ingredient.of(Items.NETHER_WART)));
Ingredient stone = Ingredient.of(Blocks.STONE);
Ingredient coalBlock = Ingredient.of(Blocks.COAL_BLOCK);
- consumer.accept(new FinishedRecipe(idFor("earth"), new ItemStack(BotaniaItems.runeEarth, 2), costTier1, manaPowder, manaSteel, stone, coalBlock, Ingredient.of(Blocks.BROWN_MUSHROOM, Blocks.RED_MUSHROOM)));
+ consumer.accept(make("earth", new ItemStack(BotaniaItems.runeEarth, 2), costTier1, manaPowder, manaSteel, stone, coalBlock, Ingredient.of(Blocks.BROWN_MUSHROOM, Blocks.RED_MUSHROOM)));
- consumer.accept(new FinishedRecipe(idFor("air"), new ItemStack(BotaniaItems.runeAir, 2), costTier1, manaPowder, manaSteel, Ingredient.of(ItemTags.WOOL_CARPETS), Ingredient.of(Items.FEATHER), Ingredient.of(Items.STRING)));
+ consumer.accept(make("air", new ItemStack(BotaniaItems.runeAir, 2), costTier1, manaPowder, manaSteel, Ingredient.of(ItemTags.WOOL_CARPETS), Ingredient.of(Items.FEATHER), Ingredient.of(Items.STRING)));
Ingredient fire = Ingredient.of(BotaniaItems.runeFire);
Ingredient water = Ingredient.of(BotaniaItems.runeWater);
@@ -67,44 +70,50 @@ public void buildRecipes(Consumer<net.minecraft.data.recipes.FinishedRecipe> con
Ingredient sapling = Ingredient.of(ItemTags.SAPLINGS);
Ingredient leaves = Ingredient.of(ItemTags.LEAVES);
Ingredient sand = Ingredient.of(ItemTags.SAND);
- consumer.accept(new FinishedRecipe(idFor("spring"), new ItemStack(BotaniaItems.runeSpring), costTier2, water, fire, sapling, sapling, sapling, Ingredient.of(Items.WHEAT)));
- consumer.accept(new FinishedRecipe(idFor("summer"), new ItemStack(BotaniaItems.runeSummer), costTier2, earth, air, sand, sand, Ingredient.of(Items.SLIME_BALL), Ingredient.of(Items.MELON_SLICE)));
- consumer.accept(new FinishedRecipe(idFor("autumn"), new ItemStack(BotaniaItems.runeAutumn), costTier2, fire, air, leaves, leaves, leaves, Ingredient.of(Items.SPIDER_EYE)));
+ consumer.accept(make("spring", new ItemStack(BotaniaItems.runeSpring), costTier2, water, fire, sapling, sapling, sapling, Ingredient.of(Items.WHEAT)));
+ consumer.accept(make("summer", new ItemStack(BotaniaItems.runeSummer), costTier2, earth, air, sand, sand, Ingredient.of(Items.SLIME_BALL), Ingredient.of(Items.MELON_SLICE)));
+ consumer.accept(make("autumn", new ItemStack(BotaniaItems.runeAutumn), costTier2, fire, air, leaves, leaves, leaves, Ingredient.of(Items.SPIDER_EYE)));
- consumer.accept(new FinishedRecipe(idFor("winter"), new ItemStack(BotaniaItems.runeWinter), costTier2, water, earth, Ingredient.of(Blocks.SNOW_BLOCK), Ingredient.of(Blocks.SNOW_BLOCK), Ingredient.of(ItemTags.WOOL), Ingredient.of(Blocks.CAKE)));
+ consumer.accept(make("winter", new ItemStack(BotaniaItems.runeWinter), costTier2, water, earth, Ingredient.of(Blocks.SNOW_BLOCK), Ingredient.of(Blocks.SNOW_BLOCK), Ingredient.of(ItemTags.WOOL), Ingredient.of(Blocks.CAKE)));
Ingredient spring = Ingredient.of(BotaniaItems.runeSpring);
Ingredient summer = Ingredient.of(BotaniaItems.runeSummer);
Ingredient autumn = Ingredient.of(BotaniaItems.runeAutumn);
Ingredient winter = Ingredient.of(BotaniaItems.runeWinter);
- consumer.accept(new FinishedRecipe(idFor("mana"), new ItemStack(BotaniaItems.runeMana), costTier2, manaSteel, manaSteel, manaSteel, manaSteel, manaSteel, Ingredient.of(BotaniaItems.manaPearl)));
+ consumer.accept(make("mana", new ItemStack(BotaniaItems.runeMana), costTier2, manaSteel, manaSteel, manaSteel, manaSteel, manaSteel, Ingredient.of(BotaniaItems.manaPearl)));
- consumer.accept(new FinishedRecipe(idFor("lust"), new ItemStack(BotaniaItems.runeLust), costTier3, manaDiamond, manaDiamond, summer, air));
- consumer.accept(new FinishedRecipe(idFor("gluttony"), new ItemStack(BotaniaItems.runeGluttony), costTier3, manaDiamond, manaDiamond, winter, fire));
- consumer.accept(new FinishedRecipe(idFor("greed"), new ItemStack(BotaniaItems.runeGreed), costTier3, manaDiamond, manaDiamond, spring, water));
- consumer.accept(new FinishedRecipe(idFor("sloth"), new ItemStack(BotaniaItems.runeSloth), costTier3, manaDiamond, manaDiamond, autumn, air));
- consumer.accept(new FinishedRecipe(idFor("wrath"), new ItemStack(BotaniaItems.runeWrath), costTier3, manaDiamond, manaDiamond, winter, earth));
- consumer.accept(new FinishedRecipe(idFor("envy"), new ItemStack(BotaniaItems.runeEnvy), costTier3, manaDiamond, manaDiamond, winter, water));
- consumer.accept(new FinishedRecipe(idFor("pride"), new ItemStack(BotaniaItems.runePride), costTier3, manaDiamond, manaDiamond, summer, fire));
+ consumer.accept(make("lust", new ItemStack(BotaniaItems.runeLust), costTier3, manaDiamond, manaDiamond, summer, air));
+ consumer.accept(make("gluttony", new ItemStack(BotaniaItems.runeGluttony), costTier3, manaDiamond, manaDiamond, winter, fire));
+ consumer.accept(make("greed", new ItemStack(BotaniaItems.runeGreed), costTier3, manaDiamond, manaDiamond, spring, water));
+ consumer.accept(make("sloth", new ItemStack(BotaniaItems.runeSloth), costTier3, manaDiamond, manaDiamond, autumn, air));
+ consumer.accept(make("wrath", new ItemStack(BotaniaItems.runeWrath), costTier3, manaDiamond, manaDiamond, winter, earth));
+ consumer.accept(make("envy", new ItemStack(BotaniaItems.runeEnvy), costTier3, manaDiamond, manaDiamond, winter, water));
+ consumer.accept(make("pride", new ItemStack(BotaniaItems.runePride), costTier3, manaDiamond, manaDiamond, summer, fire));
- consumer.accept(new FinishedHeadRecipe(idFor("head"), new ItemStack(Items.PLAYER_HEAD), 22500, Ingredient.of(Items.SKELETON_SKULL), Ingredient.of(BotaniaItems.pixieDust), Ingredient.of(Items.PRISMARINE_CRYSTALS), Ingredient.of(Items.NAME_TAG), Ingredient.of(Items.GOLDEN_APPLE)));
+ consumer.accept(new FinishedHeadRecipe(idFor("head"), new ItemStack(Items.PLAYER_HEAD), 22500, DEFAULT_REAGENT, Ingredient.of(Items.SKELETON_SKULL), Ingredient.of(BotaniaItems.pixieDust), Ingredient.of(Items.PRISMARINE_CRYSTALS), Ingredient.of(Items.NAME_TAG), Ingredient.of(Items.GOLDEN_APPLE)));
}
private static ResourceLocation idFor(String s) {
return prefix("runic_altar/" + s);
}
+ private static FinishedRecipe make(String id, ItemStack output, int mana, Ingredient... inputs) {
+ return new FinishedRecipe(idFor(id), output, mana, DEFAULT_REAGENT, inputs);
+ }
+
protected static class FinishedRecipe implements net.minecraft.data.recipes.FinishedRecipe {
private final ResourceLocation id;
private final ItemStack output;
private final int mana;
+ private final Ingredient reagent;
private final Ingredient[] inputs;
- protected FinishedRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient... inputs) {
+ protected FinishedRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient reagent, Ingredient... inputs) {
this.id = id;
this.output = output;
this.mana = mana;
+ this.reagent = reagent;
this.inputs = inputs;
}
@@ -116,6 +125,7 @@ public void serializeRecipeData(JsonObject json) {
ingredients.add(ingr.toJson());
}
json.addProperty("mana", mana);
+ json.add("reagent", reagent.toJson());
json.add("ingredients", ingredients);
}
@@ -143,8 +153,8 @@ public ResourceLocation getAdvancementId() {
}
private static class FinishedHeadRecipe extends FinishedRecipe {
- private FinishedHeadRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient... inputs) {
- super(id, output, mana, inputs);
+ private FinishedHeadRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient reagent, Ingredient... inputs) {
+ super(id, output, mana, reagent, inputs);
}
@Override
--
2.39.3 (Apple Git-145)
lgtm, but make sure to update the HUD render to render the right reagent
instead of livingrock now.
Artemis System <theartemissystem@gmail.com> writes:
> Not used yet, will be used in a future commit
> ---
> Figured i'll just send these one by one, more commits incoming
> .../cc3f2b57729a50761cd506b810b841f2b4fbd4d1 | 34 ++++++-------
> .../data/botania/recipes/runic_altar/air.json | 3 ++
> .../botania/recipes/runic_altar/autumn.json | 3 ++
> .../botania/recipes/runic_altar/earth.json | 3 ++
> .../botania/recipes/runic_altar/envy.json | 3 ++
> .../botania/recipes/runic_altar/fire.json | 3 ++
> .../botania/recipes/runic_altar/gluttony.json | 3 ++
> .../botania/recipes/runic_altar/greed.json | 3 ++
> .../botania/recipes/runic_altar/head.json | 3 ++
> .../botania/recipes/runic_altar/lust.json | 3 ++
> .../botania/recipes/runic_altar/mana.json | 3 ++
> .../botania/recipes/runic_altar/pride.json | 3 ++
> .../botania/recipes/runic_altar/sloth.json | 3 ++
> .../botania/recipes/runic_altar/spring.json | 3 ++
> .../botania/recipes/runic_altar/summer.json | 3 ++
> .../botania/recipes/runic_altar/water.json | 3 ++
> .../botania/recipes/runic_altar/winter.json | 3 ++
> .../botania/recipes/runic_altar/wrath.json | 3 ++
> .../botania/api/recipe/RunicAltarRecipe.java | 7 +++
> .../common/crafting/RunicAltarRecipe.java | 17 +++++--
> .../common/crafting/recipe/HeadRecipe.java | 10 ++--
> .../data/recipes/RunicAltarProvider.java | 50 +++++++++++--------
> 22 files changed, 125 insertions(+), 44 deletions(-)
>
> diff --git a/Xplat/src/generated/resources/.cache/cc3f2b57729a50761cd506b810b841f2b4fbd4d1 b/Xplat/src/generated/resources/.cache/cc3f2b57729a50761cd506b810b841f2b4fbd4d1
> index abb0c51d5..4df5737e5 100644
> --- a/Xplat/src/generated/resources/.cache/cc3f2b57729a50761cd506b810b841f2b4fbd4d1
> +++ b/Xplat/src/generated/resources/.cache/cc3f2b57729a50761cd506b810b841f2b4fbd4d1
> @@ -1,18 +1,18 @@
> // 1.20.1 Botania/Botania runic altar recipes
> -d3e8d746a742c5d7dd5e193d509152c4f9f72579 data/botania/recipes/runic_altar/air.json
> -1e435d483560295df329b0492e273c96684ebc31 data/botania/recipes/runic_altar/autumn.json
> -c4d5f2f0463e30f027633f823206abdcbad51615 data/botania/recipes/runic_altar/earth.json
> -33e0e91504b99b4aa1b774ff15a09cd7784bc5a7 data/botania/recipes/runic_altar/envy.json
> -c338f61ea4e5a71f8a077f441d22876a3210d883 data/botania/recipes/runic_altar/fire.json
> -60c53a002299c3c09834ae064fea39f2b27d0b43 data/botania/recipes/runic_altar/gluttony.json
> -c1fc0e465c8841a957fd089ff03cc4016495d02d data/botania/recipes/runic_altar/greed.json
> -6b78f960968e8ecf702133fbe5eab7d2d69e0f90 data/botania/recipes/runic_altar/head.json
> -e3fbdc270b0f4683037339c343a66f4cd164a0f9 data/botania/recipes/runic_altar/lust.json
> -01f95a3f44dfe54a8decd884b59ae6eff1a9e630 data/botania/recipes/runic_altar/mana.json
> -afd58f8ffe62da670ae78440894df295a91abbf3 data/botania/recipes/runic_altar/pride.json
> -be172e445b8a4163dde39e9bda7d423c2969e432 data/botania/recipes/runic_altar/sloth.json
> -3ee7f564c4648730da8485ddd4c2b7d7e344fd97 data/botania/recipes/runic_altar/spring.json
> -c24445c4e8604d6ae389c44bcc31a8b5b4ca1a43 data/botania/recipes/runic_altar/summer.json
> -ff2aecc043e973846581df1e71b8f06bd0baec49 data/botania/recipes/runic_altar/water.json
> -ce03fd7559ca0b69ad015771dde3e0302a5b3fe1 data/botania/recipes/runic_altar/winter.json
> -6f42dd5896ea2edb2f2de1002f321fcac20af64e data/botania/recipes/runic_altar/wrath.json
> +d3324e594d2e5ed2895639902d32c83709d8e648 data/botania/recipes/runic_altar/air.json
> +325af549ac5c1cea1169867b71c8fc68eb836ccb data/botania/recipes/runic_altar/autumn.json
> +61f99973d60f283c8e3a256d3adc162d24dcfcf7 data/botania/recipes/runic_altar/earth.json
> +453248fc5f8692bfc6bfa0f2d63d6bcef29c7017 data/botania/recipes/runic_altar/envy.json
> +4cfa28ba8be3f462f36a8b1ac988c0e264827287 data/botania/recipes/runic_altar/fire.json
> +297764f3e04560bc86e8a138605512cceb866c3c data/botania/recipes/runic_altar/gluttony.json
> +a54174d121d45647852ea6435f07daebc2036061 data/botania/recipes/runic_altar/greed.json
> +d4eb2be08a9d31d11a3c593dbdf7dde2337c7114 data/botania/recipes/runic_altar/head.json
> +e491486adb868deb0db10007377cb84d689846db data/botania/recipes/runic_altar/lust.json
> +d029d639444bf99453bda243849a653fff3f7147 data/botania/recipes/runic_altar/mana.json
> +bc8be6b5f96851c757303754a33734a1fd84c723 data/botania/recipes/runic_altar/pride.json
> +cf532a1ce35acee3e362d898ae7a8ba020cca895 data/botania/recipes/runic_altar/sloth.json
> +315617047d505132e08a9bdc1008c1e526a97816 data/botania/recipes/runic_altar/spring.json
> +f1b003e65557d2bb8b29278238e4f29b59b82fcf data/botania/recipes/runic_altar/summer.json
> +692ce35000fcffa39049aaa85af8c017ab2f43aa data/botania/recipes/runic_altar/water.json
> +278b820df4d0b34df0e3102b5f31ff9819e206e1 data/botania/recipes/runic_altar/winter.json
> +1056f240a8335fb0a850ba7109a8c47956bd90f0 data/botania/recipes/runic_altar/wrath.json
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/air.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/air.json
> index 7526686d9..86796a3da 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/air.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/air.json
> @@ -21,5 +21,8 @@
> "output": {
> "count": 2,
> "item": "botania:rune_air"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/autumn.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/autumn.json
> index 70b08123b..2c97104d4 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/autumn.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/autumn.json
> @@ -23,5 +23,8 @@
> "mana": 8000,
> "output": {
> "item": "botania:rune_autumn"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/earth.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/earth.json
> index ff2ae9761..3b8bb7504 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/earth.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/earth.json
> @@ -26,5 +26,8 @@
> "output": {
> "count": 2,
> "item": "botania:rune_earth"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/envy.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/envy.json
> index 1ab9277e3..f985a4086 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/envy.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/envy.json
> @@ -17,5 +17,8 @@
> "mana": 12000,
> "output": {
> "item": "botania:rune_envy"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/fire.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/fire.json
> index 064ee0e09..1a6d6420e 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/fire.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/fire.json
> @@ -21,5 +21,8 @@
> "output": {
> "count": 2,
> "item": "botania:rune_fire"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/gluttony.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/gluttony.json
> index e1d408ce5..884768fcf 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/gluttony.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/gluttony.json
> @@ -17,5 +17,8 @@
> "mana": 12000,
> "output": {
> "item": "botania:rune_gluttony"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/greed.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/greed.json
> index 247c6a2a5..cfb8deb01 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/greed.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/greed.json
> @@ -17,5 +17,8 @@
> "mana": 12000,
> "output": {
> "item": "botania:rune_greed"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/head.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/head.json
> index 969dc2b3e..3469a370a 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/head.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/head.json
> @@ -20,5 +20,8 @@
> "mana": 22500,
> "output": {
> "item": "minecraft:player_head"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/lust.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/lust.json
> index c443c522e..252d79a41 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/lust.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/lust.json
> @@ -17,5 +17,8 @@
> "mana": 12000,
> "output": {
> "item": "botania:rune_lust"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/mana.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/mana.json
> index fabc17782..811547c0f 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/mana.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/mana.json
> @@ -23,5 +23,8 @@
> "mana": 8000,
> "output": {
> "item": "botania:rune_mana"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/pride.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/pride.json
> index 09e373285..fac43967e 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/pride.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/pride.json
> @@ -17,5 +17,8 @@
> "mana": 12000,
> "output": {
> "item": "botania:rune_pride"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/sloth.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/sloth.json
> index a763a5d92..630edde4d 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/sloth.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/sloth.json
> @@ -17,5 +17,8 @@
> "mana": 12000,
> "output": {
> "item": "botania:rune_sloth"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/spring.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/spring.json
> index e8de0ce3a..0fafd22e5 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/spring.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/spring.json
> @@ -23,5 +23,8 @@
> "mana": 8000,
> "output": {
> "item": "botania:rune_spring"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/summer.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/summer.json
> index cbc7c6f3d..20edae600 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/summer.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/summer.json
> @@ -23,5 +23,8 @@
> "mana": 8000,
> "output": {
> "item": "botania:rune_summer"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/water.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/water.json
> index 6becffcbc..c984cdcbf 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/water.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/water.json
> @@ -21,5 +21,8 @@
> "output": {
> "count": 2,
> "item": "botania:rune_water"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/winter.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/winter.json
> index fbe81fc12..6317f49b2 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/winter.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/winter.json
> @@ -23,5 +23,8 @@
> "mana": 8000,
> "output": {
> "item": "botania:rune_winter"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/wrath.json b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/wrath.json
> index 9e6c6edd9..e08340960 100644
> --- a/Xplat/src/generated/resources/data/botania/recipes/runic_altar/wrath.json
> +++ b/Xplat/src/generated/resources/data/botania/recipes/runic_altar/wrath.json
> @@ -17,5 +17,8 @@
> "mana": 12000,
> "output": {
> "item": "botania:rune_wrath"
> + },
> + "reagent": {
> + "item": "botania:livingrock"
> }
> }
> \ No newline at end of file
> diff --git a/Xplat/src/main/java/vazkii/botania/api/recipe/RunicAltarRecipe.java b/Xplat/src/main/java/vazkii/botania/api/recipe/RunicAltarRecipe.java
> index fa9dfc033..18aab9501 100644
> --- a/Xplat/src/main/java/vazkii/botania/api/recipe/RunicAltarRecipe.java
> +++ b/Xplat/src/main/java/vazkii/botania/api/recipe/RunicAltarRecipe.java
> @@ -11,6 +11,7 @@
> import net.minecraft.core.registries.BuiltInRegistries;
> import net.minecraft.resources.ResourceLocation;
> import net.minecraft.world.Container;
> +import net.minecraft.world.item.crafting.Ingredient;
> import net.minecraft.world.item.crafting.Recipe;
> import net.minecraft.world.item.crafting.RecipeType;
>
> @@ -23,6 +24,12 @@ public interface RunicAltarRecipe extends Recipe<Container> {
>
> int getManaUsage();
>
> + /**
> + * @return Ingredient matching the final item that needs to be set on top of the
> + * altar to perform a craft after a matching recipe has been supplied its mana.
> + */
> + Ingredient getReagent();
> +
> @NotNull
> @Override
> default RecipeType<?> getType() {
> diff --git a/Xplat/src/main/java/vazkii/botania/common/crafting/RunicAltarRecipe.java b/Xplat/src/main/java/vazkii/botania/common/crafting/RunicAltarRecipe.java
> index 793351d92..0ab1b7c27 100644
> --- a/Xplat/src/main/java/vazkii/botania/common/crafting/RunicAltarRecipe.java
> +++ b/Xplat/src/main/java/vazkii/botania/common/crafting/RunicAltarRecipe.java
> @@ -36,13 +36,15 @@
> public class RunicAltarRecipe implements vazkii.botania.api.recipe.RunicAltarRecipe {
> private final ResourceLocation id;
> private final ItemStack output;
> + private final Ingredient reagent;
> private final NonNullList<Ingredient> inputs;
> private final int mana;
>
> - public RunicAltarRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient... inputs) {
> + public RunicAltarRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient reagent, Ingredient... inputs) {
> Preconditions.checkArgument(inputs.length <= 16, "Cannot have more than 16 ingredients");
> this.id = id;
> this.output = output;
> + this.reagent = reagent;
> this.inputs = NonNullList.of(Ingredient.EMPTY, inputs);
> this.mana = mana;
> }
> @@ -64,6 +66,12 @@ public ItemStack assemble(@NotNull Container inv, @NotNull RegistryAccess regist
> return getResultItem(registries).copy();
> }
>
> + @NotNull
> + @Override
> + public Ingredient getReagent() {
> + return reagent;
> + }
> +
> @NotNull
> @Override
> public NonNullList<Ingredient> getIngredients() {
> @@ -98,13 +106,14 @@ public static class Serializer implements RecipeSerializer<RunicAltarRecipe> {
> @Override
> public RunicAltarRecipe fromJson(@NotNull ResourceLocation id, @NotNull JsonObject json) {
> ItemStack output = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(json, "output"));
> + Ingredient reagent = Ingredient.fromJson(json.get("reagent"));
> int mana = GsonHelper.getAsInt(json, "mana");
> JsonArray ingrs = GsonHelper.getAsJsonArray(json, "ingredients");
> List<Ingredient> inputs = new ArrayList<>();
> for (JsonElement e : ingrs) {
> inputs.add(Ingredient.fromJson(e));
> }
> - return new RunicAltarRecipe(id, output, mana, inputs.toArray(new Ingredient[0]));
> + return new RunicAltarRecipe(id, output, mana, reagent, inputs.toArray(new Ingredient[0]));
> }
>
> @Override
> @@ -113,9 +122,10 @@ public RunicAltarRecipe fromNetwork(@NotNull ResourceLocation id, @NotNull Frien
> for (int i = 0; i < inputs.length; i++) {
> inputs[i] = Ingredient.fromNetwork(buf);
> }
> + Ingredient reagent = Ingredient.fromNetwork(buf);
> ItemStack output = buf.readItem();
> int mana = buf.readVarInt();
> - return new RunicAltarRecipe(id, output, mana, inputs);
> + return new RunicAltarRecipe(id, output, mana, reagent, inputs);
> }
>
> @Override
> @@ -124,6 +134,7 @@ public void toNetwork(@NotNull FriendlyByteBuf buf, @NotNull RunicAltarRecipe re
> for (Ingredient input : recipe.getIngredients()) {
> input.toNetwork(buf);
> }
> + recipe.reagent.toNetwork(buf);
> buf.writeItem(recipe.output);
> buf.writeVarInt(recipe.getManaUsage());
> }
> diff --git a/Xplat/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java b/Xplat/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java
> index cb2b4853e..c7d56ae8f 100644
> --- a/Xplat/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java
> +++ b/Xplat/src/main/java/vazkii/botania/common/crafting/recipe/HeadRecipe.java
> @@ -36,8 +36,8 @@
>
> public class HeadRecipe extends RunicAltarRecipe {
>
> - public HeadRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient... inputs) {
> - super(id, output, mana, inputs);
> + public HeadRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient reagent, Ingredient... inputs) {
> + super(id, output, mana, reagent, inputs);
> }
>
> @Override
> @@ -83,13 +83,14 @@ public static class Serializer implements RecipeSerializer<HeadRecipe> {
> @Override
> public HeadRecipe fromJson(@NotNull ResourceLocation id, @NotNull JsonObject json) {
> ItemStack output = ShapedRecipe.itemStackFromJson(GsonHelper.getAsJsonObject(json, "output"));
> + Ingredient reagent = Ingredient.fromJson(json.get("reagent"));
> int mana = GsonHelper.getAsInt(json, "mana");
> JsonArray ingrs = GsonHelper.getAsJsonArray(json, "ingredients");
> List<Ingredient> inputs = new ArrayList<>();
> for (JsonElement e : ingrs) {
> inputs.add(Ingredient.fromJson(e));
> }
> - return new HeadRecipe(id, output, mana, inputs.toArray(new Ingredient[0]));
> + return new HeadRecipe(id, output, mana, reagent, inputs.toArray(new Ingredient[0]));
> }
>
> @Override
> @@ -98,9 +99,10 @@ public HeadRecipe fromNetwork(@NotNull ResourceLocation id, @NotNull FriendlyByt
> for (int i = 0; i < inputs.length; i++) {
> inputs[i] = Ingredient.fromNetwork(buf);
> }
> + Ingredient reagent = Ingredient.fromNetwork(buf);
> ItemStack output = buf.readItem();
> int mana = buf.readVarInt();
> - return new HeadRecipe(id, output, mana, inputs);
> + return new HeadRecipe(id, output, mana, reagent, inputs);
> }
>
> @Override
> diff --git a/Xplat/src/main/java/vazkii/botania/data/recipes/RunicAltarProvider.java b/Xplat/src/main/java/vazkii/botania/data/recipes/RunicAltarProvider.java
> index bca9373ca..268fce6f0 100644
> --- a/Xplat/src/main/java/vazkii/botania/data/recipes/RunicAltarProvider.java
> +++ b/Xplat/src/main/java/vazkii/botania/data/recipes/RunicAltarProvider.java
> @@ -22,6 +22,7 @@
>
> import org.jetbrains.annotations.Nullable;
>
> +import vazkii.botania.common.block.BotaniaBlocks;
> import vazkii.botania.common.crafting.BotaniaRecipeTypes;
> import vazkii.botania.common.helper.ItemNBTHelper;
> import vazkii.botania.common.item.BotaniaItems;
> @@ -32,6 +33,8 @@
> import static vazkii.botania.common.lib.ResourceLocationHelper.prefix;
>
> public class RunicAltarProvider extends BotaniaRecipeProvider {
> + private static final Ingredient DEFAULT_REAGENT = Ingredient.of(BotaniaBlocks.livingrock.asItem());
> +
> public RunicAltarProvider(PackOutput packOutput) {
> super(packOutput);
> }
> @@ -50,14 +53,14 @@ public void buildRecipes(Consumer<net.minecraft.data.recipes.FinishedRecipe> con
> Ingredient manaSteel = Ingredient.of(BotaniaTags.Items.INGOTS_MANASTEEL);
> Ingredient manaDiamond = Ingredient.of(BotaniaTags.Items.GEMS_MANA_DIAMOND);
> Ingredient manaPowder = Ingredient.of(BotaniaTags.Items.DUSTS_MANA);
> - consumer.accept(new FinishedRecipe(idFor("water"), new ItemStack(BotaniaItems.runeWater, 2), costTier1, manaPowder, manaSteel, Ingredient.of(Items.BONE_MEAL), Ingredient.of(Blocks.SUGAR_CANE), Ingredient.of(Items.FISHING_ROD)));
> - consumer.accept(new FinishedRecipe(idFor("fire"), new ItemStack(BotaniaItems.runeFire, 2), costTier1, manaPowder, manaSteel, Ingredient.of(Items.NETHER_BRICK), Ingredient.of(Items.GUNPOWDER), Ingredient.of(Items.NETHER_WART)));
> + consumer.accept(make("water", new ItemStack(BotaniaItems.runeWater, 2), costTier1, manaPowder, manaSteel, Ingredient.of(Items.BONE_MEAL), Ingredient.of(Blocks.SUGAR_CANE), Ingredient.of(Items.FISHING_ROD)));
> + consumer.accept(make("fire", new ItemStack(BotaniaItems.runeFire, 2), costTier1, manaPowder, manaSteel, Ingredient.of(Items.NETHER_BRICK), Ingredient.of(Items.GUNPOWDER), Ingredient.of(Items.NETHER_WART)));
>
> Ingredient stone = Ingredient.of(Blocks.STONE);
> Ingredient coalBlock = Ingredient.of(Blocks.COAL_BLOCK);
> - consumer.accept(new FinishedRecipe(idFor("earth"), new ItemStack(BotaniaItems.runeEarth, 2), costTier1, manaPowder, manaSteel, stone, coalBlock, Ingredient.of(Blocks.BROWN_MUSHROOM, Blocks.RED_MUSHROOM)));
> + consumer.accept(make("earth", new ItemStack(BotaniaItems.runeEarth, 2), costTier1, manaPowder, manaSteel, stone, coalBlock, Ingredient.of(Blocks.BROWN_MUSHROOM, Blocks.RED_MUSHROOM)));
>
> - consumer.accept(new FinishedRecipe(idFor("air"), new ItemStack(BotaniaItems.runeAir, 2), costTier1, manaPowder, manaSteel, Ingredient.of(ItemTags.WOOL_CARPETS), Ingredient.of(Items.FEATHER), Ingredient.of(Items.STRING)));
> + consumer.accept(make("air", new ItemStack(BotaniaItems.runeAir, 2), costTier1, manaPowder, manaSteel, Ingredient.of(ItemTags.WOOL_CARPETS), Ingredient.of(Items.FEATHER), Ingredient.of(Items.STRING)));
>
> Ingredient fire = Ingredient.of(BotaniaItems.runeFire);
> Ingredient water = Ingredient.of(BotaniaItems.runeWater);
> @@ -67,44 +70,50 @@ public void buildRecipes(Consumer<net.minecraft.data.recipes.FinishedRecipe> con
> Ingredient sapling = Ingredient.of(ItemTags.SAPLINGS);
> Ingredient leaves = Ingredient.of(ItemTags.LEAVES);
> Ingredient sand = Ingredient.of(ItemTags.SAND);
> - consumer.accept(new FinishedRecipe(idFor("spring"), new ItemStack(BotaniaItems.runeSpring), costTier2, water, fire, sapling, sapling, sapling, Ingredient.of(Items.WHEAT)));
> - consumer.accept(new FinishedRecipe(idFor("summer"), new ItemStack(BotaniaItems.runeSummer), costTier2, earth, air, sand, sand, Ingredient.of(Items.SLIME_BALL), Ingredient.of(Items.MELON_SLICE)));
> - consumer.accept(new FinishedRecipe(idFor("autumn"), new ItemStack(BotaniaItems.runeAutumn), costTier2, fire, air, leaves, leaves, leaves, Ingredient.of(Items.SPIDER_EYE)));
> + consumer.accept(make("spring", new ItemStack(BotaniaItems.runeSpring), costTier2, water, fire, sapling, sapling, sapling, Ingredient.of(Items.WHEAT)));
> + consumer.accept(make("summer", new ItemStack(BotaniaItems.runeSummer), costTier2, earth, air, sand, sand, Ingredient.of(Items.SLIME_BALL), Ingredient.of(Items.MELON_SLICE)));
> + consumer.accept(make("autumn", new ItemStack(BotaniaItems.runeAutumn), costTier2, fire, air, leaves, leaves, leaves, Ingredient.of(Items.SPIDER_EYE)));
>
> - consumer.accept(new FinishedRecipe(idFor("winter"), new ItemStack(BotaniaItems.runeWinter), costTier2, water, earth, Ingredient.of(Blocks.SNOW_BLOCK), Ingredient.of(Blocks.SNOW_BLOCK), Ingredient.of(ItemTags.WOOL), Ingredient.of(Blocks.CAKE)));
> + consumer.accept(make("winter", new ItemStack(BotaniaItems.runeWinter), costTier2, water, earth, Ingredient.of(Blocks.SNOW_BLOCK), Ingredient.of(Blocks.SNOW_BLOCK), Ingredient.of(ItemTags.WOOL), Ingredient.of(Blocks.CAKE)));
>
> Ingredient spring = Ingredient.of(BotaniaItems.runeSpring);
> Ingredient summer = Ingredient.of(BotaniaItems.runeSummer);
> Ingredient autumn = Ingredient.of(BotaniaItems.runeAutumn);
> Ingredient winter = Ingredient.of(BotaniaItems.runeWinter);
>
> - consumer.accept(new FinishedRecipe(idFor("mana"), new ItemStack(BotaniaItems.runeMana), costTier2, manaSteel, manaSteel, manaSteel, manaSteel, manaSteel, Ingredient.of(BotaniaItems.manaPearl)));
> + consumer.accept(make("mana", new ItemStack(BotaniaItems.runeMana), costTier2, manaSteel, manaSteel, manaSteel, manaSteel, manaSteel, Ingredient.of(BotaniaItems.manaPearl)));
>
> - consumer.accept(new FinishedRecipe(idFor("lust"), new ItemStack(BotaniaItems.runeLust), costTier3, manaDiamond, manaDiamond, summer, air));
> - consumer.accept(new FinishedRecipe(idFor("gluttony"), new ItemStack(BotaniaItems.runeGluttony), costTier3, manaDiamond, manaDiamond, winter, fire));
> - consumer.accept(new FinishedRecipe(idFor("greed"), new ItemStack(BotaniaItems.runeGreed), costTier3, manaDiamond, manaDiamond, spring, water));
> - consumer.accept(new FinishedRecipe(idFor("sloth"), new ItemStack(BotaniaItems.runeSloth), costTier3, manaDiamond, manaDiamond, autumn, air));
> - consumer.accept(new FinishedRecipe(idFor("wrath"), new ItemStack(BotaniaItems.runeWrath), costTier3, manaDiamond, manaDiamond, winter, earth));
> - consumer.accept(new FinishedRecipe(idFor("envy"), new ItemStack(BotaniaItems.runeEnvy), costTier3, manaDiamond, manaDiamond, winter, water));
> - consumer.accept(new FinishedRecipe(idFor("pride"), new ItemStack(BotaniaItems.runePride), costTier3, manaDiamond, manaDiamond, summer, fire));
> + consumer.accept(make("lust", new ItemStack(BotaniaItems.runeLust), costTier3, manaDiamond, manaDiamond, summer, air));
> + consumer.accept(make("gluttony", new ItemStack(BotaniaItems.runeGluttony), costTier3, manaDiamond, manaDiamond, winter, fire));
> + consumer.accept(make("greed", new ItemStack(BotaniaItems.runeGreed), costTier3, manaDiamond, manaDiamond, spring, water));
> + consumer.accept(make("sloth", new ItemStack(BotaniaItems.runeSloth), costTier3, manaDiamond, manaDiamond, autumn, air));
> + consumer.accept(make("wrath", new ItemStack(BotaniaItems.runeWrath), costTier3, manaDiamond, manaDiamond, winter, earth));
> + consumer.accept(make("envy", new ItemStack(BotaniaItems.runeEnvy), costTier3, manaDiamond, manaDiamond, winter, water));
> + consumer.accept(make("pride", new ItemStack(BotaniaItems.runePride), costTier3, manaDiamond, manaDiamond, summer, fire));
>
> - consumer.accept(new FinishedHeadRecipe(idFor("head"), new ItemStack(Items.PLAYER_HEAD), 22500, Ingredient.of(Items.SKELETON_SKULL), Ingredient.of(BotaniaItems.pixieDust), Ingredient.of(Items.PRISMARINE_CRYSTALS), Ingredient.of(Items.NAME_TAG), Ingredient.of(Items.GOLDEN_APPLE)));
> + consumer.accept(new FinishedHeadRecipe(idFor("head"), new ItemStack(Items.PLAYER_HEAD), 22500, DEFAULT_REAGENT, Ingredient.of(Items.SKELETON_SKULL), Ingredient.of(BotaniaItems.pixieDust), Ingredient.of(Items.PRISMARINE_CRYSTALS), Ingredient.of(Items.NAME_TAG), Ingredient.of(Items.GOLDEN_APPLE)));
> }
>
> private static ResourceLocation idFor(String s) {
> return prefix("runic_altar/" + s);
> }
>
> + private static FinishedRecipe make(String id, ItemStack output, int mana, Ingredient... inputs) {
> + return new FinishedRecipe(idFor(id), output, mana, DEFAULT_REAGENT, inputs);
> + }
> +
> protected static class FinishedRecipe implements net.minecraft.data.recipes.FinishedRecipe {
> private final ResourceLocation id;
> private final ItemStack output;
> private final int mana;
> + private final Ingredient reagent;
> private final Ingredient[] inputs;
>
> - protected FinishedRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient... inputs) {
> + protected FinishedRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient reagent, Ingredient... inputs) {
> this.id = id;
> this.output = output;
> this.mana = mana;
> + this.reagent = reagent;
> this.inputs = inputs;
> }
>
> @@ -116,6 +125,7 @@ public void serializeRecipeData(JsonObject json) {
> ingredients.add(ingr.toJson());
> }
> json.addProperty("mana", mana);
> + json.add("reagent", reagent.toJson());
> json.add("ingredients", ingredients);
> }
>
> @@ -143,8 +153,8 @@ public ResourceLocation getAdvancementId() {
> }
>
> private static class FinishedHeadRecipe extends FinishedRecipe {
> - private FinishedHeadRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient... inputs) {
> - super(id, output, mana, inputs);
> + private FinishedHeadRecipe(ResourceLocation id, ItemStack output, int mana, Ingredient reagent, Ingredient... inputs) {
> + super(id, output, mana, reagent, inputs);
> }
>
> @Override