From 9fc1ea35e865034487a204126e7fbb55e5554870 Mon Sep 17 00:00:00 2001 From: Justin Parsell Date: Sun, 24 Oct 2021 20:42:06 -0400 Subject: [PATCH] reccipe fix --- .../parsell/glowstonewire/GlowstoneWire.java | 2 ++ .../parsell/glowstonewire/core/glowItems.java | 5 ---- .../glowstonewire/core/glowRecipes.java | 23 +++++++++++-------- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/me/parsell/glowstonewire/GlowstoneWire.java b/src/main/java/me/parsell/glowstonewire/GlowstoneWire.java index b6f2f3f..5b0ef0a 100644 --- a/src/main/java/me/parsell/glowstonewire/GlowstoneWire.java +++ b/src/main/java/me/parsell/glowstonewire/GlowstoneWire.java @@ -2,6 +2,7 @@ package me.parsell.glowstonewire; import me.parsell.glowstonewire.core.glowBlocks; import me.parsell.glowstonewire.core.glowItems; +import me.parsell.glowstonewire.core.glowRecipes; import me.shedaniel.autoconfig.AutoConfig; import me.shedaniel.autoconfig.serializer.GsonConfigSerializer; import net.fabricmc.api.ModInitializer; @@ -17,5 +18,6 @@ public class GlowstoneWire implements ModInitializer { glowBlocks.init(); glowItems.init(); + glowRecipes.init(); } } diff --git a/src/main/java/me/parsell/glowstonewire/core/glowItems.java b/src/main/java/me/parsell/glowstonewire/core/glowItems.java index c4a593b..8263844 100644 --- a/src/main/java/me/parsell/glowstonewire/core/glowItems.java +++ b/src/main/java/me/parsell/glowstonewire/core/glowItems.java @@ -1,9 +1,5 @@ package me.parsell.glowstonewire.core; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; - import me.parsell.glowstonewire.GlowstoneWire; import me.parsell.glowstonewire.mixin.BrewingRecipeRegistryInvoker; import net.fabricmc.fabric.api.client.itemgroup.FabricItemGroupBuilder; @@ -14,7 +10,6 @@ import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.potion.Potions; -import net.minecraft.recipe.Ingredient; import net.minecraft.util.Identifier; import net.minecraft.util.registry.Registry; diff --git a/src/main/java/me/parsell/glowstonewire/core/glowRecipes.java b/src/main/java/me/parsell/glowstonewire/core/glowRecipes.java index df68270..0391799 100644 --- a/src/main/java/me/parsell/glowstonewire/core/glowRecipes.java +++ b/src/main/java/me/parsell/glowstonewire/core/glowRecipes.java @@ -13,9 +13,13 @@ public class glowRecipes { // Vanilla Glowstone -> Modded Glowstone if(GlowstoneWire.CONFIG.addConversionRecipe || true) { // This is the json objects - JsonObject cIngredientsKey = new JsonObject(); + JsonObject cIngredientVanilla = new JsonObject(); + JsonObject CIngredientModded = new JsonObject(); JsonArray cIngredientsList = new JsonArray(); + cIngredientVanilla.addProperty("item", "minecraft:glowstone_dust"); + CIngredientModded.addProperty("item", "glowstonewire:glowstone_dust"); + // FOR VANILLA TO MODDED VANILLA_TO_MODDED = new JsonObject(); @@ -23,13 +27,11 @@ public class glowRecipes { VANILLA_TO_MODDED.addProperty("type", "minecraft:crafting_shapeless"); // Adding the ingredients - cIngredientsKey.addProperty("item", "minecraft:glowstone_dust"); - cIngredientsList.add(cIngredientsKey); + cIngredientsList.add(cIngredientVanilla); VANILLA_TO_MODDED.add("ingredients", cIngredientsList); // Adding the result - cIngredientsKey.addProperty("item", "glowstonewire:glowstone_dust"); - VANILLA_TO_MODDED.add("result", cIngredientsKey); + VANILLA_TO_MODDED.add("result", CIngredientModded); // Clearing out the old array for new cIngredientsList = new JsonArray(); @@ -37,17 +39,18 @@ public class glowRecipes { // FOR MODDED TO VANILLA MODDED_TO_VANILLA = new JsonObject(); - // Define reccipe type + // Define recipe type MODDED_TO_VANILLA.addProperty("type", "minecraft:crafting_shapeless"); // Add ingredients - cIngredientsKey.addProperty("item", "glowstonewire:glowstone_dust"); - cIngredientsList.add(cIngredientsKey); + cIngredientsList.add(CIngredientModded); MODDED_TO_VANILLA.add("ingredients", cIngredientsList); // Add result - cIngredientsKey.addProperty("item", "minecraft:glowstone_dust"); - MODDED_TO_VANILLA.add("result", cIngredientsKey); + MODDED_TO_VANILLA.add("result", cIngredientVanilla); + + System.out.println(MODDED_TO_VANILLA.toString()); + System.out.println(VANILLA_TO_MODDED.toString()); } } }