diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java index 265361ae8..5705d0811 100644 --- a/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java +++ b/src/main/java/ellpeck/actuallyadditions/booklet/InitBooklet.java @@ -16,6 +16,7 @@ import ellpeck.actuallyadditions.blocks.metalists.TheMiscBlocks; import ellpeck.actuallyadditions.booklet.chapter.BookletChapter; import ellpeck.actuallyadditions.booklet.chapter.BookletChapterCoffee; import ellpeck.actuallyadditions.booklet.chapter.BookletChapterCrusher; +import ellpeck.actuallyadditions.booklet.chapter.BookletChapterReconstructor; import ellpeck.actuallyadditions.booklet.entry.BookletEntry; import ellpeck.actuallyadditions.booklet.entry.BookletEntryAllSearch; import ellpeck.actuallyadditions.booklet.page.*; @@ -41,19 +42,22 @@ public class InitBooklet{ public static BookletChapter chapterIntro; + public static BookletEntry entryGettingStarted = new BookletEntry("gettingStarted").setImportant(); public static BookletEntry entryFunctionalNonRF = new BookletEntry("functionalNoRF"); public static BookletEntry entryFunctionalRF = new BookletEntry("functionalRF").setSpecial(); public static BookletEntry entryGeneratingRF = new BookletEntry("generatingRF").setSpecial(); public static BookletEntry entryItemsNonRF = new BookletEntry("itemsNoRF"); public static BookletEntry entryItemsRF = new BookletEntry("itemsRF").setSpecial(); public static BookletEntry entryMisc = new BookletEntry("misc"); - public static BookletEntry allAndSearch = new BookletEntryAllSearch("allAndSearch").setImportant(); + public static BookletEntry allAndSearch = new BookletEntryAllSearch("allAndSearch").setSpecial(); private static void initChapters(){ - chapterIntro = new BookletChapter("intro", entryMisc, new ItemStack(InitItems.itemLexicon), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3), new PageCrafting(4, ItemCrafting.recipeBook)).setImportant(); + //Getting Started + chapterIntro = new BookletChapter("intro", entryGettingStarted, new ItemStack(InitItems.itemLexicon), new PageTextOnly(1), new PageTextOnly(2), new PageTextOnly(3), new PageCrafting(4, ItemCrafting.recipeBook)).setImportant(); + new BookletChapterReconstructor("crystals", entryGettingStarted, new ItemStack(InitBlocks.blockAtomicReconstructor), new PageTextOnly(1), new PageTextOnly(2).addTextReplacement("", ConfigIntValues.RECONSTRUCTOR_USE_PER_BLOCK.getValue()), new PagePicture(3, "pageAtomicReconstructor", 0).setNoText(), new PageCrafting(4, BlockCrafting.recipeAtomicReconstructor).setNoText()).setSpecial(); + new BookletChapter("craftingIngs", entryGettingStarted, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeCoil).setNoText(), new PageCrafting(3, ItemCrafting.recipeCoilAdvanced).setNoText(), new PageCrafting(4, BlockCrafting.recipeCase).setNoText(), new PageCrafting(5, BlockCrafting.recipeStoneCase).setNoText(), new PageCrafting(6, BlockCrafting.recipeEnderPearlBlock).setNoText(), new PageCrafting(7, BlockCrafting.recipeEnderCase).setNoText(), new PageCrafting(8, ItemCrafting.recipeRing).setNoText(), new PageCrafting(9, ItemCrafting.recipeKnifeHandle).setNoText(), new PageCrafting(10, ItemCrafting.recipeKnifeBlade).setNoText(), new PageCrafting(11, ItemCrafting.recipeKnife).setNoText(), new PageCrafting(12, ItemCrafting.recipeDough).setNoText(), new PageCrafting(13, ItemCrafting.recipeRiceDough).setNoText(), new PageCrafting(14, BlockCrafting.recipeIronCase).setNoText()).setImportant(); //Miscellaneous - new BookletChapter("craftingIngs", entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeCoil).setNoText(), new PageCrafting(3, ItemCrafting.recipeCoilAdvanced).setNoText(), new PageCrafting(4, BlockCrafting.recipeCase).setNoText(), new PageCrafting(5, BlockCrafting.recipeStoneCase).setNoText(), new PageCrafting(6, BlockCrafting.recipeEnderPearlBlock).setNoText(), new PageCrafting(7, BlockCrafting.recipeEnderCase).setNoText(), new PageCrafting(8, ItemCrafting.recipeRing).setNoText(), new PageCrafting(9, ItemCrafting.recipeKnifeHandle).setNoText(), new PageCrafting(10, ItemCrafting.recipeKnifeBlade).setNoText(), new PageCrafting(11, ItemCrafting.recipeKnife).setNoText(), new PageCrafting(12, ItemCrafting.recipeDough).setNoText(), new PageCrafting(13, ItemCrafting.recipeRiceDough).setNoText(), new PageCrafting(14, BlockCrafting.recipeIronCase).setNoText()).setImportant(); new BookletChapter("quartz", entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal()), new PageTextOnly(1).setStack(new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.ORE_QUARTZ.ordinal())).addTextReplacement("", ConfigIntValues.BLACK_QUARTZ_MIN_HEIGHT.getValue()).addTextReplacement("", ConfigIntValues.BLACK_QUARTZ_MAX_HEIGHT.getValue()), new PageTextOnly(2).setStack(new ItemStack(InitItems.itemMisc, 1, TheMiscItems.QUARTZ.ordinal())), new PageCrafting(3, BlockCrafting.recipeQuartzBlock).setNoText(), new PageCrafting(4, BlockCrafting.recipeQuartzPillar).setNoText(), new PageCrafting(5, BlockCrafting.recipeQuartzChiseled).setNoText()); new BookletChapter("cloud", entryMisc, new ItemStack(InitBlocks.blockSmileyCloud), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeSmileyCloud).setNoText()).setSpecial(); new BookletChapter("coalStuff", entryMisc, new ItemStack(InitItems.itemMisc, 1, TheMiscItems.TINY_COAL.ordinal()), new PageTextOnly(1), new PageCrafting(2, ItemCrafting.recipeTinyCoal).setNoText(), new PageCrafting(3, ItemCrafting.recipeTinyChar).setNoText(), new PageCrafting(4, BlockCrafting.recipeBlockChar).setNoText()); diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/chapter/BookletChapterReconstructor.java b/src/main/java/ellpeck/actuallyadditions/booklet/chapter/BookletChapterReconstructor.java new file mode 100644 index 000000000..b58c439c1 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/booklet/chapter/BookletChapterReconstructor.java @@ -0,0 +1,40 @@ +/* + * This file ("BookletChapterReconstructor.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.booklet.chapter; + +import ellpeck.actuallyadditions.booklet.entry.BookletEntry; +import ellpeck.actuallyadditions.booklet.page.BookletPage; +import ellpeck.actuallyadditions.booklet.page.PageReconstructor; +import ellpeck.actuallyadditions.recipe.AtomicReconstructorRecipeHandler; +import net.minecraft.item.ItemStack; + +import java.util.ArrayList; +import java.util.Arrays; + +public class BookletChapterReconstructor extends BookletChapter{ + + public BookletChapterReconstructor(String unlocalizedName, BookletEntry entry, ItemStack displayStack, BookletPage... pages){ + super(unlocalizedName, entry, displayStack, getPages(pages)); + } + + @SuppressWarnings("unchecked") + private static BookletPage[] getPages(BookletPage... pages){ + ArrayList allPages = new ArrayList(); + allPages.addAll(Arrays.asList(pages)); + + for(AtomicReconstructorRecipeHandler.Recipe recipe : AtomicReconstructorRecipeHandler.recipes){ + BookletPage page = new PageReconstructor(allPages.size()+1, recipe.getFirstOutput()).setNoText(); + allPages.add(page); + } + + return allPages.toArray(new BookletPage[allPages.size()]); + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/booklet/page/PageReconstructor.java b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageReconstructor.java new file mode 100644 index 000000000..b13a1ab74 --- /dev/null +++ b/src/main/java/ellpeck/actuallyadditions/booklet/page/PageReconstructor.java @@ -0,0 +1,111 @@ +/* + * This file ("PageReconstructor.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.booklet.page; + +import ellpeck.actuallyadditions.blocks.InitBlocks; +import ellpeck.actuallyadditions.booklet.GuiBooklet; +import ellpeck.actuallyadditions.proxy.ClientProxy; +import ellpeck.actuallyadditions.recipe.AtomicReconstructorRecipeHandler; +import ellpeck.actuallyadditions.util.ModUtil; +import ellpeck.actuallyadditions.util.StringUtil; +import ellpeck.actuallyadditions.util.Util; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.oredict.OreDictionary; + +import java.util.ArrayList; + +public class PageReconstructor extends BookletPage{ + + private final ItemStack result; + private final ItemStack input; + + public PageReconstructor(int id, ItemStack result){ + this(id, null, result); + } + + public PageReconstructor(int id, ItemStack input, ItemStack result){ + super(id); + this.result = result; + this.input = input; + this.addToPagesWithItemStackData(); + } + + @Override + 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(ClientProxy.bulletForMyValentine ? GuiBooklet.resLocValentine : GuiBooklet.resLoc); + gui.drawTexturedModalRect(gui.guiLeft+37, gui.guiTop+20, 188, 154, 60, 60); + } + } + + @SuppressWarnings("unchecked") + @Override + 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); + } + else{ + String strg = "Atomic Reconstructor"; + gui.mc.fontRenderer.drawString(strg, gui.guiLeft+gui.xSize/2-gui.mc.fontRenderer.getStringWidth(strg)/2, gui.guiTop+10, 0); + } + + String text = gui.currentPage.getText(); + if(text != null && !text.isEmpty()){ + gui.mc.fontRenderer.drawSplitString(text, gui.guiLeft+14, gui.guiTop+100, 115, 0); + } + + if(input != null){ + for(int i = 0; i < 2; i++){ + for(int x = 0; x < 2; x++){ + ItemStack stack = x == 0 ? input : this.result; + if(stack.getItemDamage() == Util.WILDCARD){ + stack.setItemDamage(0); + } + boolean tooltip = i == 1; + + int xShow = gui.guiLeft+37+1+x*42; + int yShow = gui.guiTop+20+21; + if(!tooltip){ + renderItem(gui, stack, xShow, yShow, 1.0F); + } + else{ + if(mouseX >= xShow && mouseX <= xShow+16 && mouseY >= yShow && mouseY <= yShow+16){ + this.renderTooltipAndTransfer(gui, stack, mouseX, mouseY, x == 0, mousePressed); + } + } + } + } + renderItem(gui, new ItemStack(InitBlocks.blockAtomicReconstructor), gui.guiLeft+37+22, gui.guiTop+20+21, 1.0F); + } + } + + @Override + public ItemStack[] getItemStacksForPage(){ + return this.result == null ? new ItemStack[0] : new ItemStack[]{this.result}; + } + + private ItemStack getInputForOutput(ItemStack output){ + for(AtomicReconstructorRecipeHandler.Recipe recipe : AtomicReconstructorRecipeHandler.recipes){ + ArrayList stacks = OreDictionary.getOres(recipe.output); + for(ItemStack stack : stacks){ + if(output.isItemEqual(stack)){ + ArrayList outputs = OreDictionary.getOres(recipe.input); + if(outputs != null && !outputs.isEmpty()){ + return outputs.get(0); + } + } + } + } + return null; + } +} diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java index 6828cd565..72219d99c 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigCrafting.java @@ -158,7 +158,8 @@ public enum ConfigCrafting{ LASER_WRENCH("Laser Wrench", ConfigCategories.ITEMS_CRAFTING), CHEST_TO_CRATE_UPGRADE("Chest To Crate Upgrade", ConfigCategories.ITEMS_CRAFTING), - DRILL_CORE("Drill Core", ConfigCategories.ITEMS_CRAFTING); + DRILL_CORE("Drill Core", ConfigCategories.ITEMS_CRAFTING), + ATOMIC_RECONSTRUCTOR("Atomic Reconstructor", ConfigCategories.BLOCKS_CRAFTING); public final String name; public final String category; diff --git a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java index c56c35566..002adfdee 100644 --- a/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java +++ b/src/main/java/ellpeck/actuallyadditions/config/values/ConfigIntValues.java @@ -180,7 +180,7 @@ public enum ConfigIntValues{ RECONSTRUCTOR_DISTANCE("Atomic Reconstructor: Distance", ConfigCategories.MACHINE_VALUES, 10, 1, 50, "The max distance the Reconstructor goes forward to find blocks to convert"), RECONSTRCUTOR_RANGE("Atomic Reconstructor: Range", ConfigCategories.MACHINE_VALUES, 2, 1, 10, "The range of Converting blocks or items into other blocks or items"), - RECONSTRUCTOR_USE_PER_BLOCK("Atomic Reconstructor: Energy Use per Block", ConfigCategories.MACHINE_VALUES, 1200, 0, 100000, "The amount of Energy the Reconstructor uses per Block converted"), + RECONSTRUCTOR_USE_PER_BLOCK("Atomic Reconstructor: Energy Use per Block", ConfigCategories.MACHINE_VALUES, 1000, 0, 100000, "The amount of Energy the Reconstructor uses per Block converted"), RECONSTRUCTOR_COOLDOWN_TIMER("Atomic Reconstrucor: Cooldown Timer", ConfigCategories.MACHINE_VALUES, 100, 0, 10000, "The amount of time the Reconstructor waits between shooting lasers"); public final String name; diff --git a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java index f0f83970d..0f593b3ba 100644 --- a/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java +++ b/src/main/java/ellpeck/actuallyadditions/crafting/BlockCrafting.java @@ -78,16 +78,27 @@ public class BlockCrafting{ public static IRecipe recipeDropper; public static IRecipe recipeRangedCollector; public static IRecipe recipeLaserRelay; + public static IRecipe recipeAtomicReconstructor; public static void init(){ + //Atomic Reconstructor + if(ConfigCrafting.ATOMIC_RECONSTRUCTOR.isEnabled()){ + GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockAtomicReconstructor), + "IRI", "RCR", "IRI", + 'R', "dustRedstone", + 'I', "ingotIron", + 'C', new ItemStack(InitBlocks.blockMisc, 1, TheMiscBlocks.IRON_CASING.ordinal()))); + recipeAtomicReconstructor = Util.GetRecipes.lastIRecipe(); + } + //Laser Relay if(ConfigCrafting.LASER_RELAY.isEnabled()){ GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockLaserRelay, 2), "OBO", "RCR", "OBO", 'B', new ItemStack(Blocks.redstone_block), 'O', new ItemStack(Blocks.obsidian), - 'R', new ItemStack(Items.redstone), + 'R', "dustRedstone", 'C', new ItemStack(InitItems.itemMisc, 1, TheMiscItems.COIL_ADVANCED.ordinal()))); recipeLaserRelay = Util.GetRecipes.lastIRecipe(); } diff --git a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java index aa0e246aa..1b836e5f1 100644 --- a/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java +++ b/src/main/java/ellpeck/actuallyadditions/creative/CreativeTab.java @@ -51,6 +51,7 @@ public class CreativeTab extends CreativeTabs{ add(InitBlocks.blockSmileyCloud); add(InitBlocks.blockLaserRelay); + add(InitBlocks.blockAtomicReconstructor); add(InitBlocks.blockPhantomface); add(InitBlocks.blockPhantomEnergyface); add(InitBlocks.blockPhantomLiquiface); diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index ab86f52d9..f6781b31c 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -114,6 +114,7 @@ tile.actuallyadditions.blockMiscIronCasing.name=Iron Casing tile.actuallyadditions.blockBlackLotus.name=Black Lotus tile.actuallyadditions.blockTestifiBucksWhiteFence.name=White TB Wall tile.actuallyadditions.blockTestifiBucksGreenFence.name=Green TB Wall +tile.actuallyadditions.blockAtomicReconstructor.name=Atomic Reconstructor #ESD tile.actuallyadditions.blockInputter.name=ESD @@ -402,6 +403,7 @@ booklet.actuallyadditions.shapelessOreRecipe=Shapeless OreDictionary Recipe booklet.actuallyadditions.shapedOreRecipe=Shaped OreDictionary Recipe #Booklet Entries +booklet.actuallyadditions.indexEntry.gettingStarted.name=Getting Started booklet.actuallyadditions.indexEntry.misc.name=Miscellaneous booklet.actuallyadditions.indexEntry.functionalNoRF.name=Blocks that don't use RF booklet.actuallyadditions.indexEntry.allAndSearch.name=All Items and Search @@ -577,4 +579,8 @@ booklet.actuallyadditions.chapter.laserRelays.text.1=The Laser Relay is booklet.actuallyadditions.chapter.blackLotus.name=Black Lotus booklet.actuallyadditions.chapter.blackLotus.text.1=Think of this: You need to craft black wool, black clay or anything else that needs black dye but you are just guilty about killing so many innocent squids? Well, the Black Lotus is exactly the thing you need! Just look around in the wild a bit, and you will find one, then being able to craft some Black Dye that can be used instead of Ink Sacs so that you don't need to kill poor squids and L any longer. -booklet.actuallyadditions.chapter.blackLotus.text.2=No, not that one, Vaz \ No newline at end of file +booklet.actuallyadditions.chapter.blackLotus.text.2=No, not that one, Vaz + +booklet.actuallyadditions.chapter.crystals.name=Crystals & At. Reconstructor +booklet.actuallyadditions.chapter.crystals.text.1=For many Crafting Operations in Actually Additions, you will need Crystals or Crystal Blocks. These can be made using an Atomic Reconstructor. Just place one down facing in any direction and it will shoot out a red laser. When placing some of the blocks shown on the following pages in front of the laser, they will be converted into Crystals. +booklet.actuallyadditions.chapter.crystals.text.2=The way this works is that the laser searches for a block, and when it finds one, it converts all blocks and items on the ground in that area into their Crystal forms (if they have one!). During each conversion, it uses RF. \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/booklet/guiBooklet.png b/src/main/resources/assets/actuallyadditions/textures/gui/booklet/guiBooklet.png index c76d273e8..9a9378711 100644 Binary files a/src/main/resources/assets/actuallyadditions/textures/gui/booklet/guiBooklet.png and b/src/main/resources/assets/actuallyadditions/textures/gui/booklet/guiBooklet.png differ diff --git a/src/main/resources/assets/actuallyadditions/textures/gui/booklet/pageAtomicReconstructor.png b/src/main/resources/assets/actuallyadditions/textures/gui/booklet/pageAtomicReconstructor.png new file mode 100644 index 000000000..94869530a Binary files /dev/null and b/src/main/resources/assets/actuallyadditions/textures/gui/booklet/pageAtomicReconstructor.png differ