Skip to content

Commit

Permalink
Merge branch 'refs/heads/architectury-1.19.2' into architectury-1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
UnlikePaladin committed Jan 24, 2025
2 parents 576a912 + 96f6c67 commit 6d476e3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ public DynamicFurnitureRecipe read(Identifier id, JsonObject json) {

List<Identifier> supportedVariants = new ArrayList<>();
JsonHelper.getArray(json, "supportedVariants").forEach(jsonElement -> supportedVariants.add(Identifier.tryParse(jsonElement.getAsString())));
FurnitureIngredients ingredients = FurnitureIngredients.read(json);
FurnitureIngredients ingredients = FurnitureIngredients.read(json.getAsJsonObject("ingredients"));

return new DynamicFurnitureRecipe(id, group, FurnitureOutput.read(json.getAsJsonObject("result")), supportedVariants, ingredients);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,24 +215,27 @@ public void serialize(JsonObject json) {
if (this.group != null && !this.group.isEmpty()) {
json.addProperty("group", this.group);
}

JsonArray ingredientArray = new JsonArray();
for (Ingredient ingredient : this.vanillaIngredients) {
ingredientArray.add(ingredient.toJson());
}
json.add("vanillaIngredients", ingredientArray);

JsonArray identifierArray = new JsonArray();
for (Identifier identifier : this.supportedVariants) {
identifierArray.add(identifier.toString());
}
json.add("supportedVariants", identifierArray);

JsonObject ingredients = new JsonObject();

JsonArray ingredientArray = new JsonArray();
for (Ingredient ingredient : this.vanillaIngredients) {
ingredientArray.add(ingredient.toJson());
}
ingredients.add("vanillaIngredients", ingredientArray);

JsonObject variantChildrenObject = new JsonObject();
for (Map.Entry<String, Integer> entry : this.variantChildren.entrySet()) {
variantChildrenObject.addProperty(entry.getKey(), entry.getValue());
}
json.add("variantChildren", variantChildrenObject);
ingredients.add("variantChildren", variantChildrenObject);

json.add("ingredients", ingredients);

JsonObject jsonObject = new JsonObject();
jsonObject.addProperty("outputClass", outputClass);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.unlikepaladin.pfm.compat.rei.FurnitureCategory;
import com.unlikepaladin.pfm.compat.rei.FurnitureDisplay;
import com.unlikepaladin.pfm.recipes.FreezingRecipe;
import com.unlikepaladin.pfm.recipes.SimpleFurnitureRecipe;
import com.unlikepaladin.pfm.recipes.FurnitureRecipe;
import me.shedaniel.rei.api.client.plugins.REIClientPlugin;
import me.shedaniel.rei.api.client.registry.category.CategoryRegistry;
import me.shedaniel.rei.api.client.registry.display.DisplayRegistry;
Expand All @@ -23,7 +23,7 @@ public void registerCategories(CategoryRegistry registry) {

@Override
public void registerDisplays(DisplayRegistry registry) {
registry.registerFiller(SimpleFurnitureRecipe.class, FurnitureDisplay::new);
registry.registerFiller(FurnitureRecipe.class, FurnitureDisplay::new);
registry.registerFiller(FreezingRecipe.class, FreezingDisplay::new);
}

Expand Down

0 comments on commit 6d476e3

Please sign in to comment.