From f42bf353725a4b60b574b87dded259c26388381e Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 4 Oct 2015 13:21:07 +0200 Subject: [PATCH] Fixed some minor things --- .../blocks/BlockLeafGenerator.java | 25 ++-------- .../actuallyadditions/booklet/GuiBooklet.java | 14 +++++- .../booklet/InitBooklet.java | 2 +- .../booklet/page/BookletPage.java | 9 ++-- .../booklet/page/PageCoffeeRecipe.java | 6 +-- .../booklet/page/PageCrafting.java | 8 +-- .../booklet/page/PageCrusherRecipe.java | 6 +-- .../booklet/page/PageFurnace.java | 6 +-- .../booklet/page/PageTextOnly.java | 2 +- .../config/values/ConfigIntValues.java | 2 +- .../actuallyadditions/event/InitEvents.java | 1 - .../actuallyadditions/event/KeyStates.java | 50 ------------------- .../actuallyadditions/event/TooltipEvent.java | 6 +-- .../actuallyadditions/proxy/ClientProxy.java | 3 -- .../assets/actuallyadditions/lang/en_US.lang | 4 +- 15 files changed, 42 insertions(+), 102 deletions(-) delete mode 100644 src/main/java/ellpeck/actuallyadditions/event/KeyStates.java diff --git a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLeafGenerator.java b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLeafGenerator.java index 92a476673..5357a60d3 100644 --- a/src/main/java/ellpeck/actuallyadditions/blocks/BlockLeafGenerator.java +++ b/src/main/java/ellpeck/actuallyadditions/blocks/BlockLeafGenerator.java @@ -27,20 +27,17 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.IIcon; import net.minecraft.world.World; -import java.util.Random; - public class BlockLeafGenerator extends BlockContainerBase implements IActAddItemOrBlock{ private IIcon topIcon; private IIcon bottomIcon; public BlockLeafGenerator(){ - super(Material.rock); - this.setHarvestLevel("axe", 0); - this.setHardness(0.75F); - this.setResistance(3.0F); - this.setStepSound(soundTypeWood); - this.setTickRandomly(true); + super(Material.iron); + this.setHarvestLevel("pickaxe", 0); + this.setHardness(5.0F); + this.setResistance(10.0F); + this.setStepSound(soundTypeMetal); } @Override @@ -53,18 +50,6 @@ public class BlockLeafGenerator extends BlockContainerBase implements IActAddIte return side <= 1 ? (side == 0 ? this.bottomIcon : this.topIcon) : this.blockIcon; } - @Override - @SideOnly(Side.CLIENT) - public void randomDisplayTick(World world, int x, int y, int z, Random rand){ - int meta = world.getBlockMetadata(x, y, z); - - if(meta == 1){ - for(int i = 0; i < 5; i++){ - world.spawnParticle("smoke", (double)x+0.5F, (double)y+1.0F, (double)z+0.5F, 0.0D, 0.0D, 0.0D); - } - } - } - @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9){ if(!world.isRemote){ diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java index 28de5ee7d..0ec048cbf 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java @@ -59,6 +59,7 @@ public class GuiBooklet extends GuiScreen{ public GuiButton[] chapterButtons = new GuiButton[CHAPTER_BUTTONS_AMOUNT]; private GuiTextField searchField; private int ticksElapsed; + private boolean mousePressed; private GuiScreen parentScreen; @@ -103,7 +104,7 @@ public class GuiBooklet extends GuiScreen{ if(this.currentIndexEntry != null){ if(this.currentChapter != null && this.currentPage != null){ this.drawCenteredString(this.fontRendererObj, this.currentPage.getID()+"/"+this.currentChapter.pages.length, this.guiLeft+this.xSize/2, this.guiTop+172, StringUtil.DECIMAL_COLOR_WHITE); - this.currentPage.renderPre(this, x, y, this.ticksElapsed); + this.currentPage.renderPre(this, x, y, this.ticksElapsed, this.mousePressed); } else{ this.drawCenteredString(this.fontRendererObj, this.pageOpenInIndex+"/"+this.indexPageAmount, this.guiLeft+this.xSize/2, this.guiTop+172, StringUtil.DECIMAL_COLOR_WHITE); @@ -126,7 +127,7 @@ public class GuiBooklet extends GuiScreen{ this.searchField.drawTextBox(); if(this.currentIndexEntry != null && this.currentChapter != null && this.currentPage != null){ - this.currentPage.render(this, x, y, this.ticksElapsed); + this.currentPage.render(this, x, y, this.ticksElapsed, this.mousePressed); } this.fontRendererObj.setUnicodeFlag(false); @@ -163,6 +164,10 @@ public class GuiBooklet extends GuiScreen{ } this.fontRendererObj.setUnicodeFlag(unicodeBefore); + + if(this.mousePressed){ + this.mousePressed = false; + } } @SuppressWarnings("unchecked") @@ -196,6 +201,11 @@ public class GuiBooklet extends GuiScreen{ @Override protected void mouseClicked(int par1, int par2, int par3){ this.searchField.mouseClicked(par1, par2, par3); + + if(par3 == 0){ + this.mousePressed = true; + } + super.mouseClicked(par1, par2, par3); } diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java index cd7ec7cd5..0338bb85d 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java @@ -85,7 +85,7 @@ public class InitBooklet{ new BookletChapter("solarPanel", entryGeneratingRF, new ItemStack(InitBlocks.blockFurnaceSolar), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.FURNACE_SOLAR_ENERGY_PRODUCED.getValue()), new PageCrafting(2, BlockCrafting.recipeSolar).setNoText()); new BookletChapter("heatCollector", entryGeneratingRF, new ItemStack(InitBlocks.blockHeatCollector), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.HEAT_COLLECTOR_ENERGY_PRODUCED.getValue()).addTextReplacement("", ConfigIntValues.HEAT_COLLECTOR_BLOCKS.getValue()), new PageCrafting(2, BlockCrafting.recipeHeatCollector).setNoText()); new BookletChapter("canola", entryGeneratingRF, new ItemStack(InitBlocks.blockFermentingBarrel), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.CANOLA.ordinal())).addTextReplacement("", ConfigIntValues.PRESS_ENERGY_USED.getValue()).addTextReplacement("", ConfigIntValues.PRESS_MB_PRODUCED.getValue()).addTextReplacement("", ConfigIntValues.OIL_GEN_ENERGY_PRODUCED.getValue()), new PageCrafting(2, BlockCrafting.recipeCanolaPress).setNoText(), new PageCrafting(3, BlockCrafting.recipeFermentingBarrel).setNoText(), new PageCrafting(4, BlockCrafting.recipeOilGen).setNoText()); - new BookletChapter("leafGen", entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_ENERGY_PRODUCED.getValue()), new PageCrafting(2, BlockCrafting.recipeLeafGen)); + new BookletChapter("leafGen", entryGeneratingRF, new ItemStack(InitBlocks.blockLeafGenerator), new PageTextOnly(1).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_ENERGY_PRODUCED.getValue()).addTextReplacement("", ConfigIntValues.LEAF_GENERATOR_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeLeafGen)); //No RF Using Items new BookletChapter("wings", entryItemsNonRF, new ItemStack(InitItems.itemWingsOfTheBats), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.BAT_WING.ordinal())), new PageCrafting(2, ItemCrafting.recipeWings).setNoText()); diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java index 54d5b92f2..e5cd65ea1 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java @@ -13,7 +13,6 @@ package ellpeck.actuallyadditions.booklet.page; import ellpeck.actuallyadditions.booklet.BookletChapter; import ellpeck.actuallyadditions.booklet.GuiBooklet; import ellpeck.actuallyadditions.booklet.InitBooklet; -import ellpeck.actuallyadditions.event.KeyStates; import ellpeck.actuallyadditions.util.ItemUtil; import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.StringUtil; @@ -96,11 +95,11 @@ public class BookletPage{ return this; } - public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ } - public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ } @@ -109,7 +108,7 @@ public class BookletPage{ } @SuppressWarnings("unchecked") - protected void renderTooltipAndTransfer(GuiBooklet gui, ItemStack stack, int x, int y, boolean checkAndTransfer){ + protected void renderTooltipAndTransfer(GuiBooklet gui, ItemStack stack, int x, int y, boolean checkAndTransfer, boolean mousePressed){ boolean flagBefore = gui.mc.fontRenderer.getUnicodeFlag(); gui.mc.fontRenderer.setUnicodeFlag(false); @@ -129,7 +128,7 @@ public class BookletPage{ if(ItemUtil.contains(page.getItemStacksForPage(), stack, true)){ list.add(EnumChatFormatting.GOLD+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".clickToSeeRecipe")); - if(KeyStates.mouseButtonState.checkPressed(true)){ + if(mousePressed){ gui.openIndexEntry(page.getChapter().entry, InitBooklet.entries.indexOf(page.getChapter().entry)/GuiBooklet.CHAPTER_BUTTONS_AMOUNT+1, true); gui.openChapter(page.getChapter(), page); Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCoffeeRecipe.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCoffeeRecipe.java index 58be6d7a9..cbe9c1b99 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCoffeeRecipe.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCoffeeRecipe.java @@ -27,14 +27,14 @@ public class PageCoffeeRecipe extends BookletPage{ } @Override - public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ gui.mc.getTextureManager().bindTexture(GuiBooklet.resLoc); gui.drawTexturedModalRect(gui.guiLeft+19, gui.guiTop+20, 146, 94, 99, 60); } @SuppressWarnings("unchecked") @Override - public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ String strg = "Coffee Machine Recipe"; gui.mc.fontRenderer.drawString(strg, gui.guiLeft+gui.xSize/2-gui.mc.fontRenderer.getStringWidth(strg)/2, gui.guiTop+10, 0); @@ -91,7 +91,7 @@ public class PageCoffeeRecipe extends BookletPage{ } else{ if(mouseX >= xShow && mouseX <= xShow+16 && mouseY >= yShow && mouseY <= yShow+16){ - this.renderTooltipAndTransfer(gui, stack, mouseX, mouseY, j != 2); + this.renderTooltipAndTransfer(gui, stack, mouseX, mouseY, j != 2, mousePressed); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java index b67353d71..72ebc00fa 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java @@ -43,7 +43,7 @@ public class PageCrafting extends BookletPage{ } @Override - public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(this.recipes[this.recipePos] != null){ gui.mc.getTextureManager().bindTexture(GuiBooklet.resLoc); gui.drawTexturedModalRect(gui.guiLeft+27, gui.guiTop+20, 146, 20, 99, 60); @@ -52,7 +52,7 @@ public class PageCrafting extends BookletPage{ @SuppressWarnings("unchecked") @Override - public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ IRecipe recipe = this.recipes[this.recipePos]; if(recipe == null){ @@ -124,7 +124,7 @@ public class PageCrafting extends BookletPage{ } else{ if(mouseX >= xShow && mouseX <= xShow+16 && mouseY >= yShow && mouseY <= yShow+16){ - this.renderTooltipAndTransfer(gui, stack, mouseX, mouseY, true); + this.renderTooltipAndTransfer(gui, stack, mouseX, mouseY, true, mousePressed); } } } @@ -132,7 +132,7 @@ public class PageCrafting extends BookletPage{ } } if(mouseX >= xShowOutput && mouseX <= xShowOutput+16 && mouseY >= yShowOutput && mouseY <= yShowOutput+16){ - this.renderTooltipAndTransfer(gui, recipe.getRecipeOutput(), mouseX, mouseY, false); + this.renderTooltipAndTransfer(gui, recipe.getRecipeOutput(), mouseX, mouseY, false, mousePressed); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrusherRecipe.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrusherRecipe.java index fd7df82a0..4a1bbf1ed 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrusherRecipe.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrusherRecipe.java @@ -37,7 +37,7 @@ public class PageCrusherRecipe extends BookletPage{ } @Override - public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(recipe != null){ gui.mc.getTextureManager().bindTexture(GuiBooklet.resLoc); gui.drawTexturedModalRect(gui.guiLeft+37, gui.guiTop+20, 60, 180, 60, 60); @@ -46,7 +46,7 @@ public class PageCrusherRecipe extends BookletPage{ @SuppressWarnings("unchecked") @Override - public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(recipe == null){ gui.mc.fontRenderer.drawSplitString(EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.guiLeft+14, gui.guiTop+15, 115, 0); } @@ -96,7 +96,7 @@ public class PageCrusherRecipe extends BookletPage{ } else{ if(mouseX >= xShow && mouseX <= xShow+16 && mouseY >= yShow && mouseY <= yShow+16){ - this.renderTooltipAndTransfer(gui, stack, mouseX, mouseY, j == 0); + this.renderTooltipAndTransfer(gui, stack, mouseX, mouseY, j == 0, mousePressed); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java index 97f31fa43..213ca5c81 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java @@ -38,7 +38,7 @@ public class PageFurnace extends BookletPage{ } @Override - public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ if(this.input != null || this.getInputForOutput(this.result) != null){ gui.mc.getTextureManager().bindTexture(GuiBooklet.resLoc); gui.drawTexturedModalRect(gui.guiLeft+37, gui.guiTop+20, 0, 180, 60, 60); @@ -47,7 +47,7 @@ public class PageFurnace extends BookletPage{ @SuppressWarnings("unchecked") @Override - public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void render(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ ItemStack input = this.input != null ? this.input : this.getInputForOutput(this.result); if(input == null){ gui.mc.fontRenderer.drawSplitString(EnumChatFormatting.DARK_RED+StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".recipeDisabled"), gui.guiLeft+14, gui.guiTop+15, 115, 0); @@ -78,7 +78,7 @@ public class PageFurnace extends BookletPage{ } else{ if(mouseX >= xShow && mouseX <= xShow+16 && mouseY >= yShow && mouseY <= yShow+16){ - this.renderTooltipAndTransfer(gui, stack, mouseX, mouseY, x == 0); + this.renderTooltipAndTransfer(gui, stack, mouseX, mouseY, x == 0, mousePressed); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageTextOnly.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageTextOnly.java index 76a65b914..7c30d94fb 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageTextOnly.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageTextOnly.java @@ -31,7 +31,7 @@ public class PageTextOnly extends BookletPage{ } @Override - public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed){ + public void renderPre(GuiBooklet gui, int mouseX, int mouseY, int ticksElapsed, boolean mousePressed){ String text = gui.currentPage.getText(); if(text != null && !text.isEmpty()){ gui.mc.fontRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+9, 115, 0); diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index 4bbca2832..78a9741f8 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -164,7 +164,7 @@ public enum ConfigIntValues{ LEAF_GENERATOR_ENERGY_PRODUCED("Leaf Generator: Energy Produce", ConfigCategories.MACHINE_VALUES, 40, 1, 10000, "How much Energy the Leaf Generator produces per Leaf broken"), LEAF_GENERATOR_COOLDOWN_TIME("Leaf Generator: Cooldown Time", ConfigCategories.MACHINE_VALUES, 5, 0, 100, "The amount of ticks that it takes util another Leaf gets proken"), - LEAF_GENERATOR_RANGE("Leaf Generator: Range", ConfigCategories.MACHINE_VALUES, 5, 1, 100, "The radius of a leaf generator"); + LEAF_GENERATOR_RANGE("Leaf Generator: Range", ConfigCategories.MACHINE_VALUES, 7, 1, 100, "The radius of a leaf generator"); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java b/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java index 15d35e753..36469c573 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java +++ b/src/main/java/ellpeck/actuallyadditions/event/InitEvents.java @@ -37,7 +37,6 @@ public class InitEvents{ public static void initClient(){ Util.registerEvent(new TooltipEvent()); Util.registerEvent(new RenderPlayerEventAA()); - Util.registerEvent(new KeyStates()); if(Loader.isModLoaded("NotEnoughItems")){ Util.registerEvent(new NeiScreenEvents()); diff --git a/src/main/java/ellpeck/actuallyadditions/event/KeyStates.java b/src/main/java/ellpeck/actuallyadditions/event/KeyStates.java deleted file mode 100644 index 523977f36..000000000 --- a/src/main/java/ellpeck/actuallyadditions/event/KeyStates.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file ("KeyStates.java") is part of the Actually Additions Mod for Minecraft. - * It is created and owned by Ellpeck and distributed - * under the Actually Additions License to be found at - * http://github.com/Ellpeck/ActuallyAdditions/blob/master/README.md - * View the source code at https://github.com/Ellpeck/ActuallyAdditions - * - * © 2015 Ellpeck - */ - -package ellpeck.actuallyadditions.event; - -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import ellpeck.actuallyadditions.util.KeyBinds; -import org.lwjgl.input.Keyboard; -import org.lwjgl.input.Mouse; - -public class KeyStates{ - - public static KeyState mouseButtonState = new KeyState(); - public static KeyState infoButtonState = new KeyState(); - - @SubscribeEvent - public void onClientTick(TickEvent.ClientTickEvent event){ - if(event.phase != TickEvent.Phase.END){ - mouseButtonState.tick(Mouse.isButtonDown(0)); - infoButtonState.tick(Keyboard.isKeyDown(KeyBinds.keybindOpenBooklet.getKeyCode())); - } - } - - public static class KeyState{ - - private boolean pressed; - private boolean pressedLastTime; - - public void tick(boolean pressed){ - this.pressed = pressed && !this.pressedLastTime; - this.pressedLastTime = pressed; - } - - public boolean checkPressed(boolean shouldUnpress){ - boolean isPressed = this.pressed; - if(shouldUnpress){ - this.pressed = false; - } - return isPressed; - } - } -} diff --git a/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java b/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java index 2c06c28a1..cb03ca8f3 100644 --- a/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java +++ b/src/main/java/ellpeck/actuallyadditions/event/TooltipEvent.java @@ -37,11 +37,11 @@ public class TooltipEvent{ if(event.itemStack != null && !(Minecraft.getMinecraft().currentScreen instanceof GuiBooklet)){ for(BookletPage page : InitBooklet.pagesWithItemStackData){ if(ItemUtil.contains(page.getItemStacksForPage(), event.itemStack, true)){ + int keyCode = KeyBinds.keybindOpenBooklet.getKeyCode(); if(ConfigBoolValues.SHOW_BOOKLET_INFO.isEnabled()){ - int keyCode = KeyBinds.keybindOpenBooklet.getKeyCode(); - event.toolTip.add(EnumChatFormatting.GOLD+StringUtil.localizeFormatted("booklet."+ModUtil.MOD_ID_LOWER+".keyToSeeRecipe", keyCode > 0 && keyCode < Keyboard.KEYBOARD_SIZE ? "'"+Keyboard.getKeyName(keyCode)+"'" : "[NONE]")); + event.toolTip.add(EnumChatFormatting.GOLD+StringUtil.localizeFormatted("booklet."+ModUtil.MOD_ID_LOWER+".keyToSeeRecipe", keyCode > 0 && keyCode < Keyboard.KEYBOARD_SIZE ? Keyboard.getKeyName(keyCode) : "[NONE]")); } - if(KeyStates.infoButtonState.checkPressed(true)){ + if(keyCode > 0 && keyCode < Keyboard.KEYBOARD_SIZE && Keyboard.isKeyDown(keyCode) && KeyUtil.isAltPressed()){ GuiBooklet book = new GuiBooklet(Minecraft.getMinecraft().currentScreen); Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); Minecraft.getMinecraft().displayGuiScreen(book); diff --git a/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java b/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java index 468bc161d..5c547b520 100644 --- a/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java +++ b/src/main/java/ellpeck/actuallyadditions/proxy/ClientProxy.java @@ -23,7 +23,6 @@ import ellpeck.actuallyadditions.config.values.ConfigIntValues; import ellpeck.actuallyadditions.event.InitEvents; import ellpeck.actuallyadditions.tile.*; import ellpeck.actuallyadditions.util.AssetUtil; -import ellpeck.actuallyadditions.util.KeyBinds; import ellpeck.actuallyadditions.util.ModUtil; import ellpeck.actuallyadditions.util.playerdata.PersistentClientData; import net.minecraft.client.Minecraft; @@ -41,8 +40,6 @@ public class ClientProxy implements IProxy{ ModUtil.LOGGER.info("PreInitializing ClientProxy..."); PersistentClientData.setTheFile(new File(Minecraft.getMinecraft().mcDataDir, ModUtil.MOD_ID+"Data.dat")); - - KeyBinds.init(); } @Override diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 5a51bfae0..a73131abd 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -404,7 +404,7 @@ booklet.actuallyadditions.indexEntry.itemsRF.name=Items that use RF #Booklet Info booklet.actuallyadditions.recipeDisabled=The crafting recipe for this item is disabled in the Config File! If you're on a server, ask the server author to enable it in the config. If you're on a client, press the 'Open Config'-Button on the top right and enable the recipe! booklet.actuallyadditions.clickToSeeRecipe=Click to see more Information -booklet.actuallyadditions.keyToSeeRecipe=Press %s to see more Information +booklet.actuallyadditions.keyToSeeRecipe=Press ALT+%s to see more Information #Booklet Chapters booklet.actuallyadditions.chapter.intro.name=An Introduction to ActAdd @@ -542,5 +542,5 @@ booklet.actuallyadditions.chapter.batteries.name=Batteries booklet.actuallyadditions.chapter.batteries.text.1=Batteries are a good way to store RF to move around. They can be charged in an Energizer and discharged in an Enervator. booklet.actuallyadditions.chapter.leafGen.name=Leaf-Eating Generator -booklet.actuallyadditions.chapter.leafGen.text.1=The Leaf Generator can generate RF just by being placed alongside some Leaves. It will destroy the leaves, generating RF per leaf broken in the process. By right-clicking the generator, you can see how much RF it has stored. +booklet.actuallyadditions.chapter.leafGen.text.1=The Leaf Generator can generate RF just by being placed alongside some Leaves. It will destroy the leaves, generating RF per leaf broken in the process. By right-clicking the generator, you can see how much RF it has stored. It has a range of blocks. booklet.actuallyadditions.chapter.leafGen.text.2=Munchy \ No newline at end of file