diff --git a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java index ba728c0dc..583809913 100644 --- a/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java +++ b/src/main/java/vazkii/botania/common/block/BlockFloatingSpecialFlower.java @@ -13,24 +13,31 @@ package vazkii.botania.common.block; import java.util.ArrayList; import java.util.List; +import java.util.Random; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.passive.EntitySheep; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import net.minecraftforge.oredict.RecipeSorter; +import net.minecraftforge.oredict.RecipeSorter.Category; import vazkii.botania.api.BotaniaAPI; import vazkii.botania.api.lexicon.ILexiconable; import vazkii.botania.api.subtile.ISpecialFlower; import vazkii.botania.api.wand.IWandHUD; import vazkii.botania.api.wand.IWandable; +import vazkii.botania.common.Botania; import vazkii.botania.common.block.decor.BlockFloatingFlower; import vazkii.botania.common.block.tile.TileFloatingSpecialFlower; import vazkii.botania.common.block.tile.TileSpecialFlower; +import vazkii.botania.common.core.handler.ConfigHandler; +import vazkii.botania.common.crafting.recipe.SpecialFloatingFlowerRecipe; import vazkii.botania.common.item.block.ItemBlockFloatingSpecialFlower; import vazkii.botania.common.item.block.ItemBlockSpecialFlower; import vazkii.botania.common.lib.LibBlockNames; @@ -40,6 +47,14 @@ public class BlockFloatingSpecialFlower extends BlockFloatingFlower implements I public BlockFloatingSpecialFlower() { super(LibBlockNames.FLOATING_SPECIAL_FLOWER); + + GameRegistry.addRecipe(new SpecialFloatingFlowerRecipe()); + RecipeSorter.register("botania:floatingSpecialFlower", SpecialFloatingFlowerRecipe.class, Category.SHAPELESS, ""); + } + + @Override + public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { + // NO-OP } @Override diff --git a/src/main/java/vazkii/botania/common/crafting/recipe/SpecialFloatingFlowerRecipe.java b/src/main/java/vazkii/botania/common/crafting/recipe/SpecialFloatingFlowerRecipe.java new file mode 100644 index 000000000..dcebe8580 --- /dev/null +++ b/src/main/java/vazkii/botania/common/crafting/recipe/SpecialFloatingFlowerRecipe.java @@ -0,0 +1,73 @@ +/** + * This class was created by . It's distributed as + * part of the Botania Mod. Get the Source Code in github: + * https://github.com/Vazkii/Botania + * + * Botania is Open Source and distributed under a + * Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License + * (http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB) + * + * File Created @ [Nov 17, 2014, 6:34:36 PM (GMT)] + */ +package vazkii.botania.common.crafting.recipe; + +import vazkii.botania.common.block.ModBlocks; +import vazkii.botania.common.item.ModItems; +import vazkii.botania.common.item.block.ItemBlockSpecialFlower; +import vazkii.botania.common.item.equipment.tool.ItemTerraPick; +import net.minecraft.inventory.InventoryCrafting; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.IRecipe; +import net.minecraft.world.World; + +public class SpecialFloatingFlowerRecipe implements IRecipe { + + @Override + public boolean matches(InventoryCrafting var1, World var2) { + boolean foundFloatingFlower = false; + boolean foundSpecialFlower = false; + + for(int i = 0; i < var1.getSizeInventory(); i++) { + ItemStack stack = var1.getStackInSlot(i); + if(stack != null) { + if(stack.getItem() == Item.getItemFromBlock(ModBlocks.floatingFlower)) + foundFloatingFlower = true; + + else if(stack.getItem() == Item.getItemFromBlock(ModBlocks.specialFlower)) + foundSpecialFlower = true; + + else return false; // Found an invalid item, breaking the recipe + } + } + + return foundFloatingFlower && foundSpecialFlower; + } + + @Override + public ItemStack getCraftingResult(InventoryCrafting var1) { + ItemStack specialFlower = null; + + for(int i = 0; i < var1.getSizeInventory(); i++) { + ItemStack stack = var1.getStackInSlot(i); + if(stack != null && stack.getItem() == Item.getItemFromBlock(ModBlocks.specialFlower)) + specialFlower = stack; + } + + if(specialFlower == null) + return null; + + return ItemBlockSpecialFlower.ofType(new ItemStack(ModBlocks.floatingSpecialFlower), ItemBlockSpecialFlower.getType(specialFlower)); + } + + @Override + public int getRecipeSize() { + return 10; + } + + @Override + public ItemStack getRecipeOutput() { + return null; + } + +} diff --git a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java index 51a1b1be3..b3e737e5e 100644 --- a/src/main/java/vazkii/botania/common/lexicon/LexiconData.java +++ b/src/main/java/vazkii/botania/common/lexicon/LexiconData.java @@ -661,7 +661,7 @@ public final class LexiconData { dispenserTweaks.setLexiconPages(new PageText("0")); shinyFlowers = new BLexiconEntry(LibLexicon.MISC_SHINY_FLOWERS, categoryMisc); - shinyFlowers.setLexiconPages(new PageText("0"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesShinyFlowers), new PageCraftingRecipe("2", ModCraftingRecipes.recipesMiniIsland)); + shinyFlowers.setLexiconPages(new PageText("0"), new PageText("3"), new PageCraftingRecipe("1", ModCraftingRecipes.recipesShinyFlowers), new PageCraftingRecipe("2", ModCraftingRecipes.recipesMiniIsland)); prismarine = new BLexiconEntry(LibLexicon.MISC_PRISMARINE, categoryMisc); prismarine.setLexiconPages(new PageText("0"), new PageText("1"), new PageManaInfusionRecipe("2", ModManaAlchemyRecipes.prismarineRecipe), new PageCraftingRecipe("3", ModCraftingRecipes.recipePrismarine), new PageCraftingRecipe("4", ModCraftingRecipes.recipePrismarineBrick), new PageCraftingRecipe("5", ModCraftingRecipes.recipeDarkPrismarine), new PageCraftingRecipe("6", ModCraftingRecipes.recipeSeaLamp)); diff --git a/src/main/resources/assets/botania/lang/en_US.lang b/src/main/resources/assets/botania/lang/en_US.lang index 67ff221e3..14b6b3064 100644 --- a/src/main/resources/assets/botania/lang/en_US.lang +++ b/src/main/resources/assets/botania/lang/en_US.lang @@ -1813,6 +1813,7 @@ botania.page.dispenserTweaks0=&1Dispensers&0, among their normal abilities, can # -- GLIMMERING FLOWERS botania.entry.shinyFlowers=Glimmering Flowers botania.page.shinyFlowers0=By combining your typical &1Mystical Flowers&0 with some &1Glowstone Dust&0, you can make them sparkle even brighter, and emit actual physical light, of the same brightness as a &1Glowstone Block&0.
With some &1Dirt&0 and &1Pasture Seeds&0 it's possible to turn them into a miniature floating island that will not only emit light, but also look very fancy indeed. +botania.page.shinyFlowers3=Combining any color of &1Floating Flower&0 with any flower that has an effect (any &4Functional or Generating Flower&0, etc) in a crafting table will join the two, allowing for both the look and properties of a &1Floating Flower&0 and the effects of the flower chosen in one block. botania.page.shinyFlowers1=Pretty Pretty Shiny Shiny botania.page.shinyFlowers2=Like Laputa but (a lot) tinier