Removed old manual class's to fix build

This commit is contained in:
gigabit101 2016-02-26 13:00:42 +00:00
parent 80df0b6d2c
commit f61dde634a
7 changed files with 0 additions and 813 deletions

View file

@ -1,57 +0,0 @@
package techreborn.manual.old;
import java.awt.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.item.ItemStack;
import techreborn.config.TechRebornConfigGui;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.manual.PageCollection;
import techreborn.manual.pages.TitledPage;
import techreborn.manual.util.GuiButtonCustomTexture;
public class ContentsPageOld extends TitledPage {
public ContentsPageOld(String name, PageCollection collection) {
super(name, false, collection, "techreborn.pda.contents", Color.white.getRGB());
}
@SuppressWarnings("unchecked")
@Override
public void initGui() {
buttonList.clear();
buttonList.add(new GuiButtonCustomTexture(0, getXMin() + 25, getYMin() + 20, 0, 46, 80, 20, new ItemStack(ModBlocks.AlloySmelter), "INDEX", "MACHINES"));
buttonList.add(new GuiButtonCustomTexture(1, getXMin() + 160, getYMin() + 20, 0, 46, 80, 20, new ItemStack(ModItems.uuMatter), "INDEX", "ITEMS"));
buttonList.add(new GuiButtonCustomTexture(2, getXMin() + 25, getYMin() + 40, 0, 46, 80, 20, new ItemStack(ModBlocks.DieselGenerator), "INDEX", "POWER GENERATION"));
buttonList.add(new GuiButtonCustomTexture(3, getXMin() + 160, getYMin() + 40, 0, 46, 80, 20, new ItemStack(ModItems.advancedDrill), "INDEX", "TOOLS"));
buttonList.add(new GuiButtonCustomTexture(4, getXMin() + 25, getYMin() + 60, 0, 46, 80, 20, new ItemStack(ModBlocks.Aesu), "INDEX", "POWER STORAGE"));
buttonList.add(new GuiButtonCustomTexture(5, getXMin() + 25, getYMin() + 80, 0, 46, 80, 20, new ItemStack(ModBlocks.MachineCasing), "INDEX", "MULTIBLOCKS"));
buttonList.add(new GuiButtonCustomTexture(6, getXMin() + 160, getYMin() + 60, 0, 46, 80, 20, new ItemStack(ModItems.upgrades), "INDEX", "UPGRADES"));
buttonList.add(new GuiButtonCustomTexture(7, getXMin() + 160, getYMin() + 180, 0, 46, 80, 20, new ItemStack(ModItems.lapotronicOrb), "INDEX", "Changelog"));
buttonList.add(new GuiButtonCustomTexture(8, getXMin() + 25, getYMin() + 180, 0, 46, 80, 20, new ItemStack(ModItems.lapotronicOrb), "INDEX", "Configs"));
}
@Override
public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY);
}
@Override
public void actionPerformed(GuiButton button) {
if (button.id == 0) collection.changeActivePage("MACHINES");
if (button.id == 1) collection.changeActivePage("ITEMS");
if (button.id == 2) collection.changeActivePage("POWER_GENERATION");
if (button.id == 3) collection.changeActivePage("TOOLS");
if (button.id == 4) collection.changeActivePage("POWER_STORAGE");
if (button.id == 5) collection.changeActivePage("MULTIBLOCKS");
if (button.id == 6) collection.changeActivePage("UPGRADES");
if (button.id == 7) collection.changeActivePage("VERSION");
if (button.id == 8) mc.displayGuiScreen(new TechRebornConfigGui(this));
if (button.id == 9) collection.changeActivePage("CONFIG");
}
}

View file

