use of blusunrize.lib.manual.IManualPage in project ImmersiveEngineering by BluSunrize.
the class GuiManual method keyTyped.
@Override
protected void keyTyped(char c, int i) throws IOException {
if (this.searchField != null && this.searchField.textboxKeyTyped(c, i)) {
String search = searchField.getText();
if (search == null || search.trim().isEmpty()) {
hasSuggestions = -1;
this.initGui();
} else {
search = search.toLowerCase(Locale.ENGLISH);
ArrayList<String> lHeaders = new ArrayList<String>();
HashMap<String, String> lSpellcheck = new HashMap<String, String>();
for (ManualEntry e : manual.manualContents.values()) {
if (manual.showEntryInList(e)) {
if (manual.formatEntryName(e.getName()).toLowerCase(Locale.ENGLISH).contains(search))
lHeaders.add(e.getName());
else
lSpellcheck.put(manual.formatEntryName(e.getName()), e.getName());
}
}
ArrayList<String> lCorrections = ManualUtils.getPrimitiveSpellingCorrections(search, lSpellcheck.keySet().toArray(new String[lSpellcheck.keySet().size()]), 4);
for (String key : lSpellcheck.keySet()) if (!lCorrections.contains(key)) {
ManualEntry e = manual.getEntry(lSpellcheck.get(key));
for (IManualPage page : e.getPages()) if (page.listForSearch(search)) {
lHeaders.add(e.getName());
break;
}
}
headers = lHeaders.toArray(new String[lHeaders.size()]);
this.buttonList.set(0, new GuiClickableList(this, 0, guiLeft + 40, guiTop + 20, 100, 148, 1f, 1, headers));
if (!lCorrections.isEmpty()) {
GuiClickableList suggestions = new GuiClickableList(this, 11, guiLeft + 180, guiTop + 138, 100, 80, 1f, -1, lCorrections.toArray(new String[0]));
if (hasSuggestions != -1)
this.buttonList.set(hasSuggestions, suggestions);
else {
hasSuggestions = this.buttonList.size();
this.buttonList.add(suggestions);
}
this.suggestionHeaders = new String[lCorrections.size()];
for (int j = 0; j < this.suggestionHeaders.length; j++) this.suggestionHeaders[j] = lSpellcheck.get(lCorrections.get(j));
} else if (hasSuggestions != -1) {
this.buttonList.remove(hasSuggestions);
hasSuggestions = -1;
}
}
} else {
super.keyTyped(c, i);
}
}
use of blusunrize.lib.manual.IManualPage in project ImmersiveEngineering by BluSunrize.
the class GuiManual method drawScreen.
@Override
public void drawScreen(int mx, int my, float f) {
manualTick++;
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
boolean uni = manual.fontRenderer.getUnicodeFlag();
manual.fontRenderer.setUnicodeFlag(true);
manual.entryRenderPre();
ManualUtils.bindTexture(texture);
this.drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (this.searchField != null) {
int l = searchField.getText() != null ? searchField.getText().length() * 6 : 0;
if (l > 20)
this.drawTexturedModalRect(guiLeft + 166, guiTop + 74, 136 + (120 - l), 238, l, 18);
if (this.hasSuggestions != -1 && this.hasSuggestions < this.buttonList.size()) {
this.drawTexturedModalRect(guiLeft + 174, guiTop + 100, 214, 212, 16, 26);
int h = ((GuiClickableList) this.buttonList.get(hasSuggestions)).getFontHeight() * Math.min(((GuiClickableList) this.buttonList.get(hasSuggestions)).perPage, ((GuiClickableList) this.buttonList.get(hasSuggestions)).entries.length);
int w = 76;
//Top Left
this.drawTexturedModalRect(guiLeft + 174, guiTop + 116, 230, 212, 16, 16);
//Bottom Left
this.drawTexturedModalRect(guiLeft + 174, guiTop + 132 + h, 230, 228, 16, 10);
//Top Right
this.drawTexturedModalRect(guiLeft + 190 + w, guiTop + 116, 246, 212, 10, 16);
//Bottom Right
this.drawTexturedModalRect(guiLeft + 190 + w, guiTop + 132 + h, 246, 228, 10, 10);
for (int hh = 0; hh < h; hh++) {
this.drawTexturedModalRect(guiLeft + 174, guiTop + 132 + hh, 230, 228, 16, 1);
for (int ww = 0; ww < w; ww++) this.drawTexturedModalRect(guiLeft + 190 + ww, guiTop + 132 + hh, 246, 228, 1, 1);
this.drawTexturedModalRect(guiLeft + 190 + w, guiTop + 132 + hh, 246, 228, 10, 1);
}
for (int ww = 0; ww < w; ww++) {
this.drawTexturedModalRect(guiLeft + 190 + ww, guiTop + 116, 246, 212, 1, 16);
this.drawTexturedModalRect(guiLeft + 190 + ww, guiTop + 132 + h, 246, 228, 1, 10);
}
}
}
if (manual.getEntry(selectedEntry) != null) {
ManualEntry entry = manual.getEntry(selectedEntry);
mx -= guiLeft;
my -= guiTop;
boolean b0 = mx > 32 && mx < 32 + 17 && my > 179 && my < 179 + 10;
boolean b1 = mx > 135 && mx < 135 + 17 && my > 179 && my < 179 + 10;
GL11.glEnable(GL11.GL_BLEND);
if (page > 0)
this.drawTexturedModalRect(guiLeft + 32, guiTop + 179, 0, 216 + (b0 ? 20 : 0), 16, 10);
if (page < entry.getPages().length - 1)
this.drawTexturedModalRect(guiLeft + 136, guiTop + 179, 0, 226 + (b1 ? 20 : 0), 16, 10);
manual.titleRenderPre();
//Title
this.drawCenteredStringScaled(manual.fontRenderer, TextFormatting.BOLD + manual.formatEntryName(entry.getName()), guiLeft + xSize / 2, guiTop + 14, manual.getTitleColour(), 1, true);
this.drawCenteredStringScaled(manual.fontRenderer, manual.formatEntrySubtext(entry.getName()), guiLeft + xSize / 2, guiTop + 22, manual.getSubTitleColour(), 1, true);
//Page Number
this.drawCenteredStringScaled(manual.fontRenderer, TextFormatting.BOLD.toString() + (page + 1), guiLeft + xSize / 2, guiTop + 183, manual.getPagenumberColour(), 1, false);
manual.titleRenderPost();
GL11.glColor3f(1, 1, 1);
IManualPage mPage = (page < 0 || page >= entry.getPages().length) ? null : entry.getPages()[page];
if (mPage != null)
mPage.renderPage(this, guiLeft + 32, guiTop + 28, mx + guiLeft, my + guiTop);
mx += guiLeft;
my += guiTop;
} else {
String title = manual.manualContents.containsKey(selectedCategory) ? manual.formatCategoryName(selectedCategory) : manual.getManualName();
manual.titleRenderPre();
this.drawCenteredStringScaled(manual.fontRenderer, TextFormatting.BOLD + title, guiLeft + xSize / 2, guiTop + 12, manual.getTitleColour(), 1, true);
manual.titleRenderPost();
}
if (this.searchField != null) {
manual.fontRenderer.setUnicodeFlag(true);
this.searchField.drawTextBox();
if (this.hasSuggestions != -1 && this.hasSuggestions < this.buttonList.size())
manual.fontRenderer.drawString("It looks like you meant:", guiLeft + 180, guiTop + 128, manual.getTextColour(), false);
}
manual.fontRenderer.setUnicodeFlag(uni);
super.drawScreen(mx, my, f);
GlStateManager.enableBlend();
manual.entryRenderPost();
}
use of blusunrize.lib.manual.IManualPage in project ImmersiveEngineering by BluSunrize.
the class ClientProxy method postInit.
@Override
public void postInit() {
ManualHelper.ieManualInstance = new IEManualInstance();
// int subVersion = 0;
// while(!(ManualHelper.ieManualInstance.formatEntryName("updateNews_"+subVersion).equals("ie.manual.entry.updateNews_"+subVersion+".name")))
// {
// ArrayList<IManualPage> pages = new ArrayList<IManualPage>();
// int i=0;
// String key;
// while(!ManualHelper.ieManualInstance.formatText(key = "updateNews_"+subVersion+""+i).equals(key) && i<5)
// {
// pages.add(new ManualPages.Text(ManualHelper.getManual(), key));
// i++;
// }
// ManualHelper.addEntry("updateNews_"+subVersion, ManualHelper.CAT_UPDATE, pages.toArray(new IManualPage[pages.size()]));
// subVersion++;
// }
List<ItemStack> tempItemList;
List<PositionedItemStack[]> tempRecipeList;
List<IManualPage> pages;
addChangelogToManual();
ManualHelper.addEntry("introduction", ManualHelper.CAT_GENERAL, new ManualPages.Text(ManualHelper.getManual(), "introduction0"), new ManualPages.Text(ManualHelper.getManual(), "introduction1"), new ManualPages.Crafting(ManualHelper.getManual(), "introductionHammer", new ItemStack(IEContent.itemTool, 1, 0)));
ManualHelper.addEntry("ores", ManualHelper.CAT_GENERAL, new ManualPages.ItemDisplay(ManualHelper.getManual(), "oresCopper", new ItemStack(IEContent.blockOre, 1, 0), new ItemStack(IEContent.itemMetal, 1, 0)), new ManualPages.ItemDisplay(ManualHelper.getManual(), "oresBauxite", new ItemStack(IEContent.blockOre, 1, 1), new ItemStack(IEContent.itemMetal, 1, 1)), new ManualPages.ItemDisplay(ManualHelper.getManual(), "oresLead", new ItemStack(IEContent.blockOre, 1, 2), new ItemStack(IEContent.itemMetal, 1, 2)), new ManualPages.ItemDisplay(ManualHelper.getManual(), "oresSilver", new ItemStack(IEContent.blockOre, 1, 3), new ItemStack(IEContent.itemMetal, 1, 3)), new ManualPages.ItemDisplay(ManualHelper.getManual(), "oresNickel", new ItemStack(IEContent.blockOre, 1, 4), new ItemStack(IEContent.itemMetal, 1, 4)), new ManualPages.ItemDisplay(ManualHelper.getManual(), "oresUranium", new ItemStack(IEContent.blockOre, 1, 5), new ItemStack(IEContent.itemMetal, 1, 5)));
tempRecipeList = new ArrayList();
if (!IERecipes.hammerCrushingList.isEmpty()) {
for (String ore : IERecipes.hammerCrushingList) tempRecipeList.add(new PositionedItemStack[] { new PositionedItemStack(OreDictionary.getOres("ore" + ore), 24, 0), new PositionedItemStack(new ItemStack(IEContent.itemTool, 1, 0), 42, 0), new PositionedItemStack(IEApi.getPreferredOreStack("dust" + ore), 78, 0) });
if (!tempRecipeList.isEmpty())
ManualHelper.addEntry("oreProcessing", ManualHelper.CAT_GENERAL, new ManualPages.CraftingMulti(ManualHelper.getManual(), "oreProcessing0", (Object[]) tempRecipeList.toArray(new PositionedItemStack[tempRecipeList.size()][3])));
}
ManualHelper.addEntry("alloys", ManualHelper.CAT_GENERAL, new ManualPages.CraftingMulti(ManualHelper.getManual(), "alloys0", (Object[]) new PositionedItemStack[][] { new PositionedItemStack[] { new PositionedItemStack(OreDictionary.getOres("dustCopper"), 24, 0), new PositionedItemStack(OreDictionary.getOres("dustNickel"), 42, 0), new PositionedItemStack(new ItemStack(IEContent.itemMetal, 2, 15), 78, 0) }, new PositionedItemStack[] { new PositionedItemStack(OreDictionary.getOres("dustGold"), 24, 0), new PositionedItemStack(OreDictionary.getOres("dustSilver"), 42, 0), new PositionedItemStack(new ItemStack(IEContent.itemMetal, 2, 16), 78, 0) } }));
ManualHelper.addEntry("plates", ManualHelper.CAT_GENERAL, new ManualPages.CraftingMulti(ManualHelper.getManual(), "plates0", (Object[]) new PositionedItemStack[][] { new PositionedItemStack[] { new PositionedItemStack(OreDictionary.getOres("ingotIron"), 24, 0), new PositionedItemStack(new ItemStack(IEContent.itemTool, 1, 0), 42, 0), new PositionedItemStack(new ItemStack(IEContent.itemMetal, 1, 39), 78, 0) }, new PositionedItemStack[] { new PositionedItemStack(OreDictionary.getOres("ingotAluminum"), 24, 0), new PositionedItemStack(new ItemStack(IEContent.itemTool, 1, 0), 42, 0), new PositionedItemStack(new ItemStack(IEContent.itemMetal, 1, 31), 78, 0) }, new PositionedItemStack[] { new PositionedItemStack(OreDictionary.getOres("ingotLead"), 24, 0), new PositionedItemStack(new ItemStack(IEContent.itemTool, 1, 0), 42, 0), new PositionedItemStack(new ItemStack(IEContent.itemMetal, 1, 32), 78, 0) }, new PositionedItemStack[] { new PositionedItemStack(OreDictionary.getOres("ingotConstantan"), 24, 0), new PositionedItemStack(new ItemStack(IEContent.itemTool, 1, 0), 42, 0), new PositionedItemStack(new ItemStack(IEContent.itemMetal, 1, 36), 78, 0) }, new PositionedItemStack[] { new PositionedItemStack(OreDictionary.getOres("ingotSteel"), 24, 0), new PositionedItemStack(new ItemStack(IEContent.itemTool, 1, 0), 42, 0), new PositionedItemStack(new ItemStack(IEContent.itemMetal, 1, 38), 78, 0) } }));
ManualHelper.addEntry("hemp", ManualHelper.CAT_GENERAL, new ManualPages.ItemDisplay(ManualHelper.getManual(), "hemp0", new ItemStack(IEContent.blockCrop, 1, 5), new ItemStack(IEContent.itemSeeds)), new ManualPages.Crafting(ManualHelper.getManual(), "hemp1", new ItemStack(IEContent.itemMaterial, 1, 5)), new ManualPages.Crafting(ManualHelper.getManual(), "hemp2", new ItemStack(IEContent.blockClothDevice, 1, BlockTypes_ClothDevice.CUSHION.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "hemp3", new ItemStack(IEContent.blockClothDevice, 1, BlockTypes_ClothDevice.STRIPCURTAIN.getMeta())));
ManualHelper.addEntry("cokeoven", ManualHelper.CAT_GENERAL, new ManualPages.Text(ManualHelper.getManual(), "cokeoven0"), new ManualPages.Crafting(ManualHelper.getManual(), "cokeovenBlock", new ItemStack(IEContent.blockStoneDecoration, 1, BlockTypes_StoneDecoration.COKEBRICK.getMeta())), new ManualPageMultiblock(ManualHelper.getManual(), "", MultiblockCokeOven.instance));
ManualHelper.addEntry("blastfurnace", ManualHelper.CAT_GENERAL, new ManualPages.Text(ManualHelper.getManual(), "blastfurnace0"), new ManualPages.Crafting(ManualHelper.getManual(), "blastfurnaceBlock", new ItemStack(IEContent.blockStoneDecoration, 1, BlockTypes_StoneDecoration.BLASTBRICK.getMeta())), new ManualPageMultiblock(ManualHelper.getManual(), "blastfurnace1", MultiblockBlastFurnace.instance));
handleMineralManual();
ManualHelper.addEntry("graphite", ManualHelper.CAT_GENERAL, new ManualPages.Text(ManualHelper.getManual(), "graphite0"), new ManualPages.Crafting(ManualHelper.getManual(), "graphite1", ItemEngineersBlueprint.getTypedBlueprint("electrode")));
ManualHelper.addEntry("shader", ManualHelper.CAT_GENERAL, new ManualPages.Text(ManualHelper.getManual(), "shader0"), new ManualPages.Text(ManualHelper.getManual(), "shader1"), new ManualPages.ItemDisplay(ManualHelper.getManual(), "shader2"), new ManualPages.CraftingMulti(ManualHelper.getManual(), "shader2"));
ShaderRegistry.manualEntry = ManualHelper.getManual().getEntry("shader");
pages = new ArrayList<IManualPage>();
for (ShaderRegistry.ShaderRegistryEntry entry : ShaderRegistry.shaderRegistry.values()) pages.add(new ManualPageShader(ManualHelper.getManual(), entry));
ManualHelper.addEntry("shaderList", ManualHelper.CAT_GENERAL, pages.toArray(new IManualPage[pages.size()]));
ManualHelper.addEntry("treatedwood", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Crafting(ManualHelper.getManual(), "treatedwood0", new ItemStack(IEContent.blockTreatedWood, 1, 0)), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockTreatedWood, 1, 1), new ItemStack(IEContent.blockTreatedWood, 1, 2), new ItemStack(IEContent.blockTreatedWoodSlabs, 1, OreDictionary.WILDCARD_VALUE)), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockWoodenStair)), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.itemMaterial, 1, 0), new ItemStack(IEContent.blockWoodenDecoration, 1, BlockTypes_WoodenDecoration.FENCE.getMeta()), new ItemStack(IEContent.blockWoodenDecoration, 1, BlockTypes_WoodenDecoration.SCAFFOLDING.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "treatedwoodPost0", new ItemStack(IEContent.blockWoodenDevice1, 1, BlockTypes_WoodenDevice1.POST.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "treatedwoodPost1"));
ItemStack[] storageBlocks = new ItemStack[BlockTypes_MetalsIE.values().length];
ItemStack[] storageSlabs = new ItemStack[BlockTypes_MetalsIE.values().length];
for (int i = 0; i < BlockTypes_MetalsIE.values().length; i++) {
storageBlocks[i] = new ItemStack(IEContent.blockStorage, 1, i);
storageSlabs[i] = new ItemStack(IEContent.blockStorageSlabs, 1, i);
}
tempItemList = new ArrayList();
for (int i = 0; i < BlockTypes_MetalsAll.values().length; i++) if (!IEContent.blockSheetmetal.isMetaHidden(i))
tempItemList.add(new ItemStack(IEContent.blockSheetmetal, 1, i));
ItemStack[] sheetmetal = tempItemList.toArray(new ItemStack[tempItemList.size()]);
ManualHelper.addEntry("crate", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Crafting(ManualHelper.getManual(), "crate0", new ItemStack(IEContent.blockWoodenDevice0, 1, BlockTypes_WoodenDevice0.CRATE.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "crate1", new ItemStack(IEContent.blockWoodenDevice0, 1, BlockTypes_WoodenDevice0.REINFORCED_CRATE.getMeta())));
ManualHelper.addEntry("barrel", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Crafting(ManualHelper.getManual(), "barrel0", new ItemStack(IEContent.blockWoodenDevice0, 1, BlockTypes_WoodenDevice0.BARREL.getMeta())));
ManualHelper.addEntry("concrete", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Crafting(ManualHelper.getManual(), "concrete0", new ItemStack(IEContent.blockStoneDecoration, 1, BlockTypes_StoneDecoration.CONCRETE.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockStoneDecoration, 1, BlockTypes_StoneDecoration.CONCRETE_TILE.getMeta()), new ItemStack(IEContent.blockStoneStair_concrete0, 1, 0), new ItemStack(IEContent.blockStoneStair_concrete1, 1, 0)));
ManualHelper.addEntry("balloon", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Crafting(ManualHelper.getManual(), "balloon0", new ItemStack(IEContent.blockClothDevice, 1, BlockTypes_ClothDevice.BALLOON.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "balloon1"));
ManualHelper.addEntry("metalconstruction", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Text(ManualHelper.getManual(), "metalconstruction0"), new ManualPages.Crafting(ManualHelper.getManual(), "", storageBlocks, storageSlabs, sheetmetal), new ManualPages.Text(ManualHelper.getManual(), "metalconstruction1"), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.STEEL_FENCE.getMeta()), new ItemStack(IEContent.blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.STEEL_SCAFFOLDING_0.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockMetalDecoration2, 1, BlockTypes_MetalDecoration2.STEEL_WALLMOUNT.getMeta()), new ItemStack(IEContent.blockMetalDecoration2, 1, BlockTypes_MetalDecoration2.STEEL_POST.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.ALUMINUM_FENCE.getMeta()), new ItemStack(IEContent.blockMetalDecoration1, 1, BlockTypes_MetalDecoration1.ALUMINUM_SCAFFOLDING_0.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockMetalDecoration2, 1, BlockTypes_MetalDecoration2.ALUMINUM_WALLMOUNT.getMeta()), new ItemStack(IEContent.blockMetalDecoration2, 1, BlockTypes_MetalDecoration2.ALUMINUM_POST.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "metalconstruction2", new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.CONNECTOR_STRUCTURAL.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.itemWireCoil, 1, 3), new ItemStack(IEContent.itemWireCoil, 1, 4)));
ManualHelper.addEntry("multiblocks", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Text(ManualHelper.getManual(), "multiblocks0"), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockMetalDecoration0, 1, BlockTypes_MetalDecoration0.RS_ENGINEERING.getMeta()), new ItemStack(IEContent.blockMetalDecoration0, 1, BlockTypes_MetalDecoration0.LIGHT_ENGINEERING.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockMetalDecoration0, 1, BlockTypes_MetalDecoration0.HEAVY_ENGINEERING.getMeta()), new ItemStack(IEContent.blockMetalDecoration0, 1, BlockTypes_MetalDecoration0.GENERATOR.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockMetalDecoration0, 1, BlockTypes_MetalDecoration0.RADIATOR.getMeta())));
ManualHelper.addEntry("metalbarrel", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Crafting(ManualHelper.getManual(), "metalbarrel0", new ItemStack(IEContent.blockMetalDevice0, 1, BlockTypes_MetalDevice0.BARREL.getMeta())));
ManualHelper.addEntry("workbench", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Crafting(ManualHelper.getManual(), "workbench0", new ItemStack(IEContent.blockWoodenDevice0, 1, BlockTypes_WoodenDevice0.WORKBENCH.getMeta())));
ManualHelper.addEntry("blueprints", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Text(ManualHelper.getManual(), "blueprints0"), new ManualPages.Text(ManualHelper.getManual(), "blueprints1"));
ManualHelper.addEntry("lighting", ManualHelper.CAT_CONSTRUCTION, new ManualPages.Crafting(ManualHelper.getManual(), "lighting0", new ItemStack(IEContent.blockMetalDecoration2, 1, BlockTypes_MetalDecoration2.LANTERN.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "lighting1", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.ELECTRIC_LANTERN.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "lighting2"), new ManualPages.Crafting(ManualHelper.getManual(), "lighting3", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.FLOODLIGHT.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "lighting4"));
ManualHelper.addEntry("tank", ManualHelper.CAT_CONSTRUCTION, new ManualPageMultiblock(ManualHelper.getManual(), "tank0", MultiblockSheetmetalTank.instance), new ManualPages.Text(ManualHelper.getManual(), "tank1"));
ManualHelper.addEntry("silo", ManualHelper.CAT_CONSTRUCTION, new ManualPageMultiblock(ManualHelper.getManual(), "silo0", MultiblockSilo.instance), new ManualPages.Text(ManualHelper.getManual(), "silo1"), new ManualPages.Text(ManualHelper.getManual(), "silo2"));
Object[] wires = { new ItemStack(IEContent.itemMaterial, 1, 20), new ItemStack(IEContent.itemWireCoil, 1, 0), new ItemStack(IEContent.itemMaterial, 1, 21), new ItemStack(IEContent.itemWireCoil, 1, 1), new ItemStack(IEContent.itemMaterial, 1, 22), new ItemStack(IEContent.itemMaterial, 1, 23), new ItemStack(IEContent.itemWireCoil, 1, 2) };
ManualHelper.addEntry("wiring", ManualHelper.CAT_ENERGY, new ManualPages.Text(ManualHelper.getManual(), "wiring0"), new ManualPages.CraftingMulti(ManualHelper.getManual(), "wiring1", wires), new ManualPages.Image(ManualHelper.getManual(), "wiring2", "immersiveengineering:textures/misc/wiring.png;0;0;110;40", "immersiveengineering:textures/misc/wiring.png;0;40;110;30"), new ManualPages.Image(ManualHelper.getManual(), "wiring3", "immersiveengineering:textures/misc/wiring.png;0;70;110;60", "immersiveengineering:textures/misc/wiring.png;0;130;110;60"), new ManualPages.Text(ManualHelper.getManual(), "wiring4"), new ManualPages.Text(ManualHelper.getManual(), "wiring5"), new ManualPages.CraftingMulti(ManualHelper.getManual(), "wiringConnector", new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.CONNECTOR_LV.getMeta()), new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.RELAY_LV.getMeta()), new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.CONNECTOR_MV.getMeta()), new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.RELAY_HV.getMeta()), new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.CONNECTOR_HV.getMeta()), new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.RELAY_HV.getMeta())), new ManualPages.CraftingMulti(ManualHelper.getManual(), "wiringCapacitor", new ItemStack(IEContent.blockMetalDevice0, 1, BlockTypes_MetalDevice0.CAPACITOR_LV.getMeta()), new ItemStack(IEContent.blockMetalDevice0, 1, BlockTypes_MetalDevice0.CAPACITOR_MV.getMeta()), new ItemStack(IEContent.blockMetalDevice0, 1, BlockTypes_MetalDevice0.CAPACITOR_HV.getMeta())), new ManualPages.CraftingMulti(ManualHelper.getManual(), "wiringTransformer0", new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.TRANSFORMER.getMeta()), new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.TRANSFORMER_HV.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "wiringTransformer1"), new ManualPages.Crafting(ManualHelper.getManual(), "wiringCutters", new ItemStack(IEContent.itemTool, 1, 1)), new ManualPages.Crafting(ManualHelper.getManual(), "wiringVoltmeter", new ItemStack(IEContent.itemTool, 1, 2)));
ManualHelper.getManual().addEntry("generator", ManualHelper.CAT_ENERGY, new ManualPages.Crafting(ManualHelper.getManual(), "generator0", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.DYNAMO.getMeta())), new ManualPages.CraftingMulti(ManualHelper.getManual(), "generatorWindmill", new ItemStack(IEContent.blockWoodenDevice1, 1, BlockTypes_WoodenDevice1.WINDMILL.getMeta()), new ItemStack(IEContent.itemMaterial, 1, 2)), new ManualPages.CraftingMulti(ManualHelper.getManual(), "generatorWatermill", new ItemStack(IEContent.blockWoodenDevice1, 1, BlockTypes_WoodenDevice1.WATERMILL.getMeta()), new ItemStack(IEContent.itemMaterial, 1, 1)), new ManualPages.CraftingMulti(ManualHelper.getManual(), "generatorWindmillImproved", new ItemStack(IEContent.blockWoodenDevice1, 1, BlockTypes_WoodenDevice1.WINDMILL_ADVANCED.getMeta()), new ItemStack(IEContent.itemMaterial, 1, 5)));
ManualHelper.getManual().addEntry("breaker", ManualHelper.CAT_ENERGY, new ManualPages.Crafting(ManualHelper.getManual(), "breaker0", new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.BREAKERSWITCH.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "breaker1"), new ManualPages.Crafting(ManualHelper.getManual(), "breaker2", new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.REDSTONE_BREAKER.getMeta())));
ManualHelper.getManual().addEntry("eMeter", ManualHelper.CAT_ENERGY, new ManualPages.Crafting(ManualHelper.getManual(), "eMeter0", new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.ENERGY_METER.getMeta())));
Map<String, Integer> sortedMap = ThermoelectricHandler.getThermalValuesSorted(true);
String[][] table = formatToTable_ItemIntHashmap(sortedMap, "K");
ManualHelper.getManual().addEntry("redstoneWires", ManualHelper.CAT_ENERGY, new ManualPages.Crafting(ManualHelper.getManual(), "redstoneWires0", new ItemStack(IEContent.itemWireCoil, 1, 5)), new ManualPages.Crafting(ManualHelper.getManual(), "redstoneWires1", new ItemStack(IEContent.blockConnectors, 1, BlockTypes_Connector.CONNECTOR_REDSTONE.getMeta())));
ManualHelper.getManual().addEntry("thermoElectric", ManualHelper.CAT_ENERGY, new ManualPages.Crafting(ManualHelper.getManual(), "thermoElectric0", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.THERMOELECTRIC_GEN.getMeta())), new ManualPages.Table(ManualHelper.getManual(), "thermoElectric1", table, false));
// ManualHelper.addEntry("highvoltage", ManualHelper.CAT_ENERGY,
// new ManualPages.Text(ManualHelper.getManual(), "highvoltage0"),
// new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockMetalDevice,1,8),new ItemStack(IEContent.blockMetalDevice,1,4)),
// new ManualPages.Crafting(ManualHelper.getManual(), "", new ItemStack(IEContent.blockMetalDevice,1,5),new ItemStack(IEContent.blockMetalDevice,1,7)));
// sortedMap = DieselHandler.getFuelValuesSorted(true);
// Map.Entry<String,Integer>[] dieselFuels = sortedMap.entrySet().toArray(new Map.Entry[0]);
// table = new String[dieselFuels.length][2];
// for(int i=0; i<table.length; i++)
// {
// Fluid f = FluidRegistry.getFluid(dieselFuels[i].getKey());
// String sf = f!=null?new FluidStack(f,1000).getUnlocalizedName():"";
// int bt = dieselFuels[i].getValue();
// String am = Utils.formatDouble(bt/20f, "0.###")+" ("+bt+")";
// table[i] = new String[]{sf,am};
// }
ManualHelper.addEntry("dieselgen", ManualHelper.CAT_ENERGY, new ManualPages.Text(ManualHelper.getManual(), "dieselgen0"), new ManualPageMultiblock(ManualHelper.getManual(), "dieselgen1", MultiblockDieselGenerator.instance), new ManualPages.Text(ManualHelper.getManual(), "dieselgen2"));
ManualHelper.addEntry("lightningrod", ManualHelper.CAT_ENERGY, new ManualPageMultiblock(ManualHelper.getManual(), "lightningrod0", MultiblockLightningrod.instance), new ManualPages.Text(ManualHelper.getManual(), "lightningrod1"));
ManualHelper.addEntry("conveyor", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "conveyor0", ConveyorHandler.getConveyorStack(ImmersiveEngineering.MODID + ":conveyor"), ConveyorHandler.getConveyorStack(ImmersiveEngineering.MODID + ":uncontrolled")), new ManualPages.Text(ManualHelper.getManual(), "conveyor1"), new ManualPages.Crafting(ManualHelper.getManual(), "conveyor2", ConveyorHandler.getConveyorStack(ImmersiveEngineering.MODID + ":dropper")), new ManualPages.Crafting(ManualHelper.getManual(), "conveyor3", ConveyorHandler.getConveyorStack(ImmersiveEngineering.MODID + ":vertical")), new ManualPages.Crafting(ManualHelper.getManual(), "conveyor4", ConveyorHandler.getConveyorStack(ImmersiveEngineering.MODID + ":splitter")), new ManualPages.Crafting(ManualHelper.getManual(), "conveyor5", ConveyorHandler.getConveyorStack(ImmersiveEngineering.MODID + ":covered")));
ManualHelper.addEntry("furnaceHeater", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "furnaceHeater0", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.FURNACE_HEATER.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "furnaceHeater1"), new ManualPages.Text(ManualHelper.getManual(), "furnaceHeater2"));
ManualHelper.addEntry("sorter", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "sorter0", new ItemStack(IEContent.blockWoodenDevice0, 1, BlockTypes_WoodenDevice0.SORTER.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "sorter1"));
ManualHelper.addEntry("fluidSorter", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "fluidSorter0", new ItemStack(IEContent.blockWoodenDevice0, 1, BlockTypes_WoodenDevice0.FLUID_SORTER.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "fluidSorter1"));
ManualHelper.addEntry("turntable", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "turntable0", new ItemStack(IEContent.blockWoodenDevice0, 1, BlockTypes_WoodenDevice0.TURNTABLE.getMeta())));
pages = new ArrayList<IManualPage>();
pages.add(new ManualPages.Crafting(ManualHelper.getManual(), "fluidPipes0", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.FLUID_PIPE.getMeta())));
pages.add(new ManualPages.Text(ManualHelper.getManual(), "fluidPipes1"));
pages.add(new ManualPages.Crafting(ManualHelper.getManual(), "fluidPipes2", new ItemStack(IEContent.blockMetalDevice0, 1, BlockTypes_MetalDevice0.FLUID_PUMP.getMeta())));
pages.add(new ManualPages.Text(ManualHelper.getManual(), "fluidPipes3"));
if (IEConfig.Machines.pump_infiniteWater || IEConfig.Machines.pump_placeCobble)
pages.add(new ManualPages.Text(ManualHelper.getManual(), "fluidPipes4"));
pages.add(new ManualPages.Crafting(ManualHelper.getManual(), "fluidPipes5", new ItemStack(IEContent.blockMetalDevice0, 1, BlockTypes_MetalDevice0.FLUID_PLACER.getMeta())));
ManualHelper.addEntry("fluidPipes", ManualHelper.CAT_MACHINES, pages.toArray(new IManualPage[pages.size()]));
ManualHelper.addEntry("chargingStation", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "chargingStation0", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.CHARGING_STATION.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "chargingStation1"));
ManualHelper.addEntry("belljar", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "belljar0", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.BELLJAR.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "belljar1"));
ManualHelper.addEntry("teslaCoil", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "teslaCoil0", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.TESLA_COIL.getMeta())), new ManualPages.Text(ManualHelper.getManual(), "teslaCoil1"), new ManualPages.CraftingMulti(ManualHelper.getManual(), "teslaCoil2", new ItemStack(IEContent.itemsFaradaySuit[0]), new ItemStack(IEContent.itemsFaradaySuit[1]), new ItemStack(IEContent.itemsFaradaySuit[2]), new ItemStack(IEContent.itemsFaradaySuit[3]), new ItemStack(IEContent.itemFluorescentTube)), new ManualPages.Text(ManualHelper.getManual(), "teslaCoil3"), new ManualPages.Text(ManualHelper.getManual(), "teslaCoil4"));
ManualHelper.addEntry("jerrycan", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "jerrycan0", new ItemStack(IEContent.itemJerrycan)));
tempItemList = new ArrayList<>();
for (int i = 0; i < 16; i++) tempItemList.add(ItemNBTHelper.stackWithData(new ItemStack(IEContent.itemEarmuffs), "IE:EarmuffColour", EnumDyeColor.byDyeDamage(i).getMapColor().colorValue));
ManualHelper.addEntry("earmuffs", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "earmuffs0", new ItemStack(IEContent.itemEarmuffs)), new ManualPages.CraftingMulti(ManualHelper.getManual(), "earmuffs1", (Object[]) new PositionedItemStack[][] { new PositionedItemStack[] { new PositionedItemStack(new ItemStack(IEContent.itemEarmuffs), 24, 0), new PositionedItemStack(new ItemStack(Items.DYE, 1, OreDictionary.WILDCARD_VALUE), 42, 0), new PositionedItemStack(tempItemList, 78, 0) }, new PositionedItemStack[] { new PositionedItemStack(new ItemStack(IEContent.itemEarmuffs), 24, 0), new PositionedItemStack(Lists.newArrayList(new ItemStack(Items.LEATHER_HELMET), new ItemStack(Items.IRON_HELMET)), 42, 0), new PositionedItemStack(Lists.newArrayList(ItemNBTHelper.stackWithData(new ItemStack(Items.LEATHER_HELMET), "IE:Earmuffs", true), ItemNBTHelper.stackWithData(new ItemStack(Items.IRON_HELMET), "IE:Earmuffs", true)), 78, 0) } }));
ManualHelper.addEntry("toolbox", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "toolbox0", new ItemStack(IEContent.itemToolbox)), new ManualPages.Text(ManualHelper.getManual(), "toolbox1"));
ManualHelper.addEntry("drill", ManualHelper.CAT_MACHINES, new ManualPages.CraftingMulti(ManualHelper.getManual(), "drill0", new ItemStack(IEContent.itemDrill, 1, 0), new ItemStack(IEContent.itemMaterial, 1, 9)), new ManualPages.Crafting(ManualHelper.getManual(), "drill1", new ItemStack(IEContent.itemDrillhead, 1, 0)), new ManualPages.Crafting(ManualHelper.getManual(), "drill2", new ItemStack(IEContent.itemToolUpgrades, 1, 0)), new ManualPages.Crafting(ManualHelper.getManual(), "drill3", new ItemStack(IEContent.itemToolUpgrades, 1, 1)), new ManualPages.Crafting(ManualHelper.getManual(), "drill4", new ItemStack(IEContent.itemToolUpgrades, 1, 2)), new ManualPages.Crafting(ManualHelper.getManual(), "drill5", new ItemStack(IEContent.itemToolUpgrades, 1, 3)));
ManualHelper.addEntry("revolver", ManualHelper.CAT_MACHINES, new ManualPages.CraftingMulti(ManualHelper.getManual(), "revolver0", new ItemStack(IEContent.itemRevolver, 1, 0), new ItemStack(IEContent.itemMaterial, 1, 7), new ItemStack(IEContent.itemMaterial, 1, 8), new ItemStack(IEContent.itemMaterial, 1, 9), new ItemStack(IEContent.itemMaterial, 1, 10)), new ManualPages.CraftingMulti(ManualHelper.getManual(), "revolver1", new ItemStack(IEContent.itemRevolver, 1, 1)), new ManualPages.Crafting(ManualHelper.getManual(), "revolver2", new ItemStack(IEContent.itemToolUpgrades, 1, 4)), new ManualPages.Crafting(ManualHelper.getManual(), "revolver3", new ItemStack(IEContent.itemToolUpgrades, 1, 5)), new ManualPages.Crafting(ManualHelper.getManual(), "revolver4", new ItemStack(IEContent.itemToolUpgrades, 1, 6)));
pages = new ArrayList<IManualPage>();
pages.add(new ManualPages.Crafting(ManualHelper.getManual(), "bullets0", ItemEngineersBlueprint.getTypedBlueprint("bullet")));
pages.add(new ManualPages.CraftingMulti(ManualHelper.getManual(), "bullets1", new ItemStack(IEContent.itemBullet, 1, 0), new ItemStack(IEContent.itemBullet, 1, 1), new ItemStack(IEContent.itemMold, 1, 3)));
for (String key : BulletHandler.registry.keySet()) if (BulletHandler.registry.get(key).isProperCartridge())
pages.add(new ManualPages.ItemDisplay(ManualHelper.getManual(), "bullets_" + key, BulletHandler.getBulletStack(key)));
ManualHelper.addEntry("bullets", ManualHelper.CAT_MACHINES, pages.toArray(new IManualPage[pages.size()]));
ManualHelper.addEntry("skyhook", ManualHelper.CAT_MACHINES, new ManualPages.CraftingMulti(ManualHelper.getManual(), "skyhook0", new ItemStack(IEContent.itemSkyhook), new ItemStack(IEContent.itemMaterial, 1, 9)), new ManualPages.Text(ManualHelper.getManual(), "skyhook1"));
ManualHelper.addEntry("chemthrower", ManualHelper.CAT_MACHINES, new ManualPages.CraftingMulti(ManualHelper.getManual(), "chemthrower0", new ItemStack(IEContent.itemChemthrower, 1, 0), new ItemStack(IEContent.itemMaterial, 1, 9), new ItemStack(IEContent.itemToolUpgrades, 1, 0)), new ManualPages.Crafting(ManualHelper.getManual(), "chemthrower1", new ItemStack(IEContent.itemToolUpgrades, 1, 3)), new ManualPages.Crafting(ManualHelper.getManual(), "chemthrower2", new ItemStack(IEContent.itemToolUpgrades, 1, 7)));
ManualHelper.addEntry("railgun", ManualHelper.CAT_MACHINES, new ManualPages.CraftingMulti(ManualHelper.getManual(), "railgun0", new ItemStack(IEContent.itemRailgun, 1, 0), new ItemStack(IEContent.itemMaterial, 1, 9)), new ManualPages.Text(ManualHelper.getManual(), "railgun1"), new ManualPages.Crafting(ManualHelper.getManual(), "railgun2", new ItemStack(IEContent.itemToolUpgrades, 1, 9)), new ManualPages.Crafting(ManualHelper.getManual(), "railgun3", new ItemStack(IEContent.itemToolUpgrades, 1, 8)));
ManualHelper.addEntry("razorwire", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "razorwire0", new ItemStack(IEContent.blockMetalDecoration2, 1, BlockTypes_MetalDecoration2.RAZOR_WIRE.getMeta())));
ManualHelper.addEntry("turret", ManualHelper.CAT_MACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "turret0"), new ManualPages.Crafting(ManualHelper.getManual(), "turret1"), new ManualPages.Crafting(ManualHelper.getManual(), "turret2", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.TURRET_CHEM.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "turret3"), new ManualPages.Crafting(ManualHelper.getManual(), "turret4", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.TURRET_GUN.getMeta())), new ManualPages.Crafting(ManualHelper.getManual(), "turret5"));
ManualHelper.addEntry("improvedBlastfurnace", ManualHelper.CAT_HEAVYMACHINES, new ManualPages.Crafting(ManualHelper.getManual(), "improvedBlastfurnace0", new ItemStack(IEContent.blockStoneDecoration, 1, BlockTypes_StoneDecoration.BLASTBRICK_REINFORCED.getMeta())), new ManualPageMultiblock(ManualHelper.getManual(), "improvedBlastfurnace1", MultiblockBlastFurnaceAdvanced.instance), new ManualPages.Text(ManualHelper.getManual(), "improvedBlastfurnace2"), new ManualPages.Crafting(ManualHelper.getManual(), "improvedBlastfurnace3", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.BLAST_FURNACE_PREHEATER.getMeta())));
tempItemList = new ArrayList();
IEContent.itemMold.getSubItems(IEContent.itemMold, ImmersiveEngineering.creativeTab, tempItemList);
ManualHelper.addEntry("metalPress", ManualHelper.CAT_HEAVYMACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "metalPress0", MultiblockMetalPress.instance), new ManualPages.Text(ManualHelper.getManual(), "metalPress1"), new ManualPages.CraftingMulti(ManualHelper.getManual(), "metalPress2", (Object[]) tempItemList.toArray(new ItemStack[tempItemList.size()])));
ManualHelper.addEntry("assembler", ManualHelper.CAT_MACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "assembler0", MultiblockAssembler.instance), new ManualPages.Text(ManualHelper.getManual(), "assembler1"), new ManualPages.Text(ManualHelper.getManual(), "assembler2"));
ManualHelper.addEntry("bottlingMachine", ManualHelper.CAT_MACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "bottlingMachine0", MultiblockBottlingMachine.instance), new ManualPages.Text(ManualHelper.getManual(), "bottlingMachine1"));
ManualHelper.addEntry("autoworkbench", ManualHelper.CAT_MACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "autoworkbench0", MultiblockAutoWorkbench.instance), new ManualPages.Text(ManualHelper.getManual(), "autoworkbench1"));
ManualHelper.addEntry("crusher", ManualHelper.CAT_HEAVYMACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "crusher0", MultiblockCrusher.instance), new ManualPages.Text(ManualHelper.getManual(), "crusher1"));
ManualHelper.addEntry("mixer", ManualHelper.CAT_HEAVYMACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "mixer0", MultiblockMixer.instance), new ManualPages.Text(ManualHelper.getManual(), "mixer1"), new ManualPages.Text(ManualHelper.getManual(), "mixer2"));
sortedMap = SqueezerRecipe.getFluidValuesSorted(IEContent.fluidPlantoil, true);
table = formatToTable_ItemIntHashmap(sortedMap, "mB");
ManualHelper.addEntry("squeezer", ManualHelper.CAT_HEAVYMACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "squeezer0", MultiblockSqueezer.instance), new ManualPages.Text(ManualHelper.getManual(), "squeezer1"), new ManualPages.Table(ManualHelper.getManual(), "squeezer2T", table, false));
sortedMap = FermenterRecipe.getFluidValuesSorted(IEContent.fluidEthanol, true);
table = formatToTable_ItemIntHashmap(sortedMap, "mB");
ManualHelper.addEntry("fermenter", ManualHelper.CAT_HEAVYMACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "fermenter0", MultiblockFermenter.instance), new ManualPages.Text(ManualHelper.getManual(), "fermenter1"), new ManualPages.Table(ManualHelper.getManual(), "fermenter2T", table, false));
ManualHelper.addEntry("refinery", ManualHelper.CAT_HEAVYMACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "refinery0", MultiblockRefinery.instance), new ManualPages.Text(ManualHelper.getManual(), "refinery1"));
// ArrayList<ItemStack> stacks = new ArrayList<ItemStack>();
// ManualHelper.addEntry("bottlingMachine", ManualHelper.CAT_MACHINES,
// new ManualPageMultiblock(ManualHelper.getManual(), "bottlingMachine0", MultiblockBottlingMachine.instance),
// new ManualPages.Text(ManualHelper.getManual(), "bottlingMachine1"));
sortedMap = FermenterRecipe.getFluidValuesSorted(IEContent.fluidEthanol, true);
String[][] table2 = formatToTable_ItemIntHashmap(sortedMap, "mB");
// ManualHelper.addEntry("biodiesel", ManualHelper.CAT_HEAVYMACHINES,
// new ManualPages.Text(ManualHelper.getManual(), "biodiesel0"),
// new ManualPageMultiblock(ManualHelper.getManual(), "biodiesel1", MultiblockSqueezer.instance),
// new ManualPages.Table(ManualHelper.getManual(), "biodiesel1T", table, false),
// new ManualPageMultiblock(ManualHelper.getManual(), "biodiesel2", MultiblockFermenter.instance),
// new ManualPages.Table(ManualHelper.getManual(), "biodiesel2T", table2, false),
// new ManualPageMultiblock(ManualHelper.getManual(), "biodiesel3", MultiblockRefinery.instance),
// new ManualPages.Text(ManualHelper.getManual(), "biodiesel4"));
ManualHelper.addEntry("arcfurnace", ManualHelper.CAT_HEAVYMACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "arcfurnace0", MultiblockArcFurnace.instance), new ManualPages.Text(ManualHelper.getManual(), "arcfurnace1"), new ManualPages.Text(ManualHelper.getManual(), "arcfurnace2"), new ManualPages.Text(ManualHelper.getManual(), "arcfurnace3"), new ManualPages.Text(ManualHelper.getManual(), "arcfurnace4"), new ManualPages.Text(ManualHelper.getManual(), "arcfurnace5"));
ManualHelper.addEntry("excavator", ManualHelper.CAT_HEAVYMACHINES, new ManualPageMultiblock(ManualHelper.getManual(), "excavator0", MultiblockExcavator.instance), new ManualPageMultiblock(ManualHelper.getManual(), "", MultiblockBucketWheel.instance), new ManualPageMultiblock(ManualHelper.getManual(), "", MultiblockExcavatorDemo.instance), new ManualPages.Text(ManualHelper.getManual(), "excavator1"));
ClientCommandHandler.instance.registerCommand(new CommandHandler(true));
}
use of blusunrize.lib.manual.IManualPage in project ImmersiveEngineering by BluSunrize.
the class GuiManual method initGui.
@Override
public void initGui() {
if (Minecraft.getMinecraft().gameSettings.guiScale == 1) {
Minecraft.getMinecraft().gameSettings.guiScale = 2;
ScaledResolution res = new ScaledResolution(this.mc);
this.width = res.getScaledWidth();
this.height = res.getScaledHeight();
Minecraft.getMinecraft().gameSettings.guiScale = 1;
}
this.manual.openManual();
guiLeft = (this.width - this.xSize) / 2;
guiTop = (this.height - this.ySize) / 2;
boolean textField = false;
this.buttonList.clear();
this.pageButtons.clear();
headers = new String[0];
suggestionHeaders = new String[0];
hasSuggestions = -1;
if (manual.getEntry(selectedEntry) != null) {
ManualEntry entry = manual.getEntry(selectedEntry);
IManualPage mPage = (page < 0 || page >= entry.getPages().length) ? null : entry.getPages()[page];
if (mPage != null)
mPage.initPage(this, guiLeft + 32, guiTop + 28, pageButtons);
buttonList.addAll(pageButtons);
} else if (manual.getSortedCategoryList() == null || manual.getSortedCategoryList().length <= 1) {
ArrayList<String> lHeaders = new ArrayList<String>();
for (ManualEntry e : manual.manualContents.values()) if (manual.showEntryInList(e))
lHeaders.add(e.getName());
headers = lHeaders.toArray(new String[lHeaders.size()]);
this.buttonList.add(new GuiClickableList(this, 0, guiLeft + 40, guiTop + 20, 100, 168, 1f, 1, headers));
textField = true;
} else if (manual.manualContents.containsKey(selectedCategory)) {
ArrayList<String> lHeaders = new ArrayList<String>();
for (ManualEntry e : manual.manualContents.get(selectedCategory)) if (manual.showEntryInList(e))
lHeaders.add(e.getName());
headers = lHeaders.toArray(new String[lHeaders.size()]);
this.buttonList.add(new GuiClickableList(this, 0, guiLeft + 40, guiTop + 20, 100, 168, 1f, 1, headers));
textField = true;
} else {
ArrayList<String> lHeaders = new ArrayList<String>();
for (String cat : manual.getSortedCategoryList()) if (manual.showCategoryInList(cat))
lHeaders.add(cat);
headers = lHeaders.toArray(new String[lHeaders.size()]);
this.buttonList.add(new GuiClickableList(this, 0, guiLeft + 40, guiTop + 20, 100, 168, 1f, 0, headers));
textField = true;
}
if (manual.manualContents.containsKey(selectedCategory) || manual.getEntry(selectedEntry) != null)
this.buttonList.add(new GuiButtonManualNavigation(this, 1, guiLeft + 24, guiTop + 10, 10, 10, 0));
if (textField) {
Keyboard.enableRepeatEvents(true);
searchField = new GuiTextField(99, this.fontRendererObj, guiLeft + 166, guiTop + 78, 120, 12);
searchField.setTextColor(-1);
searchField.setDisabledTextColour(-1);
searchField.setEnableBackgroundDrawing(false);
searchField.setMaxStringLength(17);
searchField.setFocused(true);
searchField.setCanLoseFocus(false);
} else if (searchField != null)
searchField = null;
}
use of blusunrize.lib.manual.IManualPage in project ImmersiveEngineering by BluSunrize.
the class ClientProxy method handleMineralManual.
public static void handleMineralManual() {
if (ManualHelper.getManual() != null) {
ArrayList<IManualPage> pages = new ArrayList();
pages.add(new ManualPages.Text(ManualHelper.getManual(), "minerals0"));
pages.add(new ManualPages.Crafting(ManualHelper.getManual(), "minerals1", new ItemStack(IEContent.blockMetalDevice1, 1, BlockTypes_MetalDevice1.SAMPLE_DRILL.getMeta())));
pages.add(new ManualPages.Text(ManualHelper.getManual(), "minerals2"));
final ExcavatorHandler.MineralMix[] minerals = ExcavatorHandler.mineralList.keySet().toArray(new ExcavatorHandler.MineralMix[0]);
ArrayList<Integer> mineralIndices = new ArrayList();
for (int i = 0; i < minerals.length; i++) if (minerals[i].isValid())
mineralIndices.add(i);
Collections.sort(mineralIndices, new Comparator<Integer>() {
@Override
public int compare(Integer paramT1, Integer paramT2) {
String name1 = Lib.DESC_INFO + "mineral." + minerals[paramT1].name;
String localizedName1 = I18n.format(name1);
if (localizedName1 == name1)
localizedName1 = minerals[paramT1].name;
String name2 = Lib.DESC_INFO + "mineral." + minerals[paramT2].name;
String localizedName2 = I18n.format(name2);
if (localizedName2 == name2)
localizedName2 = minerals[paramT2].name;
return localizedName1.compareToIgnoreCase(localizedName2);
}
});
for (int i : mineralIndices) {
String name = Lib.DESC_INFO + "mineral." + minerals[i].name;
String localizedName = I18n.format(name);
if (localizedName.equalsIgnoreCase(name))
localizedName = minerals[i].name;
String s0 = "";
if (minerals[i].dimensionWhitelist != null && minerals[i].dimensionWhitelist.length > 0) {
String validDims = "";
for (int dim : minerals[i].dimensionWhitelist) validDims += (!validDims.isEmpty() ? ", " : "") + "<dim;" + dim + ">";
s0 = I18n.format("ie.manual.entry.mineralsDimValid", localizedName, validDims);
} else if (minerals[i].dimensionBlacklist != null && minerals[i].dimensionBlacklist.length > 0) {
String invalidDims = "";
for (int dim : minerals[i].dimensionBlacklist) invalidDims += (!invalidDims.isEmpty() ? ", " : "") + "<dim;" + dim + ">";
s0 = I18n.format("ie.manual.entry.mineralsDimInvalid", localizedName, invalidDims);
} else
s0 = I18n.format("ie.manual.entry.mineralsDimAny", localizedName);
ArrayList<Integer> formattedOutputs = new ArrayList<Integer>();
for (int j = 0; j < minerals[i].oreOutput.length; j++) formattedOutputs.add(j);
final int fi = i;
Collections.sort(formattedOutputs, new Comparator<Integer>() {
@Override
public int compare(Integer paramT1, Integer paramT2) {
return -Double.compare(minerals[fi].recalculatedChances[paramT1], minerals[fi].recalculatedChances[paramT2]);
}
});
String s1 = "";
ItemStack[] sortedOres = new ItemStack[minerals[i].oreOutput.length];
for (int j = 0; j < formattedOutputs.size(); j++) if (minerals[i].oreOutput[j] != null) {
int sorted = formattedOutputs.get(j);
s1 += "<br>" + new DecimalFormat("00.00").format(minerals[i].recalculatedChances[sorted] * 100).replaceAll("\\G0", " ") + "% " + minerals[i].oreOutput[sorted].getDisplayName();
sortedOres[j] = minerals[i].oreOutput[sorted];
}
String s2 = I18n.format("ie.manual.entry.minerals3", s0, s1);
pages.add(new ManualPages.ItemDisplay(ManualHelper.getManual(), s2, sortedOres));
}
// pages.add(new ManualPages.Table(ManualHelper.getManual(), "", minTable,true));
if (mineralEntry != null)
mineralEntry.setPages(pages.toArray(new IManualPage[pages.size()]));
else {
ManualHelper.addEntry("minerals", ManualHelper.CAT_GENERAL, pages.toArray(new IManualPage[pages.size()]));
mineralEntry = ManualHelper.getManual().getEntry("minerals");
}
}
}
Aggregations