From df5bee29cc2029f9d3552d3f01bc401b934ee5f9 Mon Sep 17 00:00:00 2001 From: Vasco Lavos Date: Sat, 15 Feb 2014 15:00:39 +0000 Subject: [PATCH] Lexica Botania in-world lookup now needs sneaking. --- .../botania/common/item/ItemLexicon.java | 19 +++++++++++-------- resources/assets/botania/lang/en_US.lang | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/MODSRC/vazkii/botania/common/item/ItemLexicon.java b/MODSRC/vazkii/botania/common/item/ItemLexicon.java index daad73849..df60a1bde 100644 --- a/MODSRC/vazkii/botania/common/item/ItemLexicon.java +++ b/MODSRC/vazkii/botania/common/item/ItemLexicon.java @@ -33,17 +33,20 @@ public class ItemLexicon extends ItemMod { @Override public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { - int id = par3World.getBlockId(par4, par5, par6); - Block block = Block.blocksList[id]; + if(par2EntityPlayer.isSneaking()) { + int id = par3World.getBlockId(par4, par5, par6); + Block block = Block.blocksList[id]; - if(block != null && block instanceof ILexiconable) { - LexiconEntry entry = ((ILexiconable) block).getEntry(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); - if(entry != null) { - Botania.proxy.setEntryToOpen(entry); - par2EntityPlayer.openGui(Botania.instance, LibGuiIDs.LEXICON, par3World, 0, 0, 0); - return true; + if(block != null && block instanceof ILexiconable) { + LexiconEntry entry = ((ILexiconable) block).getEntry(par3World, par4, par5, par6, par2EntityPlayer, par1ItemStack); + if(entry != null) { + Botania.proxy.setEntryToOpen(entry); + par2EntityPlayer.openGui(Botania.instance, LibGuiIDs.LEXICON, par3World, 0, 0, 0); + return true; + } } } + return false; } diff --git a/resources/assets/botania/lang/en_US.lang b/resources/assets/botania/lang/en_US.lang index 724d8a470..2f79fcd82 100644 --- a/resources/assets/botania/lang/en_US.lang +++ b/resources/assets/botania/lang/en_US.lang @@ -173,7 +173,7 @@ botania.category.misc=Miscellaneous # - BASIC # -- LEXICA BOTANIA botania.entry.lexicon=Lexica Botania -botania.page.lexicon0=The &1Lexica Botania&0 is the repository of all knowledge for all botany related matters. But you probably knew that already.
All information is stored here, as expected. For convenience, if a block happens to have an entry in here, it can be right clicked with the Lexica Botania to open that entry. +botania.page.lexicon0=The &1Lexica Botania&0 is the repository of all knowledge for all botany related matters. But you probably knew that already.
All information is stored here, as expected. For convenience, if a block happens to have an entry, it can be shift-right clicked with the &1Lexica Botania&0 to open that entry. botania.page.lexicon1=Crafting the &1Lexica Botania&0. # -- MYSTICAL FLOWERS