@ -1,290 +0,0 @@
package techreborn.manual.old;
import com.google.common.base.Objects;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.entity.RenderItem;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.*;
import net.minecraft.util.EnumChatFormatting;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import techreborn.manual.PageCollection;
import techreborn.manual.pages.TitledPage;
import org.lwjgl.opengl.GL11;
import java.awt.*;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class CraftingInfoPage extends TitledPage {
public ItemStack result;
private boolean isSmelting = false;
private ItemStack[] recipe = new ItemStack[9];
private boolean hasRecipe = false;
private String rawDescription;
private List<String> formattedDescription;
private float descriptionScale = 0.66f;
public CraftingInfoPage(String name, PageCollection collection, ItemStack itemStack, String unlocalizedDescription) {
super(name, true, collection, itemStack.getUnlocalizedName() + ".name", Color.white.getRGB());
this.result = itemStack;
this.recipe = getFirstRecipeForItem(itemStack);
for (ItemStack stack : recipe) if (stack != null) hasRecipe = true;
if (unlocalizedDescription == "") rawDescription = ttl(itemStack.getUnlocalizedName() + ".description");
else rawDescription = ttl(unlocalizedDescription);
}
@Override
public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY);
GL11.glPushMatrix();
if (isSmelting) {
drawTexturedModalRect(offsetX + 87, offsetY + 15, 116, 202, 82, 54);
} else {
if (hasRecipe) {
drawTexturedModalRect(offsetX + 70, offsetY + 15, 0, 202, 116, 54);
} else {
drawTexturedModalRect(offsetX + 119, offsetY + 17, 0, 202, 18, 18);
drawString(fontRendererObj, "No Crafting Recipe", offsetX + 145, offsetY + 17, Color.white.getRGB());
}
}
GL11.glPopMatrix();
}
public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.drawScreen(minecraft, offsetX, offsetY, mouseX, mouseY);
int relativeMouseX = mouseX + offsetX;
int relativeMouseY = mouseY + offsetY;
int gridOffsetX = isSmelting ? 88 : 71;
int gridOffsetY = 16;
int itemBoxSize = 18;
addDescription(minecraft, offsetX, offsetY);
ItemStack tooltip = null;
int i = 0;
for (ItemStack input : recipe) {
if (input != null) {
int row = (i % 3);
int column = i / 3;
int itemX = offsetX + gridOffsetX + (row * itemBoxSize);
int itemY = offsetY + gridOffsetY + (column * itemBoxSize);
drawItemStack(input, itemX, itemY, "");
if (relativeMouseX > itemX - 2 && relativeMouseX < itemX - 2 + itemBoxSize &&
relativeMouseY > itemY - 2 && relativeMouseY < itemY - 2 + itemBoxSize) {
tooltip = input;
}
}
i++;
}
int itemX = offsetX + (isSmelting ? 148 : 165);
int itemY = offsetY + 34;
if (!hasRecipe) {
itemX = offsetX + 120;
itemY = offsetY + 18;
}
drawItemStack(result, itemX, itemY, "");
if (relativeMouseX > itemX - 2 && relativeMouseX < itemX - 2 + itemBoxSize &&
relativeMouseY > itemY - 2 && relativeMouseY < itemY - 2 + itemBoxSize) {
tooltip = result;
}
if (tooltip != null) {
drawItemStackTooltip(tooltip, relativeMouseX, relativeMouseY);
}
}
public void addDescription(Minecraft minecraft, int offsetX, int offsetY) {
GL11.glPushMatrix();
if (hasRecipe) GL11.glTranslated(offsetX + 5, offsetY + 75, 1);
else GL11.glTranslated(offsetX + 5, offsetY + 40, 1);
GL11.glScalef(descriptionScale, descriptionScale, descriptionScale);
int offset = 0;
for (String s : getFormattedText(fontRendererObj)) {
if (s == null) break;
if (s.contains("\\%") && s.substring(0, 2).equals("\\%")) {
s = s.substring(2);
offset += fontRendererObj.FONT_HEIGHT / 2;
}
fontRendererObj.drawString(s, 0, offset, Color.white.getRGB());
offset += fontRendererObj.FONT_HEIGHT;
}
GL11.glPopMatrix();
}
@SuppressWarnings("unchecked")
public List<String> getFormattedText(FontRenderer fr) {
if (formattedDescription == null) {
formattedDescription = new ArrayList<String>();
if (Strings.isNullOrEmpty(rawDescription)) {
formattedDescription = ImmutableList.of();
return formattedDescription;
}
if (!rawDescription.contains("\\n")) {
formattedDescription = ImmutableList.copyOf(fr.listFormattedStringToWidth(rawDescription, 370));
return formattedDescription;
}
List<String> segments = new ArrayList(); //Each separate string that is separated by a \n
String raw = rawDescription;
int escape = 0;
while (raw.contains("\\n")) {
segments.add(raw.substring(0, raw.indexOf("\\n")));
raw = raw.substring(raw.indexOf("\\n") + 2);
if (!raw.contains("\\n")) segments.add(raw);
escape++;
if (escape > 100) {
break;
}
}
for (String s : segments)
formattedDescription.addAll(ImmutableList.copyOf(fr.listFormattedStringToWidth(s, 370)));
}
return formattedDescription;
}
protected void drawItemStackTooltip(ItemStack stack, int x, int y) {
final Minecraft mc = Minecraft.getMinecraft();
FontRenderer font = Objects.firstNonNull(stack.getItem().getFontRenderer(stack), mc.fontRendererObj);
@SuppressWarnings("unchecked")
List<String> list = stack.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips);
List<String> colored = Lists.newArrayListWithCapacity(list.size());
colored.add(stack.getRarity().rarityColor + list.get(0));
for (String line : list)
colored.add(EnumChatFormatting.GRAY + line);
if (colored.size() >= 2) colored.remove(1);
drawHoveringText(colored, x, y, font);
}
private void drawItemStack(ItemStack par1ItemStack, int par2, int par3, String par4Str) {
GL11.glTranslatef(0.0F, 0.0F, 32.0F);
this.zLevel = 200.0F;
RenderHelper.enableGUIStandardItemLighting();
GL11.glColor3f(1f, 1f, 1f);
GL11.glEnable(GL11.GL_NORMALIZE);
FontRenderer font = null;
if (par1ItemStack != null) font = par1ItemStack.getItem().getFontRenderer(par1ItemStack);
if (font == null) font = Minecraft.getMinecraft().fontRendererObj;
renderItemStack(par1ItemStack, par2, par3);
this.zLevel = 0.0F;
}
public void renderItemStack(ItemStack stack, int x, int y)
{
if (stack != null)
{
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
RenderHelper.enableGUIStandardItemLighting();
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
itemRenderer.renderItemAndEffectIntoGUI(stack, x, y);
GL11.glDisable(GL11.GL_LIGHTING);
}
}
@SuppressWarnings("unchecked")
private ItemStack[] getFirstRecipeForItem(ItemStack resultingItem) {
ItemStack[] recipeItems = new ItemStack[9];
for (IRecipe recipe : (List<IRecipe>) CraftingManager.getInstance().getRecipeList()) {
if (recipe == null) continue;
ItemStack result = recipe.getRecipeOutput();
if (result == null || !result.isItemEqual(resultingItem)) continue;
Object[] input = getRecipeInput(recipe);
if (input == null) continue;
for (int i = 0; i < input.length; i++)
recipeItems[i] = convertToStack(input[i]);
break;
}
Iterator iterator = FurnaceRecipes.instance().getSmeltingList().entrySet().iterator();
Map.Entry entry;
while (iterator.hasNext()) {
entry = (Map.Entry) iterator.next();
if (entry.getKey() instanceof ItemStack && ((ItemStack) entry.getValue()).isItemEqual(result)) {
isSmelting = true;
recipeItems[0] = (ItemStack) entry.getKey();
}
}
return recipeItems;
}
protected ItemStack convertToStack(Object obj) {
ItemStack entry = null;
if (obj instanceof ItemStack) {
entry = (ItemStack) obj;
} else if (obj instanceof List) {
@SuppressWarnings("unchecked")
List<ItemStack> list = (List<ItemStack>) obj;
if (list.size() > 0) entry = list.get(0);
}
if (entry == null) return null;
entry = entry.copy();
if (entry.getItemDamage() == OreDictionary.WILDCARD_VALUE) entry.setItemDamage(0);
return entry;
}
@SuppressWarnings("unchecked")
private Object[] getRecipeInput(IRecipe recipe) {
if (recipe instanceof ShapelessOreRecipe) return ((ShapelessOreRecipe) recipe).getInput().toArray();
else if (recipe instanceof ShapedOreRecipe) return getShapedOreRecipe((ShapedOreRecipe) recipe);
else if (recipe instanceof ShapedRecipes) return ((ShapedRecipes) recipe).recipeItems;
else if (recipe instanceof ShapelessRecipes)
return ((ShapelessRecipes) recipe).recipeItems.toArray(new ItemStack[0]);
return null;
}
private Object[] getShapedOreRecipe(ShapedOreRecipe recipe) {
try {
Field field = ShapedOreRecipe.class.getDeclaredField("width");
if (field != null) {
field.setAccessible(true);
int width = field.getInt(recipe);
Object[] input = recipe.getInput();
Object[] grid = new Object[9];
for (int i = 0, offset = 0, y = 0; y < 3; y++) {
for (int x = 0; x < 3; x++, i++) {
if (x < width && offset < input.length) {
grid[i] = input[offset];
offset++;
} else {
grid[i] = null;
}
}
}
return grid;
}
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
}

View file

@ -1,176 +0,0 @@
package techreborn.manual.old;
import java.io.IOException;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import techreborn.init.ModBlocks;
import techreborn.init.ModItems;
import techreborn.manual.PageCollection;
import techreborn.manual.pages.ContentsPage;
@SideOnly(Side.CLIENT)
public class GuiManualOld extends GuiScreen {
protected final PageCollection root;
protected int pageIndex = 0;
protected int xSize = 0;
protected int ySize = 0;
public Container inventorySlots;
protected int guiLeft;
protected int guiTop;
public GuiManualOld() {
this.xSize = 256;
this.ySize = 202;
root = createRoot();
}
protected PageCollection createRoot() {
pageIndex = 0;
final PageCollection pageCollection = new PageCollection();
pageCollection.addPage(new IndexPage("INDEX", pageCollection));
pageCollection.addPage(new ContentsPage("CONTENTS", pageCollection));
pageCollection.addPage(new ItemsPage("ITEMS", pageCollection, "ITEM_PAGE"));
pageCollection.addPage(new ItemsPage("TOOLS", pageCollection, "TOOLS_PAGE"));
pageCollection.addPage(new ItemsPage("UPGRADES", pageCollection, "UPGRADES_PAGE"));
pageCollection.addPage(new ItemsPage("MACHINES", pageCollection, "MACHINES_PAGE"));
pageCollection.addPage(new ItemsPage("POWER_GENERATION", pageCollection, "POWER_GENERATION_PAGE"));
pageCollection.addPage(new ItemsPage("POWER_STORAGE", pageCollection, "POWER_STORAGE_PAGE"));
pageCollection.addPage(new VersionPage("VERSION", pageCollection, "VERSION PAGE", 777777));
pageCollection.addPage(new MultiBlockPage("MULTIBLOCKS", pageCollection, "MULTIBLOCK_PAGE"));
pageCollection.addPage(new CraftingInfoPage("POWER_STORAGE_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Aesu), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.AlloyFurnace), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.AlloySmelter), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.BlastFurnace), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.centrifuge), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.chargeBench), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ChemicalReactor), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ChunkLoader), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ComputerCube), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.DieselGenerator), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.digitalChest), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Distillationtower), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Dragoneggenergysiphoner), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ElectricCraftingTable), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.FusionCoil), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.FusionControlComputer), ""));
pageCollection.addPage(new CraftingInfoPage("BLOCK_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Gasturbine), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.IndustrialGrinder), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.heatGenerator), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.HighAdvancedMachineBlock), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_STORAGE_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Idsu), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.ImplosionCompressor), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.IndustrialElectrolyzer), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_STORAGE_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Lesu), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_STORAGE_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.LesuStorage), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.LightningRod), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.machineframe), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.MagicalAbsorber), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Magicenergeyconverter), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.MatterFabricator), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.PlasmaGenerator), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.quantumChest), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.quantumTank), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.RollingMachine), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.Semifluidgenerator), ""));
pageCollection.addPage(new CraftingInfoPage("POWER_GENERATION_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.thermalGenerator), ""));
pageCollection.addPage(new CraftingInfoPage("MACHINES_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModBlocks.VacuumFreezer), ""));
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModItems.advancedDrill), ""));
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModItems.cloakingDevice), ""));
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModItems.lapotronicOrb), ""));
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModItems.lapotronpack), ""));
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModItems.lithiumBatpack), ""));
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModItems.omniTool), ""));
pageCollection.addPage(new CraftingInfoPage("TOOLS_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModItems.rockCutter), ""));
pageCollection.addPage(new CraftingInfoPage("ITEM_PAGE." + getNextPageIndex(), pageCollection, new ItemStack(ModItems.uuMatter), ""));
return pageCollection;
}
private int getNextPageIndex() {
int i = pageIndex;
pageIndex++;
return i;
}
@Override
public void drawScreen(int mouseX, int mouseY, float par3) {
drawGuiBackgroundLayer(par3, mouseX, mouseY);
super.drawScreen(mouseX, mouseY, par3);
prepareRenderState();
GL11.glPushMatrix();
root.drawScreen(this.mc, this.guiLeft, this.guiTop, mouseX - this.guiLeft, mouseY - this.guiTop);
GL11.glPopMatrix();
restoreRenderState();
}
protected void prepareRenderState() {
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
}
protected void restoreRenderState() {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
RenderHelper.enableStandardItemLighting();
}
protected void drawGuiBackgroundLayer(float p_146976_1_, int mouseX, int mouseY) {
GL11.glPushMatrix();
GL11.glTranslated(this.guiLeft, this.guiTop, 0);
root.renderBackgroundLayer(this.mc, 0, 0, mouseX - this.guiLeft, mouseY - this.guiTop);
GL11.glPopMatrix();
}
@Override
public void setWorldAndResolution(Minecraft minecraft, int x, int y) {
super.setWorldAndResolution(minecraft, x, y);
root.setWorldAndResolution(minecraft, x, y);
}
// @Override
// public void actionPerformed(GuiButton button) {
// root.actionPerformed(button);
// }
//
//
// @Override
// public void mouseClicked(int par1, int par2, int par3) throws IOException {
// root.mouseClicked(par1, par2, par3);
// }
@Override
public void handleInput() throws IOException {
super.handleInput();
}
@Override
public void initGui() {
super.initGui();
this.guiLeft = (this.width - this.xSize) / 2;
this.guiTop = (this.height - this.ySize) / 2;
}
@Override
public boolean doesGuiPauseGame() {
return false;
}
}

