From 7713b8bbb22aa28edfefdba6352677437c7efc97 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Mon, 31 Aug 2015 05:44:09 +0200 Subject: [PATCH] Made lots of pages. --- .../actuallyadditions/booklet/GuiBooklet.java | 4 +-- .../booklet/InitBooklet.java | 6 ++++ .../booklet/page/BookletPage.java | 2 +- .../booklet/page/PageCrafting.java | 2 +- .../booklet/page/PageCrusherRecipe.java | 2 +- .../booklet/page/PageFurnace.java | 2 +- .../booklet/page/PageText.java | 21 +++++++++++-- .../crafting/BlockCrafting.java | 16 +++++++++- .../assets/actuallyadditions/lang/en_US.lang | 30 +++++++++++++++++-- 9 files changed, 74 insertions(+), 11 deletions(-) diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java index 792be22fd..ba2336c8e 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/GuiBooklet.java @@ -63,7 +63,7 @@ public class GuiBooklet extends GuiScreen{ private static final int BUTTON_RETURN_ID = 2; private static final int CHAPTER_BUTTONS_START = 3; - private static final int BUTTONS_PER_PAGE = 15; + private static final int BUTTONS_PER_PAGE = 13; private boolean mouseClicked; @@ -133,7 +133,7 @@ public class GuiBooklet extends GuiScreen{ this.buttonList.add(new TexturedButton(BUTTON_RETURN_ID, this.guiLeft+this.xSize/2-7, this.guiTop+this.ySize+2, 182, 0, 15, 10)); for(int i = 0; i < BUTTONS_PER_PAGE; i++){ - this.buttonList.add(new IndexButton(this.unicodeRenderer, CHAPTER_BUTTONS_START+i, guiLeft+13, guiTop+15+(i*11), 120, 10, "")); + this.buttonList.add(new IndexButton(this.unicodeRenderer, CHAPTER_BUTTONS_START+i, guiLeft+15, guiTop+10+(i*12), 120, 10, "")); } this.buttonList.add(new TexturedButton(BUTTON_ACHIEVEMENTS_ID, this.guiLeft+138, this.guiTop, 205, 0, 8, 8)); diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java index 3a3fbbcd0..6dff3f539 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java @@ -19,6 +19,7 @@ import ellpeck.actuallyadditions.crafting.FoodCrafting; import ellpeck.actuallyadditions.crafting.ItemCrafting; import ellpeck.actuallyadditions.items.InitItems; import ellpeck.actuallyadditions.items.metalists.TheFoods; +import ellpeck.actuallyadditions.items.metalists.TheSpecialDrops; import net.minecraft.item.ItemStack; import java.util.ArrayList; @@ -42,10 +43,15 @@ public class InitBooklet{ new BookletChapter("phantomfaces", entryFunctionalNonRF, new PageText(1), new PageCrafting(2, BlockCrafting.recipePhantomface), new PageCrafting(3, BlockCrafting.recipeLiquiface), new PageCrafting(4, BlockCrafting.recipeEnergyface), new PageCrafting(5, ItemCrafting.recipePhantomConnector), new PageCrafting(6, BlockCrafting.recipePhantomBooster)); new BookletChapter("phantomBreaker", entryFunctionalNonRF, new PageText(1), new PageCrafting(2, BlockCrafting.recipePhantomPlacer), new PageCrafting(3, BlockCrafting.recipePhantomBreaker)); new BookletChapter("esd", entryFunctionalNonRF, new PageText(1), new PageCrafting(2, BlockCrafting.recipeESD), new PageCrafting(3, BlockCrafting.recipeAdvancedESD)); + new BookletChapter("xpSolidifier", entryFunctionalNonRF, new PageText(1).setStack(new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.SOLIDIFIED_EXPERIENCE.ordinal())), new PageCrafting(2, BlockCrafting.recipeSolidifier)); + new BookletChapter("greenhouseGlass", entryFunctionalNonRF, new PageText(1), new PageCrafting(2, BlockCrafting.recipeGlass)); new BookletChapter("coffeeMachine", entryFunctionalRF, new PageText(1), new PageText(2), new PageText(3), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine)); new BookletChapterCrusher("crusher", entryFunctionalRF, new PageText(1), new PageCrafting(2, BlockCrafting.recipeCrusher), new PageCrafting(3, BlockCrafting.recipeDoubleCrusher)); new BookletChapterFurnace("furnaceDouble", entryFunctionalRF, new PageCrafting(1, BlockCrafting.recipeFurnace)); + new BookletChapter("miner", entryFunctionalRF, new PageText(1), new PageCrafting(2, BlockCrafting.recipeMiner), new PageCrafting(3, BlockCrafting.recipeCasing)); + new BookletChapter("lavaFactory", entryFunctionalRF, new PageText(1), new PageCrafting(2, BlockCrafting.recipeLavaFactory)); + new BookletChapter("energizer", entryFunctionalRF, new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator)); new BookletChapter("craftingIngs", entryMisc, new PageText(1), new PageCrafting(2, ItemCrafting.recipeCoil), new PageCrafting(3, ItemCrafting.recipeCoilAdvanced), new PageCrafting(4, BlockCrafting.recipeCase), new PageCrafting(5, BlockCrafting.recipeStoneCase), new PageCrafting(6, BlockCrafting.recipeEnderPearlBlock), new PageCrafting(7, BlockCrafting.recipeEnderCase)); new BookletChapter("cloud", entryMisc, new PageText(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud)); diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java index 177702c48..8c03d7139 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/BookletPage.java @@ -53,7 +53,7 @@ public class BookletPage implements IBookletPage{ @Override public String getText(){ - return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".chapter."+this.chapter.getUnlocalizedName()+".text."+this.id).replaceAll("", EnumChatFormatting.DARK_GREEN+"").replaceAll("", EnumChatFormatting.BLUE+"").replaceAll("", EnumChatFormatting.BLACK+""); + return StringUtil.localize("booklet."+ModUtil.MOD_ID_LOWER+".chapter."+this.chapter.getUnlocalizedName()+".text."+this.id).replaceAll("", EnumChatFormatting.DARK_GREEN+"").replaceAll("", EnumChatFormatting.BLUE+"").replaceAll("", EnumChatFormatting.BLACK+"").replaceAll("", "\n").replaceAll("", EnumChatFormatting.ITALIC+"").replaceAll("", EnumChatFormatting.RESET+""); } @Override diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java index 50107603f..b265091f8 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrafting.java @@ -57,7 +57,7 @@ public class PageCrafting extends BookletPage{ String text = gui.currentPage.getText(); if(text != null && !text.isEmpty() && !text.contains("booklet.")){ - gui.unicodeRenderer.drawSplitString(text.replace("", "\n"), gui.guiLeft+14, gui.guiTop+100, 115, 0); + gui.unicodeRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+100, 115, 0); } if(this.recipe != null){ diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrusherRecipe.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrusherRecipe.java index 183455fbc..41c1cabd6 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrusherRecipe.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageCrusherRecipe.java @@ -50,7 +50,7 @@ public class PageCrusherRecipe extends BookletPage{ String text = gui.currentPage.getText(); if(text != null && !text.isEmpty() && !text.contains("booklet.")){ - gui.unicodeRenderer.drawSplitString(text.replace("", "\n"), gui.guiLeft+14, gui.guiTop+100, 115, 0); + gui.unicodeRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+100, 115, 0); } if(recipe.secondChance > 0){ diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java index 75b2f1cc4..d170d8553 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageFurnace.java @@ -58,7 +58,7 @@ public class PageFurnace extends BookletPage{ String text = gui.currentPage.getText(); if(text != null && !text.isEmpty() && !text.contains("booklet.")){ - gui.unicodeRenderer.drawSplitString(text.replace("", "\n"), gui.guiLeft+14, gui.guiTop+100, 115, 0); + gui.unicodeRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+100, 115, 0); } if(input != null){ diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageText.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageText.java index 500976e01..33ea06a6d 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageText.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageText.java @@ -11,18 +11,35 @@ package ellpeck.actuallyadditions.booklet.page; import ellpeck.actuallyadditions.booklet.GuiBooklet; +import ellpeck.actuallyadditions.booklet.InitBooklet; +import net.minecraft.item.ItemStack; public class PageText extends BookletPage{ + private ItemStack stack; + public PageText(int id){ super(id); } + public PageText setStack(ItemStack stack){ + if(!InitBooklet.pagesWithItemStackData.contains(this)){ + InitBooklet.pagesWithItemStackData.add(this); + } + this.stack = stack; + return this; + } + @Override - public void render(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick){ + public ItemStack getItemStackForPage(){ + return this.stack; + } + + @Override + public void renderPre(GuiBooklet gui, int mouseX, int mouseY, boolean mouseClick){ String text = gui.currentPage.getText(); if(text != null && !text.isEmpty() && !text.contains("booklet.")){ - gui.unicodeRenderer.drawSplitString(text.replace("", "\n"), gui.guiLeft+14, gui.guiTop+11, 115, 0); + gui.unicodeRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+11, 115, 0); } } } diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java index b8170276a..9ad4869dd 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java @@ -49,6 +49,13 @@ public class BlockCrafting{ public static IRecipe recipeCrusher; public static IRecipe recipeDoubleCrusher; public static IRecipe recipeFurnace; + public static IRecipe recipeSolidifier; + public static IRecipe recipeMiner; + public static IRecipe recipeCasing; + public static IRecipe recipeGlass; + public static IRecipe recipeLavaFactory; + public static IRecipe recipeEnergizer; + public static IRecipe recipeEnervator; public static void init(){ @@ -76,6 +83,7 @@ public class BlockCrafting{ 'X', new ItemStack(InitItems.itemSpecialDrop, 1, TheSpecialDrops.SOLIDIFIED_EXPERIENCE.ordinal()), 'D', "blockDiamond", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); + recipeSolidifier = Util.lastIRecipe(); } //Charcoal Block @@ -132,15 +140,17 @@ public class BlockCrafting{ 'I', "ingotIron", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.STONE_CASING.ordinal()))); + recipeEnergizer = Util.lastIRecipe(); } - //Energizer + //Enervator if(ConfigCrafting.ENERVATOR.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockEnervator), " I ", "CAC", " I ", 'I', "ingotIron", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'A', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.STONE_CASING.ordinal()))); + recipeEnervator = Util.lastIRecipe(); } //Lava Factory @@ -151,6 +161,7 @@ public class BlockCrafting{ 'S', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()), 'I', "blockIron", 'L', Items.lava_bucket)); + recipeLavaFactory = Util.lastIRecipe(); } //Casing @@ -159,6 +170,7 @@ public class BlockCrafting{ "ICI", 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.STONE_CASING.ordinal()), 'I', "blockIron")); + recipeCasing = Util.lastIRecipe(); } //Canola Press @@ -179,6 +191,7 @@ public class BlockCrafting{ 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.STONE_CASING.ordinal()), 'B', new ItemStack(InitItems.itemBatteryDouble), 'I', new ItemStack(Blocks.iron_block))); + recipeMiner = Util.lastIRecipe(); } //Fermenting Barrel @@ -425,6 +438,7 @@ public class BlockCrafting{ 'G', "blockGlass", 'D', Blocks.obsidian, 'S', "treeSapling")); + recipeGlass = Util.lastIRecipe(); } //Placer diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index ca63e7230..43ae5263f 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -370,7 +370,7 @@ booklet.actuallyadditions.indexEntry.allAndSearch.name=All Items and Search booklet.actuallyadditions.indexEntry.functionalRF.name=Functional Blocks (Use RF) 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 Recipe +booklet.actuallyadditions.clickToSeeRecipe=Click to see more Information booklet.actuallyadditions.chapter.foods.name=Food booklet.actuallyadditions.chapter.cloud.name=Smiley Cloud @@ -419,4 +419,30 @@ booklet.actuallyadditions.chapter.crusher.name=Crushers booklet.actuallyadditions.chapter.crusher.text.1=The Crusher is a machine that uses RF to double ores, meaning when you put in any ore block, it gets broken down to two dust items which can be smelted in a furnace afterwards. See all of the recipes on the following pages. booklet.actuallyadditions.chapter.furnaceDouble.name=Double Furnace -booklet.actuallyadditions.chapter.furnaceDouble.text.1=The Double Furnace is a block that works exactly like a furnace, but it can smelt two items at a time and uses RF to work. See all of the recipes on the following pages. \ No newline at end of file +booklet.actuallyadditions.chapter.furnaceDouble.text.1=The Double Furnace is a block that works exactly like a furnace, but it can smelt two items at a time and uses RF to work. See all of the recipes on the following pages. + +booklet.actuallyadditions.chapter.xpSolidifier.name=Experience Solidifier +booklet.actuallyadditions.chapter.xpSolidifier.text.1=The Experience Solidifier can be used to turn your Experience into Solidified Experience-Items that can then either be stored or used again by right-clicking to get the XP you spent for them back. Solidified Experience also gets dropped from mobs sometimes!An easy way to store your XP! +booklet.actuallyadditions.chapter.xpSolidifier.text.2=Block of knowledge + +booklet.actuallyadditions.chapter.miner.name=Magnetic Miner +booklet.actuallyadditions.chapter.miner.text.1=The Magnetic Miner is a block that automatically digs ores out of the ground, supplied a bit of RF and some Oil, and places them on top of Casing Blocks that you need to put down one block below it in the area in places where you want ores to be mined. The ores you get will then be stacked up on top of the casings. +booklet.actuallyadditions.chapter.miner.text.2=Magnet Ore +booklet.actuallyadditions.chapter.miner.text.3=These blocks need to be placed one block lower than the miner is around it where ores should be stacked up. + +booklet.actuallyadditions.chapter.greenhouseGlass.name=Greenhouse Glass +booklet.actuallyadditions.chapter.greenhouseGlass.text.1=Greenhouse Glass can be used to make the growth of plants a lot faster. When placed above a plant, it, and this is tech talk right here, ticks the plant much more often, causing it to grow much faster. It doesn't have a set range on the vertical axis, so you could place the glass really high above the plants to grow.The Item version of this is the Ring Of Growth. +booklet.actuallyadditions.chapter.greenhouseGlass.text.2=Growing Glass. + +booklet.actuallyadditions.chapter.lavaFactory.name=Lava Factory +booklet.actuallyadditions.chapter.lavaFactory.text.1=The Lava Factory is a block that automatically generates lava if supplied with enough RF. Before it can do that, however, you need to place Casing Blocks (their entries can be found on the Magnetic Miner page!) around it in a certain way: Go one block up above the controller. That block is where the lava is going to appear. Around that block, place 4 Casing Blocks. You can check if you did it right by right-clicking the Lava Factory. +booklet.actuallyadditions.chapter.lavaFactory.text.2=Mister Lava, Lava! ..sorry. + +booklet.actuallyadditions.chapter.energizer.name=Energizers and Enervators +booklet.actuallyadditions.chapter.energizer.text.1=The Energizer will charge up Items that can hold RF. +booklet.actuallyadditions.chapter.energizer.text.2=The Enervator will enervate, meaning discharge, Items that can hold RF. + +booklet.actuallyadditions.chapter.intro.name=An Introduction to ActAdd +booklet.actuallyadditions.chapter.intro.text.1=This book, written years ago, found by the player, used to help understand the wonders of this world, finally opened, finally looked at, full of glory, full of grace, will be used to help the player along on their journey through Actually Additions. What is Actually Additions, you may ask. Actually Additions adds blocks, items, and features to make the player's experience easier, automate the world and properly do what you've always wanted to do. +booklet.actuallyadditions.chapter.intro.text.2=This book, written by Ellpeck, the author of everything Actually Additions contains, often called Ellopecko, Peck or Ellpack, is easy to navigate. It has an index page at the front from which you can choose criteria pages. These criteria pages contain a list of every item which is part of the criteria, and clicking on that will show precise information and the crafting recipe of the item. The page you were on previously will stay open between sessions, too! Go check it out! +booklet.actuallyadditions.chapter.intro.text.3=If you, for some reason, want to craft this book again, just take a piece of paper and a canola seed which you can find randomly generated and craft them together! \ No newline at end of file