summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/client
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-08-13 21:12:11 +0100
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-08-13 21:12:11 +0100
commit0ef6a00aa79f022e5bd56b3f77e6861bbecf6d94 (patch)
tree03966c83cd16d1912ec1596d83f89f251cc35f83 /src/main/java/darkknight/jewelrycraft/client
parent921f1ba6f30e66c80c803618ebff496778e78970 (diff)
Added a new structure, a new curse, achievements, challenges, curses
entry in the guide; reworked liquids to be tile entities, cleaned the structures code, potion code and... you know what? I improved and changed so much stuff that I literally forgot what I did...
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/client')
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/Page.java364
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/TabCurses.java2
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java202
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java424
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java84
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java89
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java188
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java114
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java28
-rw-r--r--src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java184
10 files changed, 873 insertions, 806 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/client/Page.java b/src/main/java/darkknight/jewelrycraft/client/Page.java
index d117fb7..d1ca8fd 100644
--- a/src/main/java/darkknight/jewelrycraft/client/Page.java
+++ b/src/main/java/darkknight/jewelrycraft/client/Page.java
@@ -1,198 +1,166 @@
-package darkknight.jewelrycraft.client;
-
-import java.util.ArrayList;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.RenderHelper;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.ResourceLocation;
-import org.lwjgl.opengl.GL11;
-import org.lwjgl.opengl.GL12;
-import darkknight.jewelrycraft.client.gui.GuiGuide;
-import darkknight.jewelrycraft.util.Variables;
-
-public class Page
-{
- static ResourceLocation pageFlipped = new ResourceLocation(Variables.MODID, "textures/gui/guidePageFlip.png");
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param isSmall
- * @param text
- * @param mouseX
- * @param mouseY
- * @param items
- */
- public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items)
- {
- y += 5;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0);
- GL11.glColor4f(1, 1, 1, 1);
- Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
- ArrayList<String> name = new ArrayList<String>();
- if (isSmall){
- gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46);
- gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate, 0, 0, 0);
- for(int i = 1; i <= 4; i++)
- if (items.length > i && items[i] != null){
- int posX = x + 8 + (i - 1) % 2 * 22;
- int posY = y + 26 + (i - 1) / 2 * 22;
- gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
- name.add(items[i].getDisplayName());
- if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14);
- name.removeAll(name);
- GL11.glDisable(GL11.GL_LIGHTING);
- }
- drawText(gui, text, x, y + 25);
- }else{
- gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54);
- gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate, 0, 0, 0);
- for(int i = 1; i <= 9; i++)
- if (items.length > i && items[i] != null){
- int posX = x + 8 + (i - 1) % 3 * 19;
- int posY = y + 22 + (i - 1) / 3 * 17;
- gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
- name.add(items[i].getDisplayName());
- if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12);
- name.removeAll(name);
- GL11.glDisable(GL11.GL_LIGHTING);
- }
- drawText(gui, text, x, y + 32);
- GL11.glColor4f(1, 1, 1, 1);
- }
- GL11.glDisable(GL11.GL_BLEND);
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param text
- * @param mouseX
- * @param mouseY
- * @param items
- */
- public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items)
- {
- ArrayList<String> name = new ArrayList<String>();
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0);
- GL11.glColor4f(1, 1, 1, 1);
- Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52);
- gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate, 0, 0, 0);
- name.add(items[0].getDisplayName());
- if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20);
- name.removeAll(name);
- GL11.glDisable(GL11.GL_LIGHTING);
- gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate, 0, 0, 0);
- drawText(gui, text, x, y + 30);
- GL11.glColor4f(1, 1, 1, 1);
- GL11.glDisable(GL11.GL_BLEND);
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param item
- * @param text
- * @param size
- */
- public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate)
- {
- y += 5;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0);
- GL11.glColor4f(1, 1, 1, 1);
- gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0, 0);
- drawText(gui, text, x - 2, y - (int)(250 / size));
- GL11.glDisable(GL11.GL_BLEND);
- }
-
- public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item, float xRot, float yRot, float zRot)
- {
- ArrayList<String> name = new ArrayList<String>();
- GL11.glColor4f(1, 1, 1, 1);
- Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12);
- if(item.getItem() != null){
- name.add(item.getDisplayName());
- if (mouseX >= x + 10 && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 10);
- name.removeAll(name);
- }
- GL11.glDisable(GL11.GL_LIGHTING);
- GL11.glColor4f(1, 1, 1, 1);
- if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false, xRot, yRot, zRot);
- GL11.glDisable(GL11.GL_BLEND);
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param item
- * @param text
- * @param size
- * @param txtX
- * @param txtY
- * @param showName
- * @param imgX
- * @param imgY
- */
- public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate)
- {
- y += 5;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName().substring(0, item.getDisplayName().length() > 23?23:item.getDisplayName().length()), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0);
- GL11.glColor4f(1, 1, 1, 1);
- gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0);
- drawText(gui, text, x + txtX, y + txtY);
- GL11.glDisable(GL11.GL_BLEND);
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param text
- */
- public static void addTextPage(GuiGuide gui, int x, int y, String text)
- {
- y -= 25;
- drawText(gui, text, x, y);
- GL11.glColor4f(1, 1, 1, 1);
- }
-
- /**
- * @param gui
- * @param text
- * @param x
- * @param y
- */
- public static void drawText(GuiGuide gui, String text, int x, int y)
- {
- String[] s = text.split(" ");
- String displayText = "";
- ArrayList<String> textLines = new ArrayList<String>();
- for(String element: s)
- if ((displayText + element + " ").length() <= 24) displayText += element + " ";
- else{
- textLines.add(displayText.trim());
- displayText = element + " ";
- }
- textLines.add(displayText.trim());
- for(int i = 0; i < textLines.size(); i++)
- gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0);
- }
-}
+package darkknight.jewelrycraft.client;
+
+import java.util.ArrayList;
+
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+
+import darkknight.jewelrycraft.client.gui.GuiGuide;
+import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.client.Minecraft;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.ResourceLocation;
+
+public class Page
+{
+ static ResourceLocation pageFlipped = new ResourceLocation(Variables.MODID, "textures/gui/guidePageFlip.png");
+
+ public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
+ ArrayList<String> name = new ArrayList<String>();
+ if (isSmall){
+ gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46);
+ gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate, 0, 0, 0);
+ for(int i = 1; i <= 4; i++)
+ if (items.length > i && items[i] != null){
+ int posX = x + 8 + (i - 1) % 2 * 22;
+ int posY = y + 26 + (i - 1) / 2 * 22;
+ gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
+ name.add(items[i].getDisplayName());
+ if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14);
+ name.removeAll(name);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ drawText(gui, text, x, y + 25);
+ }else{
+ gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54);
+ gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate, 0, 0, 0);
+ for(int i = 1; i <= 9; i++)
+ if (items.length > i && items[i] != null){
+ int posX = x + 8 + (i - 1) % 3 * 19;
+ int posY = y + 22 + (i - 1) / 3 * 17;
+ gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
+ name.add(items[i].getDisplayName());
+ if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12);
+ name.removeAll(name);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ drawText(gui, text, x, y + 32);
+ GL11.glColor4f(1, 1, 1, 1);
+ }
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items)
+ {
+ ArrayList<String> name = new ArrayList<String>();
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52);
+ gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate, 0, 0, 0);
+ name.add(items[0].getDisplayName());
+ if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20);
+ name.removeAll(name);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate, 0, 0, 0);
+ drawText(gui, text, x, y + 30);
+ GL11.glColor4f(1, 1, 1, 1);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0, 0);
+ drawText(gui, text, x - 2, y - (int)(250 / size));
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item, float xRot, float yRot, float zRot)
+ {
+ ArrayList<String> name = new ArrayList<String>();
+ GL11.glColor4f(1, 1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12);
+ if(item.getItem() != null){
+ name.add(item.getDisplayName());
+ if (mouseX >= x + 10 && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 10);
+ name.removeAll(name);
+ }
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glColor4f(1, 1, 1, 1);
+ if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false, xRot, yRot, zRot);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName().substring(0, item.getDisplayName().length() > 23?23:item.getDisplayName().length()), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0);
+ drawText(gui, text, x + txtX, y + txtY);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, String title, int imgX, int imgY, boolean rotate)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + title.substring(0, item.getDisplayName().length() > 23?23:title.length()), x + Math.abs(70 - gui.getFont().getStringWidth(title) / 2) - 10, y + 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0);
+ drawText(gui, text, x + txtX, y + txtY);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public static void addTextPage(GuiGuide gui, int x, int y, String text)
+ {
+ y -= 25;
+ drawText(gui, text, x, y);
+ GL11.glColor4f(1, 1, 1, 1);
+ }
+
+ public static void drawText(GuiGuide gui, String text, int x, int y)
+ {
+ String[] s = text.split(" ");
+ String displayText = "";
+ float scale = 0.75F;
+ ArrayList<String> textLines = new ArrayList<String>();
+ for(String element: s)
+ if ((displayText + element + " ").length() <= 31) displayText += element + " ";
+ else{
+ textLines.add(displayText.trim());
+ displayText = element + " ";
+ }
+ textLines.add(displayText.trim());
+ for(int i = 0; i < textLines.size(); i++)
+ {
+ GL11.glPushMatrix();
+ GL11.glScalef(scale, scale, 0f);
+ gui.getFont().drawString(textLines.get(i), (int)(x/scale), (int)((y + 32 + i * 9)/scale), 0);
+ GL11.glPopMatrix();
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabCurses.java b/src/main/java/darkknight/jewelrycraft/client/TabCurses.java
index e9878b0..d5e8fdd 100644
--- a/src/main/java/darkknight/jewelrycraft/client/TabCurses.java
+++ b/src/main/java/darkknight/jewelrycraft/client/TabCurses.java
@@ -10,7 +10,7 @@ public class TabCurses extends AbstractTab
{
public TabCurses()
{
- super(0, 0, 0, new ItemStack(Items.ender_eye));
+ super(0, 0, 0, new ItemStack(ItemList.testItem, 1, 4));
}
@Override
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java
index 59f5e91..752a2a7 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java
@@ -1,26 +1,36 @@
package darkknight.jewelrycraft.client.gui;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.inventory.Container;
-import net.minecraft.nbt.NBTTagCompound;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.world.World;
+import java.util.List;
+import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.api.Curse;
import darkknight.jewelrycraft.client.TabCurses;
import darkknight.jewelrycraft.client.TabRegistry;
import darkknight.jewelrycraft.events.KeyBindings;
+import darkknight.jewelrycraft.network.PacketSendClientPlayerInfo;
+import darkknight.jewelrycraft.network.PacketSendServerPlayerInfo;
+import darkknight.jewelrycraft.network.PacketSendServerPlayersInfo;
import darkknight.jewelrycraft.util.PlayerUtils;
import darkknight.jewelrycraft.util.Variables;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.EntityPlayerMP;
+import net.minecraft.inventory.Container;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import scala.swing.event.Key;
public class GuiCurseInfo extends GuiContainer {
World world;
EntityPlayer player;
ResourceLocation texture;
+ int page = 0, maxPages = 1;
+ String selectedCurse = "";
public GuiCurseInfo(Container container, World world, EntityPlayer player, ResourceLocation texture) {
super(container);
@@ -33,35 +43,6 @@ public class GuiCurseInfo extends GuiContainer {
public void drawScreen(int x, int y, float size) {
super.drawScreen(x, y, size);
- // this.drawGradientRect(0, 0, this.width, this.height, -1072689136,
- // -804253680);
- // int ind = 0;
- // if (player != null){
- // NBTTagCompound playerInfo =
- // PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
- // if (!playerInfo.hasNoTags()){
- // for(Curse curse: Curse.getCurseList())
- // if (playerInfo.getInteger(curse.getName()) > 0){
- // int halfDescrSize =
- // fontRendererObj.getStringWidth(curse.getDescription()) / 2;
- // mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
- // this.drawRect(0, 12 + ind * 34, this.width, 10 + (ind + 1) * 34,
- // 0xff000000);
- // mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID,
- // "textures/gui/" + curse.getTexturePack() + ".png"));
- // int tag = curse.getTextureID();
- // GL11.glColor3f(1F, 1F, 1F);
- // drawTexturedModalRect(this.width/2 - halfDescrSize - 35, 12 + ind *
- // 34, tag % 8 * 32, tag / 8 * 32, 32, 32);
- // this.drawString(fontRendererObj,
- // curse.getName().substring(curse.getName().indexOf(':') + 1),
- // this.width/2 - halfDescrSize, 20 + ind * 34, 0xffff00);
- // this.drawCenteredString(fontRendererObj, curse.getDescription(),
- // this.width/2, 30 + ind * 34, 0xffffff);
- // ind++;
- // }
- // }
- // }
}
@Override
@@ -69,21 +50,50 @@ public class GuiCurseInfo extends GuiContainer {
GL11.glColor3f(1, 1, 1);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
- int ind = 0;
- int size = 32;
if (player != null) {
NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
- if (!playerInfo.hasNoTags()) {
- for (Curse curse : Curse.getCurseList())
- if (playerInfo.getInteger(curse.getName()) > 0) {
+ if (!player.capabilities.isCreativeMode) maxPages = playerInfo.getInteger("activeCurses") / 5 - (playerInfo.getInteger("activeCurses") % 5 == 0 ? 1 : 0);
+ else maxPages = Curse.getCurseList().size() / 5 - (Curse.getCurseList().size() % 5 == 0 ? 1 : 0);
+ if (!player.capabilities.isCreativeMode) survivalCurses(playerInfo);
+ else creativeCurses(playerInfo);
+ if (playerInfo.hasKey("cursePoints")) this.drawString(fontRendererObj, "Curse points: " + playerInfo.getInteger("cursePoints") + " | Active curses: " + playerInfo.getInteger("activeCurses"), guiLeft, guiTop - 10, 0xffffff);
+ }
+ this.drawString(fontRendererObj, page + "/" + maxPages, guiLeft + 90, guiTop + 153, 0xffffff);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ drawTexturedModalRect(guiLeft + 5, guiTop + ySize - 14, 0, ySize, 13, 11);
+ drawTexturedModalRect(guiLeft + xSize - 38, guiTop + ySize - 14, 13, ySize, 13, 11);
+ }
+
+ private void survivalCurses(NBTTagCompound playerInfo) {
+ int size = 32;
+ int ind = 0;
+ if (!playerInfo.hasNoTags()) {
+ for (Curse curse : Curse.getCurseList()) {
+ if (playerInfo.getInteger(curse.getName()) > 0) {
+ if (ind >= page * 5 && ind < (page + 1) * 5) {
+ if (ind == page * 5 && selectedCurse == "") selectedCurse = curse.getName();
mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
- drawTexturedModalRect(guiLeft + 43, guiTop + 5 + (size - 8) * ind, 0, 32, 112, 22);
+ drawTexturedModalRect(guiLeft + 43, guiTop + 8 + (size - 8) * (ind - page * 5), 0, 32, 112, 22);
+ if (selectedCurse == curse.getName()) {
+ GL11.glPushMatrix();
+ GL11.glScalef(1.2f, 1.5f, 0f);
+ drawTexturedModalRect((int) (guiLeft / (1.2)) + 126, (int) (guiTop / (1.5)) + 7 + (size - 16) * (ind - page * 5), 48, 16, 32, 16);
+ drawTexturedModalRect((int) (guiLeft / (1.2)) + 5, (int) (guiTop / (1.5)) + 7 + (size - 16) * (ind - page * 5), 80, 16, 32, 16);
+ GL11.glPopMatrix();
+ GL11.glPushMatrix();
+ List descr = fontRendererObj.listFormattedStringToWidth(curse.getDescription(), 238);
+ GL11.glScalef(0.75F, 0.75F, 0F);
+ for (int i = 0; i < descr.size(); i++)
+ this.drawString(fontRendererObj, descr.get(i).toString(), (int) (guiLeft / 0.75F) + 12, (int) (guiTop / 0.75F) + 184 + i * 12 - (descr.size() > 1 ? 6 : 0), 0xffffff);
+ GL11.glPopMatrix();
+ }
if (playerInfo.getInteger(curse.getName()) == 2) {
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1f, 1f, 1f, 0.5f);
- drawTexturedModalRect(guiLeft + 134, guiTop + 8 + (size - 8) * ind, 3 * 16, 0, 16, 16);
+ drawTexturedModalRect(guiLeft + 134, guiTop + 11 + (size - 8) * (ind - page * 5), 3 * 16, 0, 16, 16);
GL11.glDisable(GL11.GL_BLEND);
GL11.glPopMatrix();
}
@@ -94,28 +104,72 @@ public class GuiCurseInfo extends GuiContainer {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glScalef(0.5f, 0.5f, 0.0f);
- drawTexturedModalRect(guiLeft*2 + 100, guiTop*2 + 16 + ind * 48, tag % 8 * 32, tag / 8 * 32, 32, 32);
+ drawTexturedModalRect(guiLeft * 2 + 100, guiTop * 2 + 22 + (ind - page * 5) * 48, tag % 8 * 32, tag / 8 * 32, 32, 32);
GL11.glPopMatrix();
- this.drawString(fontRendererObj, curse.getDisplayName(), guiLeft + 70, guiTop + 12 + ind * (size - 8), 0xffffff);
- // this.drawCenteredString(fontRendererObj,
- // curse.getDescription(), this.width/2, 30 + ind * 34,
- // 0xffffff);
- ind++;
+ this.drawString(fontRendererObj, curse.getDisplayName(), guiLeft + 70, guiTop + 15 + (ind - page * 5) * (size - 8), 0xffffff);
}
+ ind++;
+ }
}
}
}
+ private void creativeCurses(NBTTagCompound playerInfo) {
+ int size = 32;
+ int ind = 0;
+ for (Curse curse : Curse.getCurseList()) {
+ if (ind >= page * 5 && ind < (page + 1) * 5) {
+ if (ind == page * 5 && selectedCurse == "") selectedCurse = curse.getName();
+ if (playerInfo.getInteger(curse.getName()) <= 0) {
+ GL11.glPushMatrix();
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ GL11.glColor4f(1f, 1f, 1f, 0.5f);
+ }
+ mc.renderEngine.bindTexture(Variables.MISC_TEXTURE);
+ drawTexturedModalRect(guiLeft + 43, guiTop + 8 + (size - 8) * (ind - page * 5), 0, 32, 112, 22);
+ if (selectedCurse == curse.getName()) {
+ GL11.glPushMatrix();
+ GL11.glScalef(1.2f, 1.5f, 0f);
+ drawTexturedModalRect((int) (guiLeft / (1.2)) + 126, (int) (guiTop / (1.5)) + 7 + (size - 16) * (ind - page * 5), 48, 16, 32, 16);
+ drawTexturedModalRect((int) (guiLeft / (1.2)) + 5, (int) (guiTop / (1.5)) + 7 + (size - 16) * (ind - page * 5), 80, 16, 32, 16);
+ GL11.glPopMatrix();
+ GL11.glPushMatrix();
+ List descr = fontRendererObj.listFormattedStringToWidth(curse.getDescription(), 238);
+ GL11.glScalef(0.75F, 0.75F, 0F);
+ for (int i = 0; i < descr.size(); i++)
+ this.drawString(fontRendererObj, descr.get(i).toString(), (int) (guiLeft / 0.75F) + 12, (int) (guiTop / 0.75F) + 184 + i * 12 - (descr.size() > 1 ? 6 : 0), 0xffffff);
+ GL11.glPopMatrix();
+ }
+ int halfDescrSize = fontRendererObj.getStringWidth(curse.getDescription()) / 2;
+ mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png"));
+ int tag = curse.getTextureID();
+ GL11.glPushMatrix();
+ if (playerInfo.getInteger(curse.getName()) <= 0) GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);
+ else GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glScalef(0.5f, 0.5f, 0.0f);
+ drawTexturedModalRect(guiLeft * 2 + 100, guiTop * 2 + 22 + (ind - page * 5) * 48, tag % 8 * 32, tag / 8 * 32, 32, 32);
+ GL11.glPopMatrix();
+ this.drawString(fontRendererObj, curse.getDisplayName(), guiLeft + 70, guiTop + 15 + (ind - page * 5) * (size - 8), playerInfo.getInteger(curse.getName()) > 0 ? 0xffffffff : 0xaaffffff);
+ if (playerInfo.getInteger(curse.getName()) <= 0) {
+ GL11.glDisable(GL11.GL_BLEND);
+ GL11.glPopMatrix();
+ }
+ }
+ ind++;
+ }
+ }
+
@Override
public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
}
-
- @Override
- protected void keyTyped(char charecter, int key)
- {
- super.keyTyped(charecter, key);
- if (key == KeyBindings.curses.getKeyCode()) mc.thePlayer.closeScreen();
- }
+
+ @Override
+ protected void keyTyped(char charecter, int key) {
+ super.keyTyped(charecter, key);
+ if (key == KeyBindings.curses.getKeyCode()) mc.thePlayer.closeScreen();
+ }
@Override
public void initGui() {
@@ -129,5 +183,41 @@ public class GuiCurseInfo extends GuiContainer {
protected void mouseClicked(int x, int y, int id) {
super.mouseClicked(x, y, id);
+ int ind = 0;
+ int size = 32;
+ if (player != null) {
+ NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
+ for (Curse curse : Curse.getCurseList()) {
+ if (player.capabilities.isCreativeMode) {
+ if (x > (guiLeft + 43) && y > (guiTop + 8 + (size - 8) * (ind - page * 5)) && x < (guiLeft + 43 + 112) && y < (guiTop + 40 + (size - 8) * (ind - page * 5)) && ind >= page * 5 && ind < (page + 1) * 5) {
+ if (player.capabilities.isCreativeMode && isCtrlKeyDown() && playerInfo.getInteger(curse.getName()) > 0) {
+ playerInfo.setInteger(curse.getName(), 0);
+ playerInfo.setInteger("activeCurses", playerInfo.getInteger("activeCurses") - 1);
+ Curse.availableCurses.add(curse);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketSendServerPlayerInfo("remove", curse.getName(), playerInfo));
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendServerPlayersInfo());
+ } else if (player.capabilities.isCreativeMode && isCtrlKeyDown() && playerInfo.getInteger(curse.getName()) <= 0) {
+ playerInfo.setInteger(curse.getName(), 1);
+ playerInfo.setInteger("activeCurses", playerInfo.getInteger("activeCurses") + 1);
+ Curse.availableCurses.remove(curse);
+ JewelrycraftMod.netWrapper.sendToServer(new PacketSendServerPlayerInfo("add", curse.getName(), playerInfo));
+ JewelrycraftMod.netWrapper.sendToAll(new PacketSendServerPlayersInfo());
+ } else selectedCurse = curse.getName();
+ }
+ ind++;
+ } else if (playerInfo.getInteger(curse.getName()) > 0) {
+ if (x > (guiLeft + 43) && y > (guiTop + 8 + (size - 8) * (ind - page * 5)) && x < (guiLeft + 43 + 112) && y < (guiTop + 40 + (size - 8) * (ind - page * 5)) && ind >= page * 5 && ind < (page + 1) * 5) selectedCurse = curse.getName();
+ ind++;
+ }
+ }
+ }
+ if (page > 0 && x > guiLeft + 5 && x < guiLeft + 18 && y > guiTop + ySize - 14 && y < guiTop + ySize - 3) {
+ page--;
+ selectedCurse = "";
+ }
+ if (page < maxPages && x > guiLeft + xSize - 38 && x < guiLeft + xSize - 25 && y > guiTop + ySize - 14 && y < guiTop + ySize - 3) {
+ page++;
+ selectedCurse = "";
+ }
}
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java
index 1ff2ef3..b3caaf2 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java
@@ -1,239 +1,187 @@
-package darkknight.jewelrycraft.client.gui;
-
-import java.util.ArrayList;
-import java.util.List;
-import net.minecraft.block.Block;
-import net.minecraft.block.BlockAir;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.gui.inventory.GuiContainer;
-import net.minecraft.client.renderer.RenderHelper;
-import net.minecraft.client.renderer.entity.RenderManager;
-import net.minecraft.entity.item.EntityItem;
-import net.minecraft.inventory.Container;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.ResourceLocation;
-import net.minecraft.world.World;
-import org.lwjgl.opengl.GL11;
-import darkknight.jewelrycraft.block.BlockList;
-import darkknight.jewelrycraft.block.BlockShadowEye;
-
-public class GuiGuide extends GuiContainer
-{
- public int page, rot, del;
- public boolean prevHover, nextHover;
- World world;
- private final GuiTab[] tabs;
- private GuiTab activeTab;
- ResourceLocation pageTexture, flippedPageTexture;
-
- /**
- * @param container
- * @param world
- * @param pageTex
- * @param flipPageTex
- */
- public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex)
- {
- super(container);
- page = 1;
- rot = 0;
- del = 0;
- this.world = world;
- tabs = new GuiTab[]{new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabOresToIngots(4), new GuiTabModifiers(5), new GuiTabRitual(6)};
- activeTab = tabs[0];
- pageTexture = pageTex;
- flippedPageTexture = flipPageTex;
- this.xSize = 240;
- }
-
- /**
- * @param f
- * @param i
- * @param j
- */
- @Override
- protected void drawGuiContainerBackgroundLayer(float f, int i, int j)
- {
- nextHover = false;
- prevHover = false;
- if (del == 0) rot++;
- del++;
- if (del >= 2) del = 0;
- Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture);
- drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 180);
- Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture);
- drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 180);
- for(GuiRectangle tab: tabs){
- int srcX = 24;
- int sizeX = 19;
- if (tab == activeTab){
- srcX += 38;
- sizeX += 3;
- }else if (tab.inRect(this, i, j)) srcX += 19;
- tab.draw(this, srcX, 180, sizeX, 18);
- }
- if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()){
- drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14);
- nextHover = true;
- }
- if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0){
- drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14);
- prevHover = true;
- }
- activeTab.drawBackground(this, i, j, page);
- activeTab.drawBackground(this, i, j, page + 1);
- ArrayList<String> text = new ArrayList<String>();
- text.add(Integer.toString(page));
- drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 25, fontRendererObj);
- text.remove(Integer.toString(page));
- text.add(Integer.toString(page + 1));
- drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 25, fontRendererObj);
- for(int tab = 0; tab < tabs.length; tab++)
- renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon());
- }
-
- /**
- * @param x
- * @param y
- */
- @Override
- protected void drawGuiContainerForegroundLayer(int x, int y)
- {
- activeTab.drawForeground(this, x, y, page);
- activeTab.drawForeground(this, x, y, page + 1);
- for(GuiTab tab: tabs)
- tab.drawString(this, x, y, tab.getName());
- }
-
- /**
- * @param x
- * @param y
- * @param button
- */
- @Override
- protected void mouseClicked(int x, int y, int button)
- {
- if (nextHover && page + 2 <= activeTab.getMaxPages()) page += 2;
- else if (prevHover && page > 1) page -= 2;
- activeTab.mouseClick(this, x, y, button);
- for(GuiTab tab: tabs)
- if (activeTab != tab) if (tab.inRect(this, x, y)){
- activeTab = tab;
- page = 1;
- break;
- }
- }
-
- /**
- * @param item
- * @param x
- * @param y
- * @param activeIcon
- */
- public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon)
- {
- GL11.glPushMatrix();
- GL11.glDisable(GL11.GL_LIGHTING);
- EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
- entityitem.hoverStart = 0.0F;
- if (item.isItemEqual(new ItemStack(BlockList.smelter))){
- y -= 3;
- x += 1;
- }
- GL11.glTranslatef(x, y, 100);
- float scale = 30F;
- GL11.glScalef(-scale, scale, scale);
- if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0);
- if (item.isItemEqual(new ItemStack(BlockList.smelter))){
- GL11.glScalef(1.5F, 1.5F, 1.5F);
- GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F);
- }else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))){
- GL11.glScalef(1.2F, 1.2F, 1.2F);
- GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- GL11.glTranslatef(0F, 0.05F, 0F);
- }else if (item.isItemEqual(new ItemStack(BlockList.shadowOre))){
- GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- GL11.glTranslatef(0F, 0.13F, 0F);
- }else GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
- if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting();
- if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
- else{
- GL11.glRotatef(180F, 0F, 1F, 0F);
- RenderManager.instance.options.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
- RenderManager.instance.options.fancyGraphics = false;
- }
- if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting();
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glPopMatrix();
- }
-
- /**
- * @param item
- * @param x
- * @param y
- * @param scale
- */
- public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot)
- {
- GL11.glPushMatrix();
- EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
- entityitem.hoverStart = 0.0F;
- GL11.glTranslatef(x, y, 100);
- GL11.glScalef(-scale, scale, scale);
- GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F);
- if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F);
- else{
- GL11.glRotatef(xRot, 1, 0, 0);
- GL11.glRotatef(yRot, 0, 1, 0);
- GL11.glRotatef(zRot, 0, 0, 1);
- if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F);
- if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F);
- }
- if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting();
- if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
- else{
- RenderManager.instance.options.fancyGraphics = true;
- RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
- RenderManager.instance.options.fancyGraphics = false;
- }
- if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting();
- GL11.glPopMatrix();
- }
-
- /**
- * @return
- */
- public int getLeft()
- {
- return guiLeft;
- }
-
- /**
- * @return
- */
- public int getTop()
- {
- return guiTop;
- }
-
- /**
- * @return
- */
- public FontRenderer getFont()
- {
- return fontRendererObj;
- }
-
- /**
- * @param lst
- * @param x
- * @param y
- */
- @SuppressWarnings ("rawtypes")
- public void drawHoverString(List lst, int x, int y)
- {
- drawHoveringText(lst, x, y, fontRendererObj);
- }
+package darkknight.jewelrycraft.client.gui;
+
+import java.util.ArrayList;
+import java.util.List;
+import net.minecraft.block.Block;
+import net.minecraft.block.BlockAir;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.gui.FontRenderer;
+import net.minecraft.client.gui.inventory.GuiContainer;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.client.renderer.entity.RenderManager;
+import net.minecraft.entity.item.EntityItem;
+import net.minecraft.inventory.Container;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.block.BlockShadowEye;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class GuiGuide extends GuiContainer {
+ public int page, rot, del;
+ public boolean prevHover, nextHover;
+ World world;
+ private final GuiTab[] tabs = new GuiTab[] { new GuiTabIntroduction(0), new GuiTabBlocks(1), new GuiTabItems(2), new GuiTabGemsAndIngots(3), new GuiTabCurses(4), new GuiTabModifiers(5), new GuiTabRitual(6) };
+ private GuiTab activeTab;
+ ResourceLocation pageTexture, flippedPageTexture;
+
+ public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex) {
+ super(container);
+ page = JewelrycraftMod.prevPage;
+ rot = 0;
+ del = 0;
+ this.world = world;
+ activeTab = JewelrycraftMod.prevActive;
+ pageTexture = pageTex;
+ flippedPageTexture = flipPageTex;
+ this.xSize = 240;
+ }
+
+ @Override
+ protected void drawGuiContainerBackgroundLayer(float f, int i, int j) {
+ nextHover = false;
+ prevHover = false;
+ if (del == 0) rot++;
+ del++;
+ if (del >= 2) del = 0;
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageTexture);
+ drawTexturedModalRect(guiLeft + 147 / 2 + 20, guiTop - 10, 0, 0, 145, 179);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(flippedPageTexture);
+ drawTexturedModalRect(guiLeft - 147 / 2 + 21, guiTop - 10, 0, 0, 145, 179);
+ for (GuiRectangle tab : tabs) {
+ int srcX = 24;
+ int sizeX = 19;
+ if (tab == activeTab) {
+ srcX += 38;
+ sizeX += 3;
+ }
+ else if (tab.inRect(this, i, j)) srcX += 19;
+ tab.draw(this, srcX, 180, sizeX, 18);
+ }
+ if (i >= guiLeft + 195 + 20 && i <= guiLeft + 195 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page + 2 <= activeTab.getMaxPages()) {
+ drawTexturedModalRect(guiLeft + 195 + 20, guiTop + 127 + 20, 0, 180, 11, 14);
+ nextHover = true;
+ }
+ if (i >= guiLeft + 20 - 61 && i <= guiLeft - 61 + 20 + 11 && j >= guiTop + 127 + 20 && j <= guiTop + 127 + 20 + 14 && page - 2 > 0) {
+ drawTexturedModalRect(guiLeft - 61 + 20, guiTop + 127 + 20, 11, 180, 11, 14);
+ prevHover = true;
+ }
+ activeTab.drawBackground(this, i, j, page);
+ activeTab.drawBackground(this, i, j, page + 1);
+ ArrayList<String> text = new ArrayList<String>();
+ text.add(Integer.toString(page));
+ drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 25, fontRendererObj);
+ text.remove(Integer.toString(page));
+ text.add(Integer.toString(page + 1));
+ drawHoveringText(text, guiLeft - 10 + 20 + 147 - text.get(0).length(), guiTop + 150 + 25, fontRendererObj);
+ for (int tab = 0; tab < tabs.length; tab++)
+ renderItem(tabs[tab].getIcon(), guiLeft - 52, guiTop + 26 + tab * 19, activeTab.getIcon());
+ }
+
+ @Override
+ protected void drawGuiContainerForegroundLayer(int x, int y) {
+ activeTab.drawForeground(this, x, y, page);
+ activeTab.drawForeground(this, x, y, page + 1);
+ for (GuiTab tab : tabs)
+ tab.drawString(this, x, y, tab.getName());
+ }
+
+ @Override
+ protected void mouseClicked(int x, int y, int button) {
+ if (nextHover && page + 2 <= activeTab.getMaxPages()) {
+ page += 2;
+ JewelrycraftMod.prevPage = page;
+ }
+ else if (prevHover && page > 1) {
+ page -= 2;
+ JewelrycraftMod.prevPage = page;
+ }
+ activeTab.mouseClick(this, x, y, button);
+ for (GuiTab tab : tabs)
+ if (activeTab != tab) if (tab.inRect(this, x, y)) {
+ activeTab = tab;
+ JewelrycraftMod.prevActive = tab;
+ page = 1;
+ JewelrycraftMod.prevPage = page;
+ break;
+ }
+ }
+
+ public void renderItem(ItemStack item, float x, float y, ItemStack activeIcon) {
+ GL11.glPushMatrix();
+ GL11.glDisable(GL11.GL_LIGHTING);
+ EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
+ entityitem.hoverStart = 0.0F;
+ if (item.isItemEqual(new ItemStack(BlockList.smelter))) {
+ y -= 3;
+ x += 1;
+ }
+ GL11.glTranslatef(x, y, 100);
+ float scale = 30F;
+ GL11.glScalef(-scale, scale, scale);
+ if (activeIcon != null && item.isItemEqual(activeIcon)) GL11.glRotatef(rot, 0, 1, 0);
+ if (item.isItemEqual(new ItemStack(BlockList.smelter))) GL11.glScalef(1.5F, 1.5F, 1.5F);
+ else if (item.isItemEqual(new ItemStack(BlockList.handPedestal))) {
+ GL11.glScalef(1.2F, 1.2F, 1.2F);
+ GL11.glTranslatef(0F, -0.05F, 0F);
+ }
+ GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting();
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else {
+ GL11.glRotatef(180F, 0F, 1F, 0F);
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting();
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glPopMatrix();
+ }
+
+ public void renderItem(ItemStack item, float x, float y, float scale, boolean rotate, float xRot, float yRot, float zRot) {
+ GL11.glPushMatrix();
+ EntityItem entityitem = new EntityItem(world, 0.0D, 0.0D, 0.0D, item);
+ entityitem.hoverStart = 0.0F;
+ GL11.glTranslatef(x, y, 100);
+ GL11.glScalef(-scale, scale, scale);
+ GL11.glRotatef(160.0F, 1.0F, 0.0F, 0.0F);
+ if (rotate) GL11.glRotatef(rot, 0.0F, 1.0F, 0.0F);
+ else {
+ GL11.glRotatef(xRot, 1, 0, 0);
+ GL11.glRotatef(yRot, 0, 1, 0);
+ GL11.glRotatef(zRot, 0, 0, 1);
+ if (xRot >= 90F || zRot >= 90F) GL11.glTranslatef(0F, -0.2F, 0F);
+ if (Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockShadowEye) GL11.glTranslatef(0F, 0F, 0.025F);
+ }
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.enableStandardItemLighting();
+ if (RenderManager.instance.options.fancyGraphics) RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ else {
+ RenderManager.instance.options.fancyGraphics = true;
+ RenderManager.instance.renderEntityWithPosYaw(entityitem, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
+ RenderManager.instance.options.fancyGraphics = false;
+ }
+ if (!(Block.getBlockFromItem(entityitem.getEntityItem().getItem()) instanceof BlockAir)) RenderHelper.disableStandardItemLighting();
+ GL11.glPopMatrix();
+ }
+
+ public int getLeft() {
+ return guiLeft;
+ }
+
+ public int getTop() {
+ return guiTop;
+ }
+
+ public FontRenderer getFont() {
+ return fontRendererObj;
+ }
+
+ @SuppressWarnings("rawtypes")
+ public void drawHoverString(List lst, int x, int y) {
+ drawHoveringText(lst, x, y, fontRendererObj);
+ }
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java
index 2712821..d3f92e3 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java
@@ -52,99 +52,71 @@ public class GuiTabBlocks extends GuiTab
{
case 1:
text = "This ore is extremely rare and can be found only between Y-level 5 and 8. It can only be mined using a diamond pickaxe.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.shadowOre), text, 90f, true);
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.shadowOre), text, 180f, 0, -18, true, 42, 100, true);
break;
case 2:
- text = "The Shadow Block is crafted using 9 shadow ingots. Magicians believed it held the ability to merge with the shadows. It becomes more transparent as it";
+ text = "Magicians believed this block held the ability to merge with the shadows. It becomes more transparent as it gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in.";
Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowBlock), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot));
break;
case 3:
- text = "gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.smelter), new ItemStack(Blocks.cobblestone), new ItemStack(Items.bucket), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone));
break;
case 4:
- text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.smelter), new ItemStack(Blocks.cobblestone), new ItemStack(Items.bucket), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone));
+ text = "is right click on it with any ore or ingot. It can melt multimple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items added. If right clicked when done smelting, it will say what the block contains.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
case 5:
- text = "melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do is right click on it with any ore or ingot. It can melt multimple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ text = "The molder is a key piece in creating jewellery. You need to pour the molten metal out of the smelter somewhere. That somewhere is the molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.molder), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone));
break;
case 6:
- text = "added. If right clicked when done smelting, it will say what the block contains.";
+ text = "choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
case 7:
- text = "The molder is a key piece in creating jewellery. You need to pour the molten metal out of the smelter somewhere. That somewhere is the";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.molder), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone));
- break;
- case 8:
- text = "molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- case 9:
- text = "have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- case 10:
- text = "This table allows you to add a gem to a piece of jewellery. Right click the block while holding a jewellery to add it in. Then do the same with a gem (you";
+ text = "This table allows you to add a gem to a piece of jewellery. Right click the block while holding a jewellery to add it in. Then do the same with a gem (you can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the";
if (del == 0) values++;
del++;
if (del >= 300) del = 0;
if (values >= 4) values = 0;
Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.jewelCraftingTable), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.stone), null, new ItemStack(Blocks.stone), new ItemStack(Blocks.stone), null, new ItemStack(Blocks.stone));
break;
- case 11:
- text = "can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- case 12:
- text = "jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem.";
+ case 8:
+ text = "progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem.";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
- case 13:
- text = "The Storage Displayer, as the name suggests, can store a large amount (Up to: " + Integer.MAX_VALUE + ") of a single item/block placed in it. It will";
+ case 9:
+ text = "The Storage Displayer, as the name suggests, can store a large amount (Up to: " + Integer.MAX_VALUE + ") of a single item/block placed in it. It will display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it";
Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.displayer), null, new ItemStack(Items.iron_ingot), null, new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block));
break;
- case 14:
- text = "display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- case 15:
- text = "If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to";
+ case 10:
+ text = "simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside. If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
- case 16:
- text = "get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory.";
+ case 11:
+ text = "Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory.";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
- case 17:
- text = "This mysterious shaped block is used in the ritual. The acient ones claimed it had the power to travel through worlds. They would use these to offer";
+ case 12:
+ text = "This mysterious shaped block is used in the ritual. The acient ones claimed it had the power to travel through worlds. They would use these to offer sacrifices to 'The Dark One' in exchange for unimaginable powers.";
Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.handPedestal), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), null, new ItemStack(Blocks.stonebrick), null, new ItemStack(Blocks.stone_slab, 1, 5), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stone_slab, 1, 5));
break;
- case 18:
- text = "sacrifices to 'The Dark One' in exchange for unimaginable powers.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- case 19:
- text = "The Cursed Eye is an ancient artifact also known as 'The Dark One's Eye'. It is part of the sacrifice ritual the ancient ones talk about. Be careful";
+ case 13:
+ text = "The Cursed Eye is an ancient artifact also known as 'The Dark One's Eye'. It is part of the sacrifice ritual the ancient ones talk about. Be careful though, for He sees everything. To see how to create the ritual look in the Ritual tab. One you created the ritual, simply place a";
Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowEye), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Items.ender_eye), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick));
break;
- case 20:
- text = "though, for He sees everything. To see how to create the ritual look in the Ritual tab. One you created the ritual, simple place a piece of jewelery in the middle pedestal and your modifiers of choice in the other ones (you don't need to put an item in every single pedestal). After";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- case 21:
- text = "you do that simply right click the eye to activate the ritual. Be careful not to leave the premise or you'll die! When the ritual is done, Shift+Right Click on the central hand pedestal to retrieve your newly modified item!";
+ case 14:
+ text = "piece of jewelery in the middle pedestal and your modifiers of choice in the other ones (you don't need to put an item in every single pedestal). After you do that simply right click the eye to activate the ritual. Be careful not to leave the premise or you'll die! When the ritual is done, Shift+Right Click on the central hand pedestal to retrieve your newly modified item!";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
- case 22:
+ case 15:
if (del == 0) values++;
del++;
- if (del >= 300) del = 0;
+ if (del >= 50) del = 0;
if (values >= 15) values = 0;
text = "Crystals don't do much as of yet. They spawn naturally in caves and come in all 16 colors.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.crystal, 1, values), text, 40f, true);
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.crystal, 1, values), text, 180f, 0, -18, true, 48, 120, true);
break;
default:
;
@@ -157,7 +129,7 @@ public class GuiTabBlocks extends GuiTab
@Override
public int getMaxPages()
{
- return 22;
+ return 16;
}
/**
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java
new file mode 100644
index 0000000..0bbf258
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java
@@ -0,0 +1,89 @@
+package darkknight.jewelrycraft.client.gui;
+
+import java.awt.Desktop;
+import java.net.URL;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import darkknight.jewelrycraft.api.Curse;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.Page;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.Variables;
+
+public class GuiTabCurses extends GuiTab
+{
+ public GuiTabCurses(int id) {
+ super(id);
+ }
+
+ public String getName() {
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.curses");
+ }
+
+ @Override
+ public ItemStack getIcon() {
+ return new ItemStack(ItemList.testItem);
+ }
+
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page) {
+ String text = "";
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch (page) {
+ case 1:
+ text = "You are poisoned for as long as this curse is active.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 0), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ case 2:
+ text = "Whenever you attack an entity you are set on fire.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 1), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ case 3:
+ text = "You can no longer throw any item. I mean, you might need them later, right?";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 2), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ case 4:
+ text = "You are blinded. Literally. I mean, what did you expect?";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 3), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ case 5:
+ text = "There is a random chance that when you attack a passive mob you will lose a full heart, but gain a black heart.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 4), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ case 6:
+ text = "Whatever you touch turns into gold. Believe me, this is no good to you, you can't even harvest this gold.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 5), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ case 7:
+ text = "Entities have a higher chance of dropping more items and hearts when killed.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 6), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ case 8:
+ text = "There is a random chance that you'll steal 1 heart from an entity that is collided with you. If you are low on health, you will heal. If you are fully healed, an extra heart will be added to you. You can steal up to 2 hearts per entity (3 if you complete the challenge). When you steal a heart, that entity will have their max health reduced by 1.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 7), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ case 9:
+ text = "When you attack an entity and are low on health, there is a 50% chance that you'll heal half a heart. Also you will catch on fire if you're exposed to sun.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 8), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ case 10:
+ text = "Any mob you kill or block you destroy(eg. Diamond Ore, Redstone Ore, stuff that drops items not the block itself) drops double the amount of items it normally would.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 9), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
+ break;
+ default:;
+ }
+ }
+
+ @Override
+ public int getMaxPages() {
+ return 10;
+ }
+
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page) {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java
index 33d94f2..a124703 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java
@@ -1,92 +1,96 @@
-package darkknight.jewelrycraft.client.gui;
-
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.StatCollector;
-import org.lwjgl.opengl.GL11;
-import darkknight.jewelrycraft.util.JewelrycraftUtil;
-import darkknight.jewelrycraft.util.Variables;
-
-public class GuiTabGemsAndIngots extends GuiTab
-{
-
- /**
- * @param id
- */
- public GuiTabGemsAndIngots(int id)
- {
- super(id);
- }
-
- public String getName()
- {
- return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.misc");
- }
-
- /**
- * @return
- */
- @Override
- public ItemStack getIcon()
- {
- return new ItemStack(Items.emerald);
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param page
- */
- @Override
- public void drawBackground(GuiGuide gui, int x, int y, int page)
- {
- int xPos = page % 2 == 0 ? 107 : -35;
- GL11.glEnable(GL11.GL_BLEND);
- GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
- for(int i = (page - 1) * 9; i < page * 9; i++)
- if (i < JewelrycraftUtil.gem.size()){
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0);
- gui.renderItem(JewelrycraftUtil.gem.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true, 0, 0, 0);
- gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.gem.get(i).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0);
- GL11.glDisable(GL11.GL_LIGHTING);
- }
- page -= JewelrycraftUtil.gem.size() / 9 + 1;
- for(int i = (page - 1) * 9; i < page * 9; i++)
- if (i < JewelrycraftUtil.metal.size() && page > 0){
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0);
- gui.renderItem(JewelrycraftUtil.metal.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true, 0, 0, 0);
- gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0);
- GL11.glDisable(GL11.GL_LIGHTING);
- }
- page -= JewelrycraftUtil.metal.size() / 9 + 1;
- for(int i = (page - 1) * 9; i < page * 9; i++)
- if (i < JewelrycraftUtil.ores.size() && page > 0){
- gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ores", gui.getLeft() + xPos + 40, gui.getTop(), 0);
- gui.renderItem(JewelrycraftUtil.ores.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true, 0, 0, 0);
- gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.ores.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0);
- GL11.glDisable(GL11.GL_LIGHTING);
- }
- GL11.glDisable(GL11.GL_BLEND);
- }
-
- /**
- * @return
- */
- @Override
- public int getMaxPages()
- {
- return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.metal.size() / 9 + JewelrycraftUtil.ores.size() / 9 + 4;
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param page
- */
- @Override
- public void drawForeground(GuiGuide gui, int x, int y, int page)
- {}
-}
+package darkknight.jewelrycraft.client.gui;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.Variables;
+
+public class GuiTabGemsAndIngots extends GuiTab
+{
+
+ /**
+ * @param id
+ */
+ public GuiTabGemsAndIngots(int id)
+ {
+ super(id);
+ }
+
+ public String getName()
+ {
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.misc");
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(Items.emerald);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ int xPos = page % 2 == 0 ? 107 : -35;
+ float scale = 0.75F;
+ for(int i = (page - 1) * 12; i < page * 12; i++)
+ if (i < JewelrycraftUtil.gem.size()){
+ GL11.glPushMatrix();
+ if(i==(page - 1) * 12) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ GL11.glScalef(scale, scale, 0f);
+ gui.getFont().drawString(String.format("%-1.26s", JewelrycraftUtil.gem.get(i).getDisplayName()), (int)((gui.getLeft() + xPos + 12)/scale), (int)((gui.getTop() + 12 + 12 * (i - 12 * (page - 1)))/scale), 0);
+ GL11.glPopMatrix();
+ gui.renderItem(JewelrycraftUtil.gem.get(i), gui.getLeft() + xPos + 5, gui.getTop() + 18 + 12 * (i - 12 * (page - 1)), 24f, true, 0, 0, 0);
+ }
+ page -= JewelrycraftUtil.gem.size() / 13 + 1;
+ for(int i = (page - 1) * 12; i < page * 12; i++)
+ if (i < JewelrycraftUtil.metal.size() && page > 0){
+ GL11.glPushMatrix();
+ if(i==(page - 1) * 12) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ GL11.glScalef(scale, scale, 0f);
+ gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), (int)((gui.getLeft() + xPos + 12)/scale), (int)((gui.getTop() + 12 + 12 * (i - 12 * (page - 1)))/scale), 0);
+ GL11.glPopMatrix();
+ gui.renderItem(JewelrycraftUtil.metal.get(i), gui.getLeft() + xPos + 5, gui.getTop() + 18 + 12 * (i - 12 * (page - 1)), 24f, true, 0, 0, 0);
+ }
+ page -= JewelrycraftUtil.metal.size() / 13 + 1;
+ for(int i = (page - 1) * 12; i < page * 12; i++)
+ if (i < JewelrycraftUtil.ores.size() && page > 0){
+ GL11.glPushMatrix();
+ if(i==(page - 1) * 12) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ores", gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ GL11.glScalef(scale, scale, 0f);
+ gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.ores.get(i).copy().getDisplayName()), (int)((gui.getLeft() + xPos + 12)/scale), (int)((gui.getTop() + 12 + 12 * (i - 12 * (page - 1)))/scale), 0);
+ GL11.glPopMatrix();
+ gui.renderItem(JewelrycraftUtil.ores.get(i), gui.getLeft() + xPos + 5, gui.getTop() + 18 + 12 * (i - 12 * (page - 1)), 24f, true, 0, 0, 0);
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return (JewelrycraftUtil.gem.size() / 13) + (JewelrycraftUtil.metal.size() / 13) + (JewelrycraftUtil.ores.size() / 13) + 3;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java
index 25acf21..158a1f5 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java
@@ -1,59 +1,55 @@
-package darkknight.jewelrycraft.client.gui;
-
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-import darkknight.jewelrycraft.client.Page;
-import darkknight.jewelrycraft.item.ItemList;
-import darkknight.jewelrycraft.util.Variables;
-
-public class GuiTabIntroduction extends GuiTab
-{
- public GuiTabIntroduction(int id)
- {
- super(id);
- }
-
- @Override
- public ItemStack getIcon()
- {
- return new ItemStack(ItemList.ring);
- }
-
- public String getName()
- {
- return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction");
- }
-
- @Override
- public void drawBackground(GuiGuide gui, int x, int y, int page)
- {
- String text = "";
- int xPos = page % 2 == 0 ? 107 : -35;
- switch(page)
- {
- case 1:
- text = StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction."+page);
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- case 2:
- text = StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction."+page);
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- case 3:
- text = StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction."+page);
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- }
- }
-
- @Override
- public int getMaxPages()
- {
- return 4;
- }
-
- @Override
- public void drawForeground(GuiGuide gui, int x, int y, int page)
- {}
-}
+package darkknight.jewelrycraft.client.gui;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.StatCollector;
+import darkknight.jewelrycraft.client.Page;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.Variables;
+
+public class GuiTabIntroduction extends GuiTab
+{
+ public GuiTabIntroduction(int id)
+ {
+ super(id);
+ }
+
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(ItemList.ring);
+ }
+
+ public String getName()
+ {
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction");
+ }
+
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ String text = "";
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch(page)
+ {
+ case 1:
+ text = StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction."+page);
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 2:
+ text = StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.introduction."+page);
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ }
+ }
+
+ @Override
+ public int getMaxPages()
+ {
+ return 2;
+ }
+
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java
index de77a73..e6883f9 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java
@@ -57,11 +57,11 @@ public class GuiTabItems extends GuiTab
Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true, new ItemStack(BlockList.shadowOre), new ItemStack(ItemList.shadowIngot));
break;
case 2:
- text = "These gloves give you the chance to steal the trades those pesky Testificates have to offer. To use these simply open their gui at least once, then Crouch and";
+ text = "These gloves give you the chance to steal the trades those pesky Testificates have to offer. To use these simply open their gui at least once, then Crouch and right click on the them to hopefully steal the trades. If you traded with him before, then you have a chance of getting the traded";
Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.thiefGloves), new ItemStack(ItemList.shadowIngot), null, new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15));
break;
case 3:
- text = "right click on the them to hopefully steal the trades. If you traded with him before, then you have a chance of getting the traded emeralds back as well. This has a maximum of 10 uses before it breaks.";
+ text = "emeralds back as well. This has a maximum of 10 uses before it breaks.";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
case 4:
@@ -97,33 +97,37 @@ public class GuiTabItems extends GuiTab
del++;
if (del >= 300) del = 0;
if (values > 4) values = 0;
- text = "It's this exact guide. I don't even know why you're reading this. I added this recipe in case you lose the original. Even if this is more helpful than NEI, I do suggest";
+ text = "It's this exact guide. I don't even know why you're reading this. I added this recipe in case you lose the original. Even if this is more helpful than NEI, I do suggest installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really";
Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.guide), new ItemStack(ItemList.molds, 1, values), new ItemStack(Items.book));
break;
case 11:
String link = "HERE";
- if (x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK;
- text = "installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really appreciate it. After that you can share it in the main thread " + link + ".";
+ if (x >= gui.getLeft() - 7 && x <= gui.getLeft() + 10 && y >= gui.getTop() + 20 && y <= gui.getTop() + 34) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK;
+ text = "appreciate it. After that you can share it in the main thread " + link + ".";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
case 12:
ItemStack item = new ItemStack(ItemList.bucket);
if (del == 0) values++;
del++;
- if (del >= 300) del = 0;
+ if (del >= 50) del = 0;
if (values > JewelrycraftUtil.metal.size() - 1) values = 0;
JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy());
text = "These buckets contain molten metal. To obtain one simply Right Click a full Smelter to get a bucket. You can pour the metal, other than that it has no use. You can place the molten metal back in a Smelter by Right Clicking one with it.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, item, text, 40f, 0, 0, true, 45, 10, true);
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, item, text, 40f, 0, 0, true, 45, 10, false);
break;
case 13:
- text = "This item is a creative only item! Right click it while in creative mode to open a GUI. Place a piece of jewelery inside the slot, select what you want to add, then click on 'Add Items'. If you selected Modifiers, you can select multiple";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.jewelryModifier), text, 40f, 0, 0, true, 45, 10, true);
+ text = "This item is a creative only item! Right click it while in creative mode to open a GUI. Place a piece of jewelery inside the slot, select what you want to add, then click on 'Add Items'. If you selected Modifiers, you can select multiple items at once. The 'Item' button is to add an Item to a Golden Object, which can not be obtained normally. This tool can be really useful, especially for those";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.jewelryModifier), text, 40f, 0, 0, true, 45, 10, false);
break;
case 14:
- text = "items at once. The 'Item' button is to add an Item to a Golden Object, which can not be obtained normally. This tool can be really useful, especially for those who want to test the mod and can't wait for the normal processes to finish (Smelter, Jewelers Table, Ritual).";
+ text = "who want to test the mod and can't wait for the normal processes to finish (Smelter, Jewelers Table, Ritual).";
Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
break;
+ case 15:
+ text = "This item is a creative only item! If you right click in the air while holding this item you'll increment the number of the structure to spawn. Crouch and right click to go backwards. To spawn a structure simply right click on a block with this.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.structureGen), text, 40f, 0, 0, true, 45, 10, false);
+ break;
default:
;
}
@@ -147,8 +151,8 @@ public class GuiTabItems extends GuiTab
@Override
public void mouseClick(GuiGuide gui, int x, int y, int button)
{
- if (gui.page == 13 && x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) try{
- Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/forums/topics/2414865").toURI());
+ if (gui.page == 11 && x >= gui.getLeft() - 7 && x <= gui.getLeft() + 10 && y >= gui.getTop() + 20 && y <= gui.getTop() + 34) try{
+ Desktop.getDesktop().browse(new URL("http://minecraft.curseforge.com/mc-mods/229927-jewelrycraft-2").toURI());
}
catch(Exception e){}
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java
index 1f92967..dd8573f 100644
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java
@@ -1,94 +1,90 @@
-package darkknight.jewelrycraft.client.gui;
-
-import net.minecraft.init.Blocks;
-import net.minecraft.init.Items;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.StatCollector;
-import darkknight.jewelrycraft.client.Page;
-import darkknight.jewelrycraft.util.Variables;
-
-public class GuiTabModifiers extends GuiTab
-{
- int maxPages;
- public GuiTabModifiers(int id)
- {
- super(id);
- }
-
- public String getName()
- {
- return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.modifiers");
- }
-
- /**
- * @return
- */
- @Override
- public ItemStack getIcon()
- {
- return new ItemStack(Items.blaze_powder);
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param page
- */
- @Override
- public void drawBackground(GuiGuide gui, int x, int y, int page)
- {
- String text = "";
- int xPos = page % 2 == 0 ? 107 : -35;
- switch(page)
- {
- case 1:
- text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all modifiers that have a use and what they do, in the form of a story/riddle/poem. However, different jewellery have different effects for the same modifier.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- case 2:
- text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.blaze_powder), text, 40f, true);
- break;
- case 3:
- text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.feather), text, 40f, true);
- break;
- case 4:
- text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.ender_eye), text, 40f, true);
- break;
- case 5:
- text = "Through the power of a pearl arrows don't know where to go. In confusion they can explode, making you a helpless toad. But if an enemy hits, they get damaged like a blitz. You may be weaker, water is bad, but you get saved if health is weak like a lilly pad.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.ender_pearl), text, 40f, true);
- break;
- case 6:
- text = "Toughest stone made on Earth, falling damage is absurd. Deal more damage, more protection, anvils and arrows need inspection. But after long and hard abuse, the stone is starting to get loose. You are weak and heavy, sink like a ship, arrows need only one";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Blocks.obsidian), text, 40f, true);
- break;
- case 7:
- text = "hit, deal less damage overall, don't abuse its power now.";
- Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
- break;
- }
- }
-
- /**
- * @return
- */
- @Override
- public int getMaxPages()
- {
- return 7;
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param page
- */
- @Override
- public void drawForeground(GuiGuide gui, int x, int y, int page)
- {}
-}
+package darkknight.jewelrycraft.client.gui;
+
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.StatCollector;
+import darkknight.jewelrycraft.client.Page;
+import darkknight.jewelrycraft.util.Variables;
+
+public class GuiTabModifiers extends GuiTab
+{
+ int maxPages;
+ public GuiTabModifiers(int id)
+ {
+ super(id);
+ }
+
+ public String getName()
+ {
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.modifiers");
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(Items.blaze_powder);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ String text = "";
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch(page)
+ {
+ case 1:
+ text = "Although you can add anything as a modifier, only some objects have an effect. In this tab you can find all modifiers that have a use and what they do, in the form of a story/riddle/poem. However, different jewellery have different effects for the same modifier.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 2:
+ text = "The ancient ones talked about a rising fire in your heart. Fret do not, for flames do not burn, but water might sting a turn. Watch your step, do not be cocky, for its protection is a bit sloppy.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.blaze_powder), text, 40f, true);
+ break;
+ case 3:
+ text = "Light and swift as a feather can be good all together. Enemies miss and get confused, this power can be abused. Against an arrow you can't compare, so move around, don't just stare. Fire is your enemy and weakness is the penalty.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.feather), text, 40f, true);
+ break;
+ case 4:
+ text = "Endermen may tolerate you, end portals are near too, you may find ore that is true. But be careful, for the power may make you dizzy, blind you if you're a sissy, worsen your vision if you're unaware and shift positions everywhere.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.ender_eye), text, 40f, true);
+ break;
+ case 5:
+ text = "Through the power of a pearl arrows don't know where to go. In confusion they can explode, making you a helpless toad. But if an enemy hits, they get damaged like a blitz. You may be weaker, water is bad, but you get saved if health is weak like a lilly pad.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Items.ender_pearl), text, 40f, true);
+ break;
+ case 6:
+ text = "Toughest stone made on Earth, falling damage is absurd. Deal more damage, more protection, anvils and arrows need inspection. But after long and hard abuse, the stone is starting to get loose. You are weak and heavy, sink like a ship, arrows need only one hit, deal less damage overall, don't abuse its power now.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 10, new ItemStack(Blocks.obsidian), text, 40f, true);
+ break;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return 6;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}