Reconstructor Crafting, Documentation & Recipe Handler for Booklet

This commit is contained in:
Ellpeck 2015-11-15 15:15:32 +01:00
parent d31eb68128
commit 717aa87566
10 changed files with 181 additions and 7 deletions

View file

@ -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("<power>", 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("<lowest>", ConfigIntValues.BLACK_QUARTZ_MIN_HEIGHT.getValue()).addTextReplacement("<highest>", 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());

View file

@ -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<BookletPage> allPages = new ArrayList<BookletPage>();
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()]);
}
}

View file

@ -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<ItemStack> stacks = OreDictionary.getOres(recipe.output);
for(ItemStack stack : stacks){
if(output.isItemEqual(stack)){
ArrayList<ItemStack> outputs = OreDictionary.getOres(recipe.input);
if(outputs != null && !outputs.isEmpty()){
return outputs.get(0);
}
}
}
}
return null;
}
}

View file

@ -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;

View file

@ -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;

View file

@ -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();
}

View file

@ -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);

View file

@ -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
@ -578,3 +580,7 @@ booklet.actuallyadditions.chapter.laserRelays.text.1=The <item>Laser Relay<r> is
booklet.actuallyadditions.chapter.blackLotus.name=Black Lotus
booklet.actuallyadditions.chapter.blackLotus.text.1=Think of this: <n>You need to craft <imp>black wool<r>, <imp>black clay<r> or anything else that <imp>needs black dye<r> but you are just guilty about killing so many <imp>innocent squids<r>? <n>Well, the <item>Black Lotus<r> is exactly the thing you need! <n>Just look around <imp>in the wild<r> a bit, and you will find one, then being able to craft some <item>Black Dye<r> that can be used <imp>instead of Ink Sacs<r> so that you don't need to kill poor squids and L any longer.
booklet.actuallyadditions.chapter.blackLotus.text.2=<i>No, not that one, Vaz
booklet.actuallyadditions.chapter.crystals.name=Crystals & At. Reconstructor
booklet.actuallyadditions.chapter.crystals.text.1=For many Crafting Operations in <imp>Actually Additions<r>, you will need <item>Crystals<r> or <item>Crystal Blocks<r>. <n>These can be made using an <item>Atomic Reconstructor<r>. Just place one down facing in any direction and it will <imp>shoot out a red laser<r>. When placing some of the blocks shown on the following pages in front of the laser, they will be <imp>converted into Crystals<r>.
booklet.actuallyadditions.chapter.crystals.text.2=The way this works is that the laser <imp>searches for a block<r>, and when it finds one, it converts <imp>all blocks and items on the ground<r> in that area into their Crystal forms (if they have one!). <n>During each conversion, it uses <imp><power> RF<r>.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB