Merge branch '1.8.9' of https://github.com/TechReborn/TechReborn into 1.8.9
This commit is contained in:
commit
9a1136fe25
30 changed files with 423 additions and 81 deletions
|
@ -22,7 +22,7 @@ public class BlockComputerCube extends BlockMachineBase implements IAdvancedRota
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z,
|
public boolean onBlockActivated(World world, int x, int y, int z,
|
||||||
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||||
if (!player.isSneaking())
|
if (!player.isSneaking())
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.pdaID, world, x,
|
player.openGui(Core.INSTANCE, GuiHandler.manuelID, world, x,
|
||||||
y, z);
|
y, z);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import net.minecraft.world.World;
|
||||||
import net.minecraftforge.fml.common.network.IGuiHandler;
|
import net.minecraftforge.fml.common.network.IGuiHandler;
|
||||||
import techreborn.client.container.*;
|
import techreborn.client.container.*;
|
||||||
import techreborn.client.gui.*;
|
import techreborn.client.gui.*;
|
||||||
import techreborn.pda.GuiManual;
|
import techreborn.manual.GuiManual;
|
||||||
import techreborn.tiles.*;
|
import techreborn.tiles.*;
|
||||||
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
import techreborn.tiles.fusionReactor.TileEntityFusionController;
|
||||||
import techreborn.tiles.generator.TileDieselGenerator;
|
import techreborn.tiles.generator.TileDieselGenerator;
|
||||||
|
@ -32,7 +32,7 @@ public class GuiHandler implements IGuiHandler {
|
||||||
public static final int industrialGrinderID = 7;
|
public static final int industrialGrinderID = 7;
|
||||||
public static final int implosionCompresserID = 8;
|
public static final int implosionCompresserID = 8;
|
||||||
public static final int matterfabID = 9;
|
public static final int matterfabID = 9;
|
||||||
public static final int pdaID = 10;
|
public static final int manuelID = 10;
|
||||||
public static final int chunkloaderID = 11;
|
public static final int chunkloaderID = 11;
|
||||||
public static final int assemblingmachineID = 12;
|
public static final int assemblingmachineID = 12;
|
||||||
public static final int dieselGeneratorID = 15;
|
public static final int dieselGeneratorID = 15;
|
||||||
|
@ -121,7 +121,7 @@ public class GuiHandler implements IGuiHandler {
|
||||||
} else if (ID == chemicalReactorID) {
|
} else if (ID == chemicalReactorID) {
|
||||||
return new ContainerChemicalReactor(
|
return new ContainerChemicalReactor(
|
||||||
(TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)), player);
|
(TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)), player);
|
||||||
} else if (ID == pdaID) {
|
} else if (ID == manuelID) {
|
||||||
return null;
|
return null;
|
||||||
} else if (ID == destructoPackID) {
|
} else if (ID == destructoPackID) {
|
||||||
return new ContainerDestructoPack(player);
|
return new ContainerDestructoPack(player);
|
||||||
|
@ -217,7 +217,7 @@ public class GuiHandler implements IGuiHandler {
|
||||||
} else if (ID == chemicalReactorID) {
|
} else if (ID == chemicalReactorID) {
|
||||||
return new GuiChemicalReactor(player,
|
return new GuiChemicalReactor(player,
|
||||||
(TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)));
|
(TileChemicalReactor) world.getTileEntity(new BlockPos(x, y, z)));
|
||||||
} else if (ID == pdaID) {
|
} else if (ID == manuelID) {
|
||||||
return new GuiManual();
|
return new GuiManual();
|
||||||
} else if (ID == destructoPackID) {
|
} else if (ID == destructoPackID) {
|
||||||
return new GuiDestructoPack(new ContainerDestructoPack(player));
|
return new GuiDestructoPack(new ContainerDestructoPack(player));
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class ModItems {
|
||||||
public static Item lithiumBattery;
|
public static Item lithiumBattery;
|
||||||
public static Item omniTool;
|
public static Item omniTool;
|
||||||
public static Item lapotronicOrb;
|
public static Item lapotronicOrb;
|
||||||
public static Item manuel;
|
public static Item manual;
|
||||||
public static Item uuMatter;
|
public static Item uuMatter;
|
||||||
public static Item plate;
|
public static Item plate;
|
||||||
public static Item crushedOre;
|
public static Item crushedOre;
|
||||||
|
@ -122,8 +122,8 @@ public class ModItems {
|
||||||
omniTool = PoweredItem.createItem(ItemOmniTool.class);
|
omniTool = PoweredItem.createItem(ItemOmniTool.class);
|
||||||
GameRegistry.registerItem(omniTool, "omniTool");
|
GameRegistry.registerItem(omniTool, "omniTool");
|
||||||
|
|
||||||
manuel = new ItemTechPda();
|
manual = new ItemTechManual();
|
||||||
GameRegistry.registerItem(manuel, "techmanuel");
|
GameRegistry.registerItem(manual, "techmanuel");
|
||||||
uuMatter = new ItemUUmatter();
|
uuMatter = new ItemUUmatter();
|
||||||
GameRegistry.registerItem(uuMatter, "uumatter");
|
GameRegistry.registerItem(uuMatter, "uumatter");
|
||||||
reBattery = PoweredItem.createItem(ItemReBattery.class);
|
reBattery = PoweredItem.createItem(ItemReBattery.class);
|
||||||
|
|
|
@ -1237,7 +1237,7 @@ public class
|
||||||
}
|
}
|
||||||
|
|
||||||
static void addIc2Recipes(){
|
static void addIc2Recipes(){
|
||||||
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.manuel), TechRebornAPI.recipeCompact.getItem("plateiron"), Items.book);
|
CraftingHelper.addShapelessOreRecipe(new ItemStack(ModItems.manual), TechRebornAPI.recipeCompact.getItem("plateiron"), Items.book);
|
||||||
|
|
||||||
CraftingHelper.addShapedOreRecipe(
|
CraftingHelper.addShapedOreRecipe(
|
||||||
ItemParts.getPartByName("machineParts", 16),
|
ItemParts.getPartByName("machineParts", 16),
|
||||||
|
|
|
@ -8,18 +8,18 @@ import techreborn.client.GuiHandler;
|
||||||
import techreborn.client.TechRebornCreativeTab;
|
import techreborn.client.TechRebornCreativeTab;
|
||||||
import techreborn.items.ItemTextureBase;
|
import techreborn.items.ItemTextureBase;
|
||||||
|
|
||||||
public class ItemTechPda extends ItemTextureBase {
|
public class ItemTechManual extends ItemTextureBase {
|
||||||
|
|
||||||
public ItemTechPda() {
|
public ItemTechManual() {
|
||||||
setCreativeTab(TechRebornCreativeTab.instance);
|
setCreativeTab(TechRebornCreativeTab.instance);
|
||||||
setUnlocalizedName("techreborn.pda");
|
setUnlocalizedName("techreborn.manual");
|
||||||
setMaxStackSize(1);
|
setMaxStackSize(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) {
|
||||||
player.openGui(Core.INSTANCE, GuiHandler.pdaID, world,
|
player.openGui(Core.INSTANCE, GuiHandler.manuelID, world,
|
||||||
(int) player.posX, (int) player.posY, (int) player.posY);
|
(int) player.posX, (int) player.posY, (int) player.posY);
|
||||||
return itemStack;
|
return itemStack;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ public class ItemTechPda extends ItemTextureBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTextureName(int damage) {
|
public String getTextureName(int damage) {
|
||||||
return "techreborn:items/tool/pda";
|
return "mineacraft:book";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
135
src/main/java/techreborn/manual/GuiManual.java
Normal file
135
src/main/java/techreborn/manual/GuiManual.java
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
package techreborn.manual;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
import techreborn.manual.pages.ContentsPage;
|
||||||
|
import techreborn.manual.pages.DescriptionPage;
|
||||||
|
import techreborn.manual.pages.GettingStartedPage;
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public class GuiManual 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 GuiManual()
|
||||||
|
{
|
||||||
|
this.xSize = 146;
|
||||||
|
this.ySize = 180;
|
||||||
|
root = createRoot();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected PageCollection createRoot()
|
||||||
|
{
|
||||||
|
pageIndex = 0;
|
||||||
|
final PageCollection pageCollection = new PageCollection();
|
||||||
|
pageCollection.addPage(new ContentsPage("CONTENTS", pageCollection));
|
||||||
|
pageCollection.addPage(new GettingStartedPage(Reference.pageNames.GETTINGSTARTED_PAGE, pageCollection));
|
||||||
|
pageCollection.addPage(new DescriptionPage(Reference.pageNames.GETTINGRUBBER_PAGE, pageCollection, true));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,14 +1,15 @@
|
||||||
package techreborn.pda;
|
package techreborn.manual;
|
||||||
|
|
||||||
import com.google.common.collect.Lists;
|
|
||||||
import net.minecraft.client.Minecraft;
|
|
||||||
import net.minecraft.client.gui.Gui;
|
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import techreborn.pda.pages.BasePage;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
import techreborn.manual.pages.BasePage;
|
||||||
|
|
||||||
public class PageCollection extends Gui {
|
public class PageCollection extends Gui {
|
||||||
|
|
||||||
public final List<BasePage> pages = Lists.newArrayList();
|
public final List<BasePage> pages = Lists.newArrayList();
|
14
src/main/java/techreborn/manual/Reference.java
Normal file
14
src/main/java/techreborn/manual/Reference.java
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
package techreborn.manual;
|
||||||
|
|
||||||
|
public class Reference
|
||||||
|
{
|
||||||
|
public static final String CONTENTS_KEY = "techreborn.manual.contents";
|
||||||
|
public static final String GETTINGSTARTED_KEY = "techreborn.manual.gettingstarted";
|
||||||
|
public static final String GETTINGRUBBER_KEY = "techreborn.manual.gettingrubber";
|
||||||
|
|
||||||
|
public class pageNames
|
||||||
|
{
|
||||||
|
public static final String GETTINGSTARTED_PAGE = "gettingstarted";
|
||||||
|
public static final String GETTINGRUBBER_PAGE = "gettingrubber";
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,4 +1,6 @@
|
||||||
package techreborn.pda.pages;
|
package techreborn.manual.old;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
@ -6,14 +8,13 @@ import net.minecraft.item.ItemStack;
|
||||||
import techreborn.config.TechRebornConfigGui;
|
import techreborn.config.TechRebornConfigGui;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.init.ModItems;
|
import techreborn.init.ModItems;
|
||||||
import techreborn.pda.PageCollection;
|
import techreborn.manual.PageCollection;
|
||||||
import techreborn.pda.util.GuiButtonCustomTexture;
|
import techreborn.manual.pages.TitledPage;
|
||||||
|
import techreborn.manual.util.GuiButtonCustomTexture;
|
||||||
|
|
||||||
import java.awt.*;
|
public class ContentsPageOld extends TitledPage {
|
||||||
|
|
||||||
public class ContentsPage extends TitledPage {
|
public ContentsPageOld(String name, PageCollection collection) {
|
||||||
|
|
||||||
public ContentsPage(String name, PageCollection collection) {
|
|
||||||
super(name, false, collection, "techreborn.pda.contents", Color.white.getRGB());
|
super(name, false, collection, "techreborn.pda.contents", Color.white.getRGB());
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package techreborn.pda.pages;
|
package techreborn.manual.old;
|
||||||
|
|
||||||
import com.google.common.base.Objects;
|
import com.google.common.base.Objects;
|
||||||
import com.google.common.base.Strings;
|
import com.google.common.base.Strings;
|
||||||
|
@ -14,8 +14,10 @@ import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||||
|
import techreborn.manual.PageCollection;
|
||||||
|
import techreborn.manual.pages.TitledPage;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import techreborn.pda.PageCollection;
|
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
|
@ -1,23 +1,24 @@
|
||||||
package techreborn.pda;
|
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.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
import org.lwjgl.opengl.GL11;
|
|
||||||
import org.lwjgl.opengl.GL12;
|
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.init.ModItems;
|
import techreborn.init.ModItems;
|
||||||
import techreborn.pda.pages.*;
|
import techreborn.manual.PageCollection;
|
||||||
|
import techreborn.manual.pages.ContentsPage;
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public class GuiManual extends GuiScreen {
|
public class GuiManualOld extends GuiScreen {
|
||||||
|
|
||||||
protected final PageCollection root;
|
protected final PageCollection root;
|
||||||
protected int pageIndex = 0;
|
protected int pageIndex = 0;
|
||||||
|
@ -27,7 +28,7 @@ public class GuiManual extends GuiScreen {
|
||||||
protected int guiLeft;
|
protected int guiLeft;
|
||||||
protected int guiTop;
|
protected int guiTop;
|
||||||
|
|
||||||
public GuiManual() {
|
public GuiManualOld() {
|
||||||
this.xSize = 256;
|
this.xSize = 256;
|
||||||
this.ySize = 202;
|
this.ySize = 202;
|
||||||
root = createRoot();
|
root = createRoot();
|
||||||
|
@ -145,16 +146,16 @@ public class GuiManual extends GuiScreen {
|
||||||
root.setWorldAndResolution(minecraft, x, y);
|
root.setWorldAndResolution(minecraft, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
// @Override
|
||||||
public void actionPerformed(GuiButton button) {
|
// public void actionPerformed(GuiButton button) {
|
||||||
root.actionPerformed(button);
|
// root.actionPerformed(button);
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public void mouseClicked(int par1, int par2, int par3) throws IOException {
|
// public void mouseClicked(int par1, int par2, int par3) throws IOException {
|
||||||
root.mouseClicked(par1, par2, par3);
|
// root.mouseClicked(par1, par2, par3);
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleInput() throws IOException {
|
public void handleInput() throws IOException {
|
|
@ -1,9 +1,11 @@
|
||||||
package techreborn.pda.pages;
|
package techreborn.manual.old;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import techreborn.pda.PageCollection;
|
import techreborn.manual.PageCollection;
|
||||||
import techreborn.pda.util.GuiButtonTextOnly;
|
import techreborn.manual.pages.BasePage;
|
||||||
|
import techreborn.manual.pages.TitledPage;
|
||||||
|
import techreborn.manual.util.GuiButtonTextOnly;
|
||||||
|
|
||||||
public class IndexPage extends TitledPage {
|
public class IndexPage extends TitledPage {
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package techreborn.pda.pages;
|
package techreborn.manual.old;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import techreborn.pda.PageCollection;
|
import techreborn.manual.PageCollection;
|
||||||
import techreborn.pda.util.GuiButtonTextOnly;
|
import techreborn.manual.pages.BasePage;
|
||||||
|
import techreborn.manual.pages.TitledPage;
|
||||||
import java.awt.*;
|
import techreborn.manual.util.GuiButtonTextOnly;
|
||||||
|
|
||||||
public class ItemsPage extends TitledPage {
|
public class ItemsPage extends TitledPage {
|
||||||
public String PAGE;
|
public String PAGE;
|
|
@ -1,4 +1,4 @@
|
||||||
package techreborn.pda.pages;
|
package techreborn.manual.old;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
@ -6,7 +6,8 @@ import net.minecraft.util.ResourceLocation;
|
||||||
import reborncore.client.multiblock.Multiblock;
|
import reborncore.client.multiblock.Multiblock;
|
||||||
import reborncore.client.multiblock.MultiblockSet;
|
import reborncore.client.multiblock.MultiblockSet;
|
||||||
import techreborn.init.ModBlocks;
|
import techreborn.init.ModBlocks;
|
||||||
import techreborn.pda.PageCollection;
|
import techreborn.manual.PageCollection;
|
||||||
|
import techreborn.manual.pages.TitledPage;
|
||||||
import techreborn.proxies.ClientProxy;
|
import techreborn.proxies.ClientProxy;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
|
@ -1,10 +1,11 @@
|
||||||
package techreborn.pda.pages;
|
package techreborn.manual.old;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import techreborn.Core;
|
import techreborn.Core;
|
||||||
import techreborn.lib.ModInfo;
|
import techreborn.lib.ModInfo;
|
||||||
import techreborn.pda.PageCollection;
|
import techreborn.manual.PageCollection;
|
||||||
|
import techreborn.manual.pages.TitledPage;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
|
@ -1,11 +1,11 @@
|
||||||
package techreborn.pda.pages;
|
package techreborn.manual.pages;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.GuiButton;
|
import net.minecraft.client.gui.GuiButton;
|
||||||
import net.minecraft.client.gui.GuiScreen;
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.util.StatCollector;
|
import net.minecraft.util.StatCollector;
|
||||||
import techreborn.pda.PageCollection;
|
import techreborn.manual.PageCollection;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -16,9 +16,9 @@ public class BasePage extends GuiScreen {
|
||||||
//Name Displayed in the index page
|
//Name Displayed in the index page
|
||||||
public String INDEX_NAME;
|
public String INDEX_NAME;
|
||||||
public boolean hasIndexButton = false;
|
public boolean hasIndexButton = false;
|
||||||
public static final ResourceLocation PAGE_TEXTURE = new ResourceLocation("techreborn:textures/pda/gui/pda.png");
|
public static final ResourceLocation PAGE_TEXTURE = new ResourceLocation("techreborn:textures/manual/gui/manual.png");
|
||||||
private final int xSize = 256;
|
private final int xSize = 146;
|
||||||
private final int ySize = 202;
|
private final int ySize = 180;
|
||||||
protected PageCollection collection;
|
protected PageCollection collection;
|
||||||
|
|
||||||
public BasePage() {
|
public BasePage() {
|
||||||
|
@ -62,7 +62,7 @@ public class BasePage extends GuiScreen {
|
||||||
@Override
|
@Override
|
||||||
public void initGui() {
|
public void initGui() {
|
||||||
buttonList.clear();
|
buttonList.clear();
|
||||||
buttonList.add(new GuiButton(0, getXMin() + 88, getYMin() + 181, 80, 16, ttl("techreborn.pda.backbutton")));
|
buttonList.add(new GuiButton(0, getXMin() + 30, getYMin() + 150, 80, 16, ttl("techreborn.manual.backbutton")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReferenceName(String name) {
|
public void setReferenceName(String name) {
|
43
src/main/java/techreborn/manual/pages/ContentsPage.java
Normal file
43
src/main/java/techreborn/manual/pages/ContentsPage.java
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
package techreborn.manual.pages;
|
||||||
|
|
||||||
|
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.items.ItemPlates;
|
||||||
|
import techreborn.manual.PageCollection;
|
||||||
|
import techreborn.manual.Reference;
|
||||||
|
import techreborn.manual.util.GuiButtonCustomTexture;
|
||||||
|
|
||||||
|
public class ContentsPage extends TitledPage
|
||||||
|
{
|
||||||
|
public ContentsPage(String name, PageCollection collection)
|
||||||
|
{
|
||||||
|
super(name, false, collection, Reference.CONTENTS_KEY, Color.white.getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
@Override
|
||||||
|
public void initGui()
|
||||||
|
{
|
||||||
|
buttonList.clear();
|
||||||
|
buttonList.add(new GuiButtonCustomTexture(0, getXMin() + 25, getYMin() + 20, 0, 46, 100, 20, ItemPlates.getPlateByName("iron"),
|
||||||
|
Reference.pageNames.GETTINGSTARTED_PAGE, ttl(Reference.GETTINGSTARTED_KEY)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@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(Reference.pageNames.GETTINGSTARTED_PAGE);
|
||||||
|
}
|
||||||
|
}
|
106
src/main/java/techreborn/manual/pages/DescriptionPage.java
Normal file
106
src/main/java/techreborn/manual/pages/DescriptionPage.java
Normal file
|
@ -0,0 +1,106 @@
|
||||||
|
package techreborn.manual.pages;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.google.common.base.Strings;
|
||||||
|
import com.google.common.collect.ImmutableList;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.FontRenderer;
|
||||||
|
import net.minecraft.client.gui.GuiScreen;
|
||||||
|
import net.minecraft.client.renderer.texture.TextureManager;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import techreborn.manual.PageCollection;
|
||||||
|
import techreborn.manual.Reference;
|
||||||
|
|
||||||
|
public class DescriptionPage extends TitledPage
|
||||||
|
{
|
||||||
|
public boolean hasImage;
|
||||||
|
private String rawDescription;
|
||||||
|
private List<String> formattedDescription;
|
||||||
|
private float descriptionScale = 0.88f;
|
||||||
|
|
||||||
|
public String imageprefix = "techreborn:textures/manual/screenshots/";
|
||||||
|
|
||||||
|
public DescriptionPage(String name, PageCollection collection, boolean hasImage)
|
||||||
|
{
|
||||||
|
super(name, false, collection, Reference.GETTINGSTARTED_KEY, Color.white.getRGB());
|
||||||
|
this.hasImage = hasImage;
|
||||||
|
this.rawDescription = "techreborn.manual." + this.getReferenceName() + ".description";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY)
|
||||||
|
{
|
||||||
|
if(hasImage)
|
||||||
|
{
|
||||||
|
renderImage(offsetX, offsetY);
|
||||||
|
addDescription(mc, offsetX, offsetY + 50);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
addDescription(mc, offsetX, offsetY);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void renderImage(int offsetX, int offsetY)
|
||||||
|
{
|
||||||
|
TextureManager render = Minecraft.getMinecraft().renderEngine;
|
||||||
|
render.bindTexture(new ResourceLocation(imageprefix + this.getReferenceName() + ".png"));
|
||||||
|
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||||
|
drawTexturedModalRect(offsetX, offsetY - 16, 0, 0, 120, this.height);
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addDescription(Minecraft minecraft, int offsetX, int offsetY)
|
||||||
|
{
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslated(offsetX + 15, 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.black.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, 130));
|
||||||
|
return formattedDescription;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<String> segments = new ArrayList();
|
||||||
|
String raw = rawDescription;
|
||||||
|
|
||||||
|
for (String s : segments)
|
||||||
|
formattedDescription.addAll(ImmutableList.copyOf(fr.listFormattedStringToWidth(s, 370)));
|
||||||
|
}
|
||||||
|
return formattedDescription;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package techreborn.manual.pages;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
|
||||||
|
import net.minecraft.client.gui.GuiButton;
|
||||||
|
import techreborn.items.ItemParts;
|
||||||
|
import techreborn.items.ItemPlates;
|
||||||
|
import techreborn.manual.PageCollection;
|
||||||
|
import techreborn.manual.Reference;
|
||||||
|
import techreborn.manual.util.GuiButtonCustomTexture;
|
||||||
|
|
||||||
|
public class GettingStartedPage extends TitledPage
|
||||||
|
{
|
||||||
|
public GettingStartedPage(String name, PageCollection collection)
|
||||||
|
{
|
||||||
|
super(name, false, collection, Reference.GETTINGSTARTED_KEY, Color.white.getRGB());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initGui()
|
||||||
|
{
|
||||||
|
buttonList.clear();
|
||||||
|
buttonList.add(new GuiButtonCustomTexture(0, getXMin() + 25, getYMin() + 20, 0, 46, 100, 20, ItemParts.getPartByName("rubberSap"),
|
||||||
|
Reference.pageNames.GETTINGRUBBER_PAGE, ttl(Reference.GETTINGRUBBER_KEY)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed(GuiButton button)
|
||||||
|
{
|
||||||
|
if (button.id == 0) collection.changeActivePage(Reference.pageNames.GETTINGRUBBER_PAGE);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,7 +1,7 @@
|
||||||
package techreborn.pda.pages;
|
package techreborn.manual.pages;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import techreborn.pda.PageCollection;
|
import techreborn.manual.PageCollection;
|
||||||
|
|
||||||
public class TitledPage extends BasePage {
|
public class TitledPage extends BasePage {
|
||||||
private String title;
|
private String title;
|
||||||
|
@ -17,6 +17,6 @@ public class TitledPage extends BasePage {
|
||||||
@Override
|
@Override
|
||||||
public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
public void renderOverlayComponents(Minecraft minecraft, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||||
if (title == null) title = INDEX_NAME;
|
if (title == null) title = INDEX_NAME;
|
||||||
if (drawTitle) drawCenteredString(minecraft.fontRendererObj, ttl(title), offsetX + 128, offsetY + 5, colour);
|
if (drawTitle) drawCenteredString(minecraft.fontRendererObj, ttl(title), offsetX + 70, offsetY + 10, colour);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package techreborn.pda.util;
|
package techreborn.manual.util;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
|
@ -1,7 +1,8 @@
|
||||||
package techreborn.pda.util;
|
package techreborn.manual.util;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.fml.client.config.GuiButtonExt;
|
import net.minecraftforge.fml.client.config.GuiButtonExt;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
@ -45,7 +46,8 @@ public class GuiButtonCustomTexture extends GuiButtonExt {
|
||||||
GL11.glEnable(32826);
|
GL11.glEnable(32826);
|
||||||
RenderHelper.enableStandardItemLighting();
|
RenderHelper.enableStandardItemLighting();
|
||||||
RenderHelper.enableGUIStandardItemLighting();
|
RenderHelper.enableGUIStandardItemLighting();
|
||||||
//RenderItem.getInstance().renderItemIntoGUI(mc.fontRendererObj, mc.renderEngine, itemstack, this.xPosition, this.yPosition); //TODO 1.8
|
RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();
|
||||||
|
itemRenderer.renderItemIntoGUI(itemstack, this.xPosition, this.yPosition);
|
||||||
this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3, Color.white.getRGB());
|
this.drawString(mc.fontRendererObj, this.NAME, this.xPosition + 20, this.yPosition + 3, Color.white.getRGB());
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package techreborn.pda.util;
|
package techreborn.manual.util;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.gui.FontRenderer;
|
import net.minecraft.client.gui.FontRenderer;
|
|
@ -626,7 +626,7 @@ item.bucketwolframium.name=Wolframium Bucket
|
||||||
|
|
||||||
#Items
|
#Items
|
||||||
item.techreborn.uuMatter.name=UU-Matter
|
item.techreborn.uuMatter.name=UU-Matter
|
||||||
item.techreborn.pda.name=PDA
|
item.techreborn.manual.name=Tech manual
|
||||||
|
|
||||||
#Configs
|
#Configs
|
||||||
config.techreborn.allow.galenaOre=Allow Galena Ore
|
config.techreborn.allow.galenaOre=Allow Galena Ore
|
||||||
|
@ -912,12 +912,11 @@ Cable.trippleInsulatedIronCable.name=Triple Insulated Copper Cable
|
||||||
Cable.glassFiberCable.name=Glass Fiber Cable
|
Cable.glassFiberCable.name=Glass Fiber Cable
|
||||||
Cable.tinCable.name=Tin Cable
|
Cable.tinCable.name=Tin Cable
|
||||||
|
|
||||||
#PDA
|
#Manual
|
||||||
techreborn.pda.contents=Contents Page
|
techreborn.manual.contents=Contents Page
|
||||||
techreborn.pda.itemspage=Items
|
techreborn.manual.gettingstarted=Getting Started
|
||||||
techreborn.pda.blockspage=Blocks
|
techreborn.manual.gettingrubber=Collecting Rubber
|
||||||
techreborn.pda.index=Index
|
techreborn.manual.backbutton=Back
|
||||||
techreborn.pda.backbutton=BACK
|
|
||||||
|
|
||||||
item.techreborn.advancedDrill.description=This Tool is a advanced version of the mining drill, when this item is activated it will dig out a 3x3.
|
item.techreborn.advancedDrill.description=This Tool is a advanced version of the mining drill, when this item is activated it will dig out a 3x3.
|
||||||
tile.techreborn.alloyfurnace.description=This Machine is your first step into TechReborn with this you can fuse metals into other metals. These other metals can be used to craft the higher tier machines.
|
tile.techreborn.alloyfurnace.description=This Machine is your first step into TechReborn with this you can fuse metals into other metals. These other metals can be used to craft the higher tier machines.
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 38 KiB |
Binary file not shown.
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.5 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.6 KiB |
Loading…
Reference in a new issue