View file

@ -1,62 +0,0 @@
package techreborn.manual.old;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import techreborn.manual.PageCollection;
import techreborn.manual.pages.BasePage;
import techreborn.manual.pages.TitledPage;
import techreborn.manual.util.GuiButtonTextOnly;
public class IndexPage extends TitledPage {
public IndexPage(String name, PageCollection collection) {
super(name, false, collection, "techreborn.pda.index", 518915);
}
@SuppressWarnings("unchecked")
@Override
public void initGui() {
buttonList.clear();
int row = 0;
int collum = 0;
for (BasePage page : collection.pages) {
if (page.hasIndexButton) {
String indexName = page.INDEX_NAME;
if (indexName == null && page instanceof CraftingInfoPage)
indexName = ttl(((CraftingInfoPage) page).result.getUnlocalizedName() + ".name");
else if (indexName == null) indexName = page.getReferenceName();
int colour = 0000000;
buttonList.add(new GuiButtonTextOnly(999, getXMin() + 5 + collum * 81, getYMin() + 20 + (row * 7), 82, 7, indexName, page.getReferenceName(), 6666666));
row++;
if (row > 21) {
row = 0;
collum++;
}
}
}
}
@Override
public void actionPerformed(GuiButton button) {
if (button instanceof GuiButtonTextOnly)
collection.changeActivePage(((GuiButtonTextOnly) button).LINKED_PAGE);
if (button.id == 0) collection.changeActivePage("CONTENTS");
}
@Override
public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY);
}
@Override
public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.drawScreen(minecraft, offsetX, offsetY, mouseX, mouseY);
for (int k = 0; k < this.buttonList.size(); ++k) {
if (buttonList.get(k) instanceof GuiButtonTextOnly && ((GuiButtonTextOnly) buttonList.get(k)).getIsHovering()) {
((GuiButtonTextOnly) this.buttonList.get(k)).drawButton(this.mc, mouseX + offsetX, mouseY + offsetY);
}
}
buttonList.add(new GuiButton(0, offsetX + 20, offsetY + 180, ttl("techreborn.pda.backbutton")));
}
}

