From a2686c26ceab394b9563b7ba98a956596a64038f Mon Sep 17 00:00:00 2001 From: Lizbeth Rika Date: Sat, 26 Jul 2014 02:46:52 +0100 Subject: [PATCH] What a coarse. --- .../client/core/handler/TooltipHandler.java | 31 +++++++++++++++++++ .../client/core/proxy/ClientProxy.java | 3 ++ .../crafting/ModManaAlchemyRecipes.java | 4 ++- .../botania/common/lexicon/LexiconData.java | 2 +- resources/assets/botania/lang/en_US.lang | 3 ++ 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 MODSRC/vazkii/botania/client/core/handler/TooltipHandler.java diff --git a/MODSRC/vazkii/botania/client/core/handler/TooltipHandler.java b/MODSRC/vazkii/botania/client/core/handler/TooltipHandler.java new file mode 100644 index 000000000..7f4f4c3e9 --- /dev/null +++ b/MODSRC/vazkii/botania/client/core/handler/TooltipHandler.java @@ -0,0 +1,31 @@ +/** + * 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 @ [Jul 26, 2014, 2:33:04 AM (GMT)] + */ +package vazkii.botania.client.core.handler; + +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.util.StatCollector; +import net.minecraftforge.event.entity.player.ItemTooltipEvent; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + +public final class TooltipHandler { + + @SubscribeEvent(priority = EventPriority.HIGHEST) + public void onTooltipEvent(ItemTooltipEvent event) { + if(event.itemStack.getItem() == Item.getItemFromBlock(Blocks.dirt) && event.itemStack.getItemDamage() == 1) { + event.toolTip.add(StatCollector.translateToLocal("botaniamisc.coarseDirt0")); + event.toolTip.add(StatCollector.translateToLocal("botaniamisc.coarseDirt1")); + } + } + +} diff --git a/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java b/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java index d4daf8153..56295ee6d 100644 --- a/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java +++ b/MODSRC/vazkii/botania/client/core/proxy/ClientProxy.java @@ -27,6 +27,7 @@ import vazkii.botania.client.core.handler.BoundTileRenderer; import vazkii.botania.client.core.handler.ClientTickHandler; import vazkii.botania.client.core.handler.HUDHandler; import vazkii.botania.client.core.handler.LightningHandler; +import vazkii.botania.client.core.handler.TooltipHandler; import vazkii.botania.client.core.helper.ShaderHelper; import vazkii.botania.client.fx.FXSparkle; import vazkii.botania.client.fx.FXWisp; @@ -92,6 +93,8 @@ public class ClientProxy extends CommonProxy { MinecraftForge.EVENT_BUS.register(new LightningHandler()); if(ConfigHandler.boundBlockWireframe) MinecraftForge.EVENT_BUS.register(new BoundTileRenderer()); + MinecraftForge.EVENT_BUS.register(new TooltipHandler()); + if(ConfigHandler.versionCheckEnabled) new VersionChecker().init(); diff --git a/MODSRC/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java b/MODSRC/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java index eba76f2c2..11e56dff9 100644 --- a/MODSRC/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java +++ b/MODSRC/vazkii/botania/common/crafting/ModManaAlchemyRecipes.java @@ -44,6 +44,7 @@ public final class ModManaAlchemyRecipes { public static RecipeManaInfusion enderPearlRecipe; public static List redstoneToGlowstoneRecipes; public static RecipeManaInfusion sandRecipe; + public static RecipeManaInfusion coarseDirtRecipe; public static RecipeManaInfusion prismarineRecipe; public static void init() { @@ -114,7 +115,8 @@ public final class ModManaAlchemyRecipes { redstoneToGlowstoneRecipes.add(BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Items.glowstone_dust), new ItemStack(Items.redstone), 300)); sandRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Block.getBlockFromName("sand")), new ItemStack(Blocks.cobblestone), 50); - + coarseDirtRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(Blocks.dirt, 1, 1), new ItemStack(Blocks.dirt), 120); + prismarineRecipe = BotaniaAPI.registerManaAlchemyRecipe(new ItemStack(ModItems.manaResource, 1, 10), new ItemStack(Items.quartz), 200); } } diff --git a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java index 7cbcd1acb..19a31c425 100644 --- a/MODSRC/vazkii/botania/common/lexicon/LexiconData.java +++ b/MODSRC/vazkii/botania/common/lexicon/LexiconData.java @@ -376,7 +376,7 @@ public final class LexiconData { new PageManaInfusionRecipe("6", ModManaAlchemyRecipes.quartzRecipes), new PageManaInfusionRecipe("7", ModManaAlchemyRecipes.chiseledBrickRecipe), new PageManaInfusionRecipe("8", ModManaAlchemyRecipes.iceRecipe), new PageManaInfusionRecipe("9", ModManaAlchemyRecipes.swampFolliageRecipes), new PageManaInfusionRecipe("10", ModManaAlchemyRecipes.fishRecipes), new PageManaInfusionRecipe("11", ModManaAlchemyRecipes.cropRecipes), new PageManaInfusionRecipe("12", ModManaAlchemyRecipes.potatoRecipe), new PageManaInfusionRecipe("13", ModManaAlchemyRecipes.netherWartRecipe), new PageManaInfusionRecipe("14", ModManaAlchemyRecipes.gunpowderAndFlintRecipes), new PageManaInfusionRecipe("15", ModManaAlchemyRecipes.nameTagRecipe), new PageManaInfusionRecipe("16", ModManaAlchemyRecipes.stringRecipes), new PageManaInfusionRecipe("17", ModManaAlchemyRecipes.slimeballCactusRecipes), - new PageManaInfusionRecipe("18", ModManaAlchemyRecipes.enderPearlRecipe), new PageManaInfusionRecipe("19", ModManaAlchemyRecipes.redstoneToGlowstoneRecipes), new PageManaInfusionRecipe("20", ModManaAlchemyRecipes.sandRecipe)); + new PageManaInfusionRecipe("18", ModManaAlchemyRecipes.enderPearlRecipe), new PageManaInfusionRecipe("19", ModManaAlchemyRecipes.redstoneToGlowstoneRecipes), new PageManaInfusionRecipe("20", ModManaAlchemyRecipes.sandRecipe), new PageManaInfusionRecipe("21", ModManaAlchemyRecipes.coarseDirtRecipe)); openCrate = new BLexiconEntry(LibLexicon.DEVICE_OPEN_CRATE, categoryDevices); openCrate.setLexiconPages(new PageText("0"), new PageText("1"), new PageCraftingRecipe("2", ModCrafingRecipes.recipeOpenCrate)); diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index 3ebf14707..0b83b7902 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -45,6 +45,8 @@ botaniamisc.ratio=%s:1 Ratio botaniamisc.openBaubles=Baubles Inventory botaniamisc.openInv=Normal Inventory botaniamisc.bottleTooltip=It has an acquired taste +botaniamisc.coarseDirt0=Coarse Dirt, grass +botaniamisc.coarseDirt1=won't grow on it # COLORS botania.color0=White @@ -1031,6 +1033,7 @@ botania.page.manaAlchemy17=Converting between &1Slimeballs&0 and &1Cactus&0 botania.page.manaAlchemy18=Creating &1Ender Pearls&0 botania.page.manaAlchemy19=Converting between &1Glowstone&0 and &1Redstone&0 botania.page.manaAlchemy20=Breaking &1Cobblestone&0 into &1Sand&0 +botania.page.manaAlchemy21=Making &1Coarse Dirt&0 # -- EYE OF THE ANCIENTS botania.entry.forestEye=Eye of the Ancients