diff --git a/src/main/java/vazkii/botania/common/crafting/GardenOfGlassConditionFactory.java b/src/main/java/vazkii/botania/common/crafting/GardenOfGlassConditionFactory.java new file mode 100644 index 000000000..247fcaf81 --- /dev/null +++ b/src/main/java/vazkii/botania/common/crafting/GardenOfGlassConditionFactory.java @@ -0,0 +1,17 @@ +package vazkii.botania.common.crafting; + +import com.google.gson.JsonObject; +import net.minecraft.util.JsonUtils; +import net.minecraftforge.common.crafting.IConditionFactory; +import net.minecraftforge.common.crafting.JsonContext; +import vazkii.botania.common.Botania; + +import java.util.function.BooleanSupplier; + +public class GardenOfGlassConditionFactory implements IConditionFactory { + @Override + public BooleanSupplier parse(JsonContext context, JsonObject json) { + boolean value = JsonUtils.getBoolean(json , "value", true); + return () -> Botania.gardenOfGlassLoaded == value; + } +} diff --git a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java index f9863dc9d..d37409140 100644 --- a/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java +++ b/src/main/java/vazkii/botania/common/crafting/ModCraftingRecipes.java @@ -409,15 +409,6 @@ public final class ModCraftingRecipes { } recipesTwigWand = BotaniaAPI.getLatestAddedRecipes(256); - // Mana Spreader Recipes - for(int i = 0; i < 16; i++) - addOreDictRecipe(new ItemStack(ModBlocks.spreader), - "WWW", "GP ", "WWW", - 'W', LibOreDict.LIVING_WOOD, - 'P', LibOreDict.PETAL[i], - 'G', Botania.gardenOfGlassLoaded ? LibOreDict.LIVING_WOOD : "ingotGold"); - recipesSpreader = BotaniaAPI.getLatestAddedRecipes(16); - // Mana Tablet Recipe addOreDictRecipe(new ItemStack(ModItems.manaTablet, 1, 10000), "SSS", "SPS", "SSS", @@ -514,28 +505,6 @@ public final class ModCraftingRecipes { addShapelessRecipe(new ItemStack(ModBlocks.corporeaFunnel), new ItemStack(Blocks.DROPPER), new ItemStack(ModItems.corporeaSpark)); recipeCorporeaFunnel = BotaniaAPI.getLatestAddedRecipe(); - // Blaze Light Recipe - addOreDictRecipe(new ItemStack(ModBlocks.blazeBlock), - "BBB", "BBB", "BBB", - 'B', Botania.gardenOfGlassLoaded ? "powderBlaze" : "rodBlaze"); - recipeBlazeBlock = BotaniaAPI.getLatestAddedRecipe(); - addShapelessOreDictRecipe(new ItemStack(Botania.gardenOfGlassLoaded ? Items.BLAZE_POWDER : Items.BLAZE_ROD, 9), LibOreDict.BLAZE_BLOCK); - - - // Cocoon of Caprice Recipe - if(Botania.gardenOfGlassLoaded) - addOreDictRecipe(new ItemStack(ModBlocks.cocoon), - "SSS", "SFS", "SIS", - 'S', new ItemStack(Items.STRING), - 'F', new ItemStack(ModBlocks.felPumpkin), - 'I', LibOreDict.MANA_STEEL); - else addOreDictRecipe(new ItemStack(ModBlocks.cocoon), - "SSS", "SPS", "SDS", - 'S', new ItemStack(Items.STRING), - 'P', LibOreDict.PIXIE_DUST, - 'D', LibOreDict.DRAGONSTONE); - recipeCocoon = BotaniaAPI.getLatestAddedRecipe(); - // Cacophonium Recipe if(OreDictionary.getOres("ingotBrass").isEmpty()) addOreDictRecipe(new ItemStack(ModItems.cacophonium), @@ -564,38 +533,9 @@ public final class ModCraftingRecipes { GameRegistry.addSmelting(new ItemStack(ModFluffBlocks.biomeStoneA, 1, i + 8), new ItemStack(ModFluffBlocks.biomeStoneA, 1, i), 0.1F); } - // Misc Recipes - if(Botania.gardenOfGlassLoaded) - initGardenOfGlass(); - generateConstants(); } - private static void initGardenOfGlass() { - // Root to Sapling - addShapelessOreDictRecipe(new ItemStack(Blocks.SAPLING), LibOreDict.ROOT, LibOreDict.ROOT, LibOreDict.ROOT, LibOreDict.ROOT); - recipeRootToSapling = BotaniaAPI.getLatestAddedRecipe(); - - // Root to Fertilizer - addShapelessOreDictRecipe(new ItemStack(ModItems.fertilizer), LibOreDict.ROOT); - recipeRootToFertilizer = BotaniaAPI.getLatestAddedRecipe(); - - // Pebble to Cobble - addShapelessOreDictRecipe(new ItemStack(Blocks.COBBLESTONE), LibOreDict.PEBBLE, LibOreDict.PEBBLE, LibOreDict.PEBBLE, LibOreDict.PEBBLE); - recipePebbleCobblestone = BotaniaAPI.getLatestAddedRecipe(); - - // Magma Pearl to Slimeball - addShapelessOreDictRecipe(new ItemStack(Items.SLIME_BALL), new ItemStack(Items.MAGMA_CREAM), new ItemStack(Items.WATER_BUCKET)); - recipeMagmaToSlimeball = BotaniaAPI.getLatestAddedRecipe(); - - // Ender Portal - addOreDictRecipe(new ItemStack(Blocks.END_PORTAL_FRAME), - "OGO", - 'O', new ItemStack(Blocks.OBSIDIAN), - 'G', LibOreDict.LIFE_ESSENCE); - recipeEndPortal = BotaniaAPI.getLatestAddedRecipe(); - } - private static void addStairsAndSlabs(Block block, int meta, Block stairs, Block slab) { addShapedRecipe(new ItemStack(slab, 6), "QQQ", diff --git a/src/main/resources/assets/botania/recipes/_constants.json b/src/main/resources/assets/botania/recipes/_constants.json index 87be5a4cd..4ac0f2b59 100644 --- a/src/main/resources/assets/botania/recipes/_constants.json +++ b/src/main/resources/assets/botania/recipes/_constants.json @@ -720,6 +720,13 @@ }, "name": "QUARTZSUNNY" }, + { + "ingredient": { + "type": "forge:ore_dict", + "ore": "rodBlaze" + }, + "name": "RODBLAZE" + }, { "ingredient": { "type": "forge:ore_dict", diff --git a/src/main/resources/assets/botania/recipes/_factories.json b/src/main/resources/assets/botania/recipes/_factories.json new file mode 100644 index 000000000..983245595 --- /dev/null +++ b/src/main/resources/assets/botania/recipes/_factories.json @@ -0,0 +1,5 @@ +{ + "conditions": { + "garden_of_glass": "vazkii.botania.common.crafting.GardenOfGlassConditionFactory" + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/recipes/blazeblock.json b/src/main/resources/assets/botania/recipes/blazeblock.json index e1eae62be..024de1409 100644 --- a/src/main/resources/assets/botania/recipes/blazeblock.json +++ b/src/main/resources/assets/botania/recipes/blazeblock.json @@ -1,4 +1,10 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "false" + } + ], "result": { "item": "botania:blazeblock" }, @@ -10,7 +16,7 @@ "type": "forge:ore_shaped", "key": { "B": { - "item": "#POWDERBLAZE" + "item": "#RODBLAZE" } } } \ No newline at end of file diff --git a/src/main/resources/assets/botania/recipes/cocoon.json b/src/main/resources/assets/botania/recipes/cocoon.json index 46c218468..f5b210471 100644 --- a/src/main/resources/assets/botania/recipes/cocoon.json +++ b/src/main/resources/assets/botania/recipes/cocoon.json @@ -1,22 +1,28 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "false" + } + ], "result": { "item": "botania:cocoon" }, "pattern": [ "SSS", - "SFS", - "SIS" + "SPS", + "SDS" ], "type": "forge:ore_shaped", "key": { "S": { "item": "minecraft:string" }, - "F": { - "item": "botania:felpumpkin" + "P": { + "item": "#ELVENPIXIEDUST" }, - "I": { - "item": "#INGOTMANASTEEL" + "D": { + "item": "#ELVENDRAGONSTONE" } } } \ No newline at end of file diff --git a/src/main/resources/assets/botania/recipes/conversions/blazeblock_deconstruct.json b/src/main/resources/assets/botania/recipes/conversions/blazeblock_deconstruct.json new file mode 100644 index 000000000..836492f72 --- /dev/null +++ b/src/main/resources/assets/botania/recipes/conversions/blazeblock_deconstruct.json @@ -0,0 +1,18 @@ +{ + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "false" + } + ], + "result": { + "item": "minecraft:blaze_powder", + "count": 9 + }, + "ingredients": [ + { + "item": "#BLOCKBLAZE" + } + ], + "type": "forge:ore_shapeless" +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/recipes/fertilizer_alt.json b/src/main/resources/assets/botania/recipes/fertilizer_dye.json similarity index 100% rename from src/main/resources/assets/botania/recipes/fertilizer_alt.json rename to src/main/resources/assets/botania/recipes/fertilizer_dye.json diff --git a/src/main/resources/assets/botania/recipes/fertilizer_powder.json b/src/main/resources/assets/botania/recipes/fertilizer_powder.json new file mode 100644 index 000000000..5515d2df0 --- /dev/null +++ b/src/main/resources/assets/botania/recipes/fertilizer_powder.json @@ -0,0 +1,34 @@ +{ + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "false" + } + ], + "result": { + "item": "botania:fertilizer" + }, + "ingredients": [ + { + "item": "minecraft:dye", + "data": 15 + }, + { + "item": "botania:dye", + "data": 32767 + }, + { + "item": "botania:dye", + "data": 32767 + }, + { + "item": "botania:dye", + "data": 32767 + }, + { + "item": "botania:dye", + "data": 32767 + } + ], + "type": "minecraft:crafting_shapeless" +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/recipes/garden_of_glass/blazeblock.json b/src/main/resources/assets/botania/recipes/garden_of_glass/blazeblock.json new file mode 100644 index 000000000..8b21ffda5 --- /dev/null +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/blazeblock.json @@ -0,0 +1,22 @@ +{ + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], + "result": { + "item": "botania:blazeblock" + }, + "pattern": [ + "BBB", + "BBB", + "BBB" + ], + "type": "forge:ore_shaped", + "key": { + "B": { + "item": "#POWDERBLAZE" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/recipes/blaze_powder.json b/src/main/resources/assets/botania/recipes/garden_of_glass/blazeblock_deconstruct.json similarity index 63% rename from src/main/resources/assets/botania/recipes/blaze_powder.json rename to src/main/resources/assets/botania/recipes/garden_of_glass/blazeblock_deconstruct.json index 9472b8103..045915a49 100644 --- a/src/main/resources/assets/botania/recipes/blaze_powder.json +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/blazeblock_deconstruct.json @@ -1,4 +1,10 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], "result": { "item": "minecraft:blaze_powder", "count": 9 diff --git a/src/main/resources/assets/botania/recipes/garden_of_glass/cocoon.json b/src/main/resources/assets/botania/recipes/garden_of_glass/cocoon.json new file mode 100644 index 000000000..15042ba98 --- /dev/null +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/cocoon.json @@ -0,0 +1,28 @@ +{ + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], + "result": { + "item": "botania:cocoon" + }, + "pattern": [ + "SSS", + "SFS", + "SIS" + ], + "type": "forge:ore_shaped", + "key": { + "S": { + "item": "minecraft:string" + }, + "F": { + "item": "botania:felpumpkin" + }, + "I": { + "item": "#INGOTMANASTEEL" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/recipes/end_portal_frame.json b/src/main/resources/assets/botania/recipes/garden_of_glass/end_portal_frame.json similarity index 71% rename from src/main/resources/assets/botania/recipes/end_portal_frame.json rename to src/main/resources/assets/botania/recipes/garden_of_glass/end_portal_frame.json index 66ff7280c..73aa069b4 100644 --- a/src/main/resources/assets/botania/recipes/end_portal_frame.json +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/end_portal_frame.json @@ -1,4 +1,10 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], "result": { "item": "minecraft:end_portal_frame" }, diff --git a/src/main/resources/assets/botania/recipes/fertilizer.json b/src/main/resources/assets/botania/recipes/garden_of_glass/fertilizer_powder.json similarity index 81% rename from src/main/resources/assets/botania/recipes/fertilizer.json rename to src/main/resources/assets/botania/recipes/garden_of_glass/fertilizer_powder.json index 4d99dca42..e1fcd3505 100644 --- a/src/main/resources/assets/botania/recipes/fertilizer.json +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/fertilizer_powder.json @@ -1,4 +1,10 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], "result": { "item": "botania:fertilizer", "count": 3 diff --git a/src/main/resources/assets/botania/recipes/slime_ball.json b/src/main/resources/assets/botania/recipes/garden_of_glass/magma_cream_to_slime_ball.json similarity index 69% rename from src/main/resources/assets/botania/recipes/slime_ball.json rename to src/main/resources/assets/botania/recipes/garden_of_glass/magma_cream_to_slime_ball.json index b51fb10d7..2726d6f0d 100644 --- a/src/main/resources/assets/botania/recipes/slime_ball.json +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/magma_cream_to_slime_ball.json @@ -1,4 +1,10 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], "result": { "item": "minecraft:slime_ball" }, diff --git a/src/main/resources/assets/botania/recipes/cobblestone.json b/src/main/resources/assets/botania/recipes/garden_of_glass/pebble_to_cobblestone.json similarity index 72% rename from src/main/resources/assets/botania/recipes/cobblestone.json rename to src/main/resources/assets/botania/recipes/garden_of_glass/pebble_to_cobblestone.json index 490fc78af..2a10ca32f 100644 --- a/src/main/resources/assets/botania/recipes/cobblestone.json +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/pebble_to_cobblestone.json @@ -1,4 +1,10 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], "result": { "item": "minecraft:cobblestone" }, diff --git a/src/main/resources/assets/botania/recipes/fertilizer_alt_alt.json b/src/main/resources/assets/botania/recipes/garden_of_glass/root_to_fertilizer.json similarity index 60% rename from src/main/resources/assets/botania/recipes/fertilizer_alt_alt.json rename to src/main/resources/assets/botania/recipes/garden_of_glass/root_to_fertilizer.json index 1c4764da5..5d4bb51ef 100644 --- a/src/main/resources/assets/botania/recipes/fertilizer_alt_alt.json +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/root_to_fertilizer.json @@ -1,4 +1,10 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], "result": { "item": "botania:fertilizer" }, diff --git a/src/main/resources/assets/botania/recipes/sapling_0.json b/src/main/resources/assets/botania/recipes/garden_of_glass/root_to_sapling.json similarity index 74% rename from src/main/resources/assets/botania/recipes/sapling_0.json rename to src/main/resources/assets/botania/recipes/garden_of_glass/root_to_sapling.json index fc5020423..dba59b646 100644 --- a/src/main/resources/assets/botania/recipes/sapling_0.json +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/root_to_sapling.json @@ -1,4 +1,10 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], "result": { "item": "minecraft:sapling", "data": 0 diff --git a/src/main/resources/assets/botania/recipes/garden_of_glass/spreader_0.json b/src/main/resources/assets/botania/recipes/garden_of_glass/spreader_0.json new file mode 100644 index 000000000..8ef6bab5a --- /dev/null +++ b/src/main/resources/assets/botania/recipes/garden_of_glass/spreader_0.json @@ -0,0 +1,76 @@ +{ + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "true" + } + ], + "result": { + "item": "botania:spreader", + "data": 0 + }, + "pattern": [ + "WWW", + "GP ", + "WWW" + ], + "type": "forge:ore_shaped", + "key": { + "P": [ + { + "item": "#PETALWHITE" + }, + { + "item": "#PETALORANGE" + }, + { + "item": "#PETALMAGENTA" + }, + { + "item": "#PETALLIGHTBLUE" + }, + { + "item": "#PETALYELLOW" + }, + { + "item": "#PETALLIME" + }, + { + "item": "#PETALPINK" + }, + { + "item": "#PETALGRAY" + }, + { + "item": "#PETALLIGHTGRAY" + }, + { + "item": "#PETALCYAN" + }, + { + "item": "#PETALPURPLE" + }, + { + "item": "#PETALBLUE" + }, + { + "item": "#PETALBROWN" + }, + { + "item": "#PETALGREEN" + }, + { + "item": "#PETALRED" + }, + { + "item": "#PETALBLACK" + } + ], + "W": { + "item": "#LIVINGWOOD" + }, + "G": { + "item": "#LIVINGWOOD" + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/botania/recipes/spreader_0.json b/src/main/resources/assets/botania/recipes/spreader_0.json index df8ab3f8b..864ec0587 100644 --- a/src/main/resources/assets/botania/recipes/spreader_0.json +++ b/src/main/resources/assets/botania/recipes/spreader_0.json @@ -1,4 +1,10 @@ { + "conditions": [ + { + "type": "botania:garden_of_glass", + "value": "false" + } + ], "result": { "item": "botania:spreader", "data": 0 @@ -64,7 +70,7 @@ "item": "#LIVINGWOOD" }, "G": { - "item": "#LIVINGWOOD" + "item": "#INGOTGOLD" } } } \ No newline at end of file