View file

@ -1,67 +0,0 @@
package techreborn.manual.old;
import java.awt.Color;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import techreborn.manual.PageCollection;
import techreborn.manual.pages.BasePage;
import techreborn.manual.pages.TitledPage;
import techreborn.manual.util.GuiButtonTextOnly;
public class ItemsPage extends TitledPage {
public String PAGE;
public ItemsPage(String name, PageCollection collection, String page) {
super(name, false, collection, page, Color.white.getRGB());
PAGE = page;
}
@SuppressWarnings("unchecked")
@Override
public void initGui() {
buttonList.clear();
int row = 0;
int collum = 0;
for (BasePage page : collection.pages) {
if (page.hasIndexButton) {
String indexName = page.INDEX_NAME;
if (page.getReferenceName() != null && page.getReferenceName().contains(PAGE)) {
if (indexName == null && page instanceof CraftingInfoPage)
indexName = ttl(((CraftingInfoPage) page).result.getUnlocalizedName() + ".name");
else if (indexName == null) indexName = page.getReferenceName();
int colour = 77777777;
buttonList.add(new GuiButtonTextOnly(999, getXMin() + 20 + collum * 120, getYMin() + 20 + (row * 7), 82, 7, indexName, page.getReferenceName(), 6666666));
row++;
if (row > 21) {
row = 0;
collum++;
}
}
}
}
buttonList.add(new GuiButton(1, getXMin() + 20, getYMin() + 180, ttl("techreborn.pda.backbutton")));
}
@Override
public void actionPerformed(GuiButton button) {
if (button instanceof GuiButtonTextOnly)
collection.changeActivePage(((GuiButtonTextOnly) button).LINKED_PAGE);
if (button.id == 1) collection.changeActivePage("CONTENTS");
}
@Override
public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY);
}
@Override
public void drawScreen(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.drawScreen(minecraft, offsetX, offsetY, mouseX, mouseY);
for (int k = 0; k < this.buttonList.size(); ++k) {
if (buttonList.get(k) instanceof GuiButtonTextOnly && ((GuiButtonTextOnly) buttonList.get(k)).getIsHovering()) {
((GuiButtonTextOnly) this.buttonList.get(k)).drawButton(this.mc, mouseX + offsetX, mouseY + offsetY);
}
}
}
}

