reccipe fix

This commit is contained in:
Justin Parsell 2021-10-24 20:42:06 -04:00
parent f6af1add93
commit 9fc1ea35e8
3 changed files with 15 additions and 15 deletions

View File

@ -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();
}
}

View File

@ -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;

View File

@ -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());
}
}
}