Enable/disable recipes appropriately based on GoG

This commit is contained in:
Vincent Lee committed 2017-06-25 15:32:17 -05:00
1 parent 18bf7526b2
commit 19aec9d25b
20 files changed
+275 -68

No files matched your search

@@ -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;
}
}
@@ -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",
@@ -720,6 +720,13 @@
},
"name": "QUARTZSUNNY"
},
{
"ingredient": {
"type": "forge:ore_dict",
"ore": "rodBlaze"
},
"name": "RODBLAZE"
},
{
"ingredient": {
"type": "forge:ore_dict",
@@ -0,0 +1,5 @@
{
"conditions": {
"garden_of_glass": "vazkii.botania.common.crafting.GardenOfGlassConditionFactory"
}
}
@@ -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"
}
}
}
@@ -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"
}
}
}
@@ -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"
}
@@ -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"
}
@@ -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"
}
}
}
@@ -1,4 +1,10 @@
{
"conditions": [
{
"type": "botania:garden_of_glass",
"value": "true"
}
],
"result": {
"item": "minecraft:blaze_powder",
"count": 9
@@ -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"
}
}
}
@@ -1,4 +1,10 @@
{
"conditions": [
{
"type": "botania:garden_of_glass",
"value": "true"
}
],
"result": {
"item": "minecraft:end_portal_frame"
},
@@ -1,4 +1,10 @@
{
"conditions": [
{
"type": "botania:garden_of_glass",
"value": "true"
}
],
"result": {
"item": "botania:fertilizer",
"count": 3
@@ -1,4 +1,10 @@
{
"conditions": [
{
"type": "botania:garden_of_glass",
"value": "true"
}
],
"result": {
"item": "minecraft:slime_ball"
},
@@ -1,4 +1,10 @@
{
"conditions": [
{
"type": "botania:garden_of_glass",
"value": "true"
}
],
"result": {
"item": "minecraft:cobblestone"
},
@@ -1,4 +1,10 @@
{
"conditions": [
{
"type": "botania:garden_of_glass",
"value": "true"
}
],
"result": {
"item": "botania:fertilizer"
},
@@ -1,4 +1,10 @@
{
"conditions": [
{
"type": "botania:garden_of_glass",
"value": "true"
}
],
"result": {
"item": "minecraft:sapling",
"data": 0
@@ -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"
}
}
}
@@ -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"
}
}
}