View file

@ -1,98 +0,0 @@
package techreborn.manual.old;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.util.ResourceLocation;
import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.init.ModBlocks;
import techreborn.manual.PageCollection;
import techreborn.manual.pages.TitledPage;
import techreborn.proxies.ClientProxy;
import java.awt.*;
public class MultiBlockPage extends TitledPage {
public static ResourceLocation test = new ResourceLocation("techreborn:textures/pda/multiblocks/base.png");
public MultiBlockPage(String name, PageCollection collection, String unlocalizedTitle) {
super(name, false, collection, unlocalizedTitle, Color.white.getRGB());
}
@Override
public void initGui() {
super.initGui();
GuiButton button = new GuiButton(212, getXMin() + 30, getYMin() + 140, "Show multiblock in world");
buttonList.add(button);
if (ClientProxy.multiblockRenderEvent.currentMultiblock != null) {
button.displayString = "Hide multiblock in world";
}
}
@Override
public void drawBackground(int p_146278_1_) {
super.drawBackground(p_146278_1_);
}
@Override
public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.renderOverlayComponents(minecraft, offsetX, offsetY, mouseX, mouseY);
drawCenteredString(fontRendererObj, ttl("techreborn.pda.multiblock.decripion"), offsetX + 128, offsetY + 20, Color.white.getRGB());
}
@Override
public void actionPerformed(GuiButton button) {
super.actionPerformed(button);
if (button.id == 212) {
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) {
{//This code here makes a basic multiblock and then sets to the selected one.
Multiblock multiblock = new Multiblock();
multiblock.addComponent(0, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 3, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, 1, ModBlocks.MachineCasing, 0);
MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
}
button.displayString = "Hide multiblock in world";
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
button.displayString = "Show multiblock in world";
}
}
}
}

View file

@ -1,63 +0,0 @@
package techreborn.manual.old;
import net.minecraft.client.Minecraft;
import org.lwjgl.opengl.GL11;
import techreborn.Core;
import techreborn.lib.ModInfo;
import techreborn.manual.PageCollection;
import techreborn.manual.pages.TitledPage;
import java.awt.*;
import java.util.ArrayList;
public class VersionPage extends TitledPage {
public VersionPage(String name, PageCollection collection, String unlocalizedTitle, int colour) {
super(name, false, collection, unlocalizedTitle, Color.white.getRGB());
}
@Override
public void initGui() {
super.initGui();
}
@Override
public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.renderOverlayComponents(minecraft, offsetX, offsetY, mouseX, mouseY);
addDescription(mc, offsetX, offsetY);
addChangelog(mc, offsetX, offsetY);
addChangelog2(mc, offsetX, offsetY);
}
@Override
public void renderBackgroundLayer(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
super.renderBackgroundLayer(minecraft, offsetX, offsetY, mouseX, mouseY);
}
public void addDescription(Minecraft minecraft, int offsetX, int offsetY) {
GL11.glPushMatrix();
this.drawCenteredString(minecraft.fontRendererObj, "INSTALLED VERSION " + ModInfo.MOD_VERSION, offsetX + 120, offsetY + 20, 7777777);
this.drawCenteredString(minecraft.fontRendererObj, "LATEST VERSION " + "TODO", offsetX + 120, offsetY + 40, 7777777);
GL11.glPopMatrix();
}
public void addChangelog(Minecraft minecraft, int offsetX, int offsetY) {
GL11.glPushMatrix();
this.drawCenteredString(minecraft.fontRendererObj, "CHANGELOG", offsetX + 120, getYMin() + 50, 7777777);
GL11.glPopMatrix();
}
public void addChangelog2(Minecraft minecraft, int offsetX, int offsetY) {
ArrayList<String> changeLog = Core.INSTANCE.versionChecker.getChangeLogSinceCurrentVersion();
GL11.glPushMatrix();
GL11.glScalef(0.7F, 0.7F, 0.7F);
int y = offsetY + 105;
for (String change : changeLog) {
drawCenteredString(minecraft.fontRendererObj, change, offsetX + 230, y, Color.white.getRGB());
y += 10;
}
GL11.glPopMatrix();
}
}