summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/client')
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/AbstractTab.java92
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java28
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java308
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/Page.java364
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/TabCurses.java29
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/TabJewelry.java29
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/TabRegistry.java54
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java277
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java413
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java169
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java122
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java226
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java179
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java81
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiTab.java20
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java338
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java156
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java211
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java89
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java381
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java168
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java146
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java347
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerCurseInfo.java29
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerGuide.java34
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java78
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java229
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java112
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java83
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java83
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java83
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java83
-rwxr-xr-x[-rw-r--r--]src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRingChest.java91
33 files changed, 2957 insertions, 2175 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java
index cdfb394..66c3329 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java
+++ b/src/main/java/darkknight/jewelrycraft/client/AbstractTab.java
@@ -2,6 +2,7 @@ package darkknight.jewelrycraft.client;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import darkknight.jewelrycraft.util.Variables;
@@ -16,54 +17,59 @@ import net.minecraft.util.ResourceLocation;
* @author TinkersCOnstruct
*/
@SideOnly(Side.CLIENT)
-public abstract class AbstractTab extends GuiButton
-{
- ResourceLocation texture = new ResourceLocation(Variables.MODID, "textures/gui/hearts.png");
- ItemStack renderStack;
- RenderItem itemRenderer = new RenderItem();
+public abstract class AbstractTab extends GuiButton {
+ ResourceLocation texture = new ResourceLocation(
+ Variables.MODID, "textures/gui/hearts.png");
+ ItemStack renderStack;
+ RenderItem itemRenderer = new RenderItem();
- public AbstractTab(int id, int posX, int posY, ItemStack renderStack)
- {
- super(id, posX, posY, 18, 18, "");
- this.renderStack = renderStack;
- }
+ public AbstractTab(int id, int posX, int posY, ItemStack renderStack) {
+ super(id, posX, posY, 18, 18, "");
+ this.renderStack = renderStack;
+ }
- @Override
- public void drawButton (Minecraft mc, int mouseX, int mouseY)
- {
- if (this.visible)
- {
- GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
- int xOffset = this.enabled ? 0 : 8;
+ @Override
+ public void drawButton(Minecraft mc, int mouseX, int mouseY) {
+ if (this.visible) {
+ GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
+ int xOffset = this.enabled ? 0 : 8;
- mc.renderEngine.bindTexture(this.texture);
- this.drawTexturedModalRect(this.xPosition, yPosition, 144 + xOffset, 32, 18, 18);
+ mc.renderEngine.bindTexture(this.texture);
+ this.drawTexturedModalRect(this.xPosition, yPosition,
+ 144 + xOffset, 32, 18, 18);
- GL11.glPushMatrix();
- RenderHelper.enableGUIStandardItemLighting();
- this.zLevel = 100.0F;
- this.itemRenderer.zLevel = 100.0F;
- GL11.glEnable(GL11.GL_LIGHTING);
- GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1, yPosition + 1);
- this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer, mc.renderEngine, renderStack, xPosition + 1, yPosition + 1);
- GL11.glDisable(GL11.GL_LIGHTING);
- this.itemRenderer.zLevel = 0.0F;
- this.zLevel = 0.0F;
- RenderHelper.disableStandardItemLighting();
- GL11.glPopMatrix();
- }
- }
+ GL11.glPushMatrix();
+ RenderHelper.enableGUIStandardItemLighting();
+ this.zLevel = 100.0F;
+ this.itemRenderer.zLevel = 100.0F;
+ GL11.glEnable(GL11.GL_LIGHTING);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ this.itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer,
+ mc.renderEngine, renderStack, xPosition + 1,
+ yPosition + 1);
+ this.itemRenderer.renderItemOverlayIntoGUI(mc.fontRenderer,
+ mc.renderEngine, renderStack, xPosition + 1,
+ yPosition + 1);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ this.itemRenderer.zLevel = 0.0F;
+ this.zLevel = 0.0F;
+ RenderHelper.disableStandardItemLighting();
+ GL11.glPopMatrix();
+ }
+ }
- @Override
- public boolean mousePressed (Minecraft mc, int mouseX, int mouseY)
- {
- boolean inWindow = this.enabled && this.visible && mouseX >= this.xPosition && mouseY >= this.yPosition && mouseX < this.xPosition + this.width && mouseY < this.yPosition + this.height;
- if (inWindow) this.onTabClicked();
- return inWindow;
- }
+ @Override
+ public boolean mousePressed(Minecraft mc, int mouseX, int mouseY) {
+ boolean inWindow = this.enabled && this.visible
+ && mouseX >= this.xPosition && mouseY >= this.yPosition
+ && mouseX < this.xPosition + this.width
+ && mouseY < this.yPosition + this.height;
+ if (inWindow)
+ this.onTabClicked();
+ return inWindow;
+ }
- public abstract void onTabClicked ();
+ public abstract void onTabClicked();
- public abstract boolean shouldAddToList ();
+ public abstract boolean shouldAddToList();
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java b/src/main/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java
index 4f5ae88..401d3db 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java
+++ b/src/main/java/darkknight/jewelrycraft/client/InventoryTabVanilla.java
@@ -3,22 +3,18 @@ package darkknight.jewelrycraft.client;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
-public class InventoryTabVanilla extends AbstractTab
-{
- public InventoryTabVanilla()
- {
- super(0, 0, 0, new ItemStack(Blocks.crafting_table));
- }
+public class InventoryTabVanilla extends AbstractTab {
+ public InventoryTabVanilla() {
+ super(0, 0, 0, new ItemStack(Blocks.crafting_table));
+ }
- @Override
- public void onTabClicked()
- {
- TabRegistry.openInventoryGui();
- }
+ @Override
+ public void onTabClicked() {
+ TabRegistry.openInventoryGui();
+ }
- @Override
- public boolean shouldAddToList()
- {
- return true;
- }
+ @Override
+ public boolean shouldAddToList() {
+ return true;
+ }
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java b/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java
index 895b345..6baf8ad 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java
+++ b/src/main/java/darkknight/jewelrycraft/client/JewelryInventory.java
@@ -11,156 +11,160 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
-public class JewelryInventory implements IInventory
-{
- public EntityPlayer player;
- public ItemStack[] inventory = new ItemStack[18];
-
- /**
- * @param player
- */
- public JewelryInventory(EntityPlayer player)
- {
- this.player = player;
- NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
- for(int i = 0; i < 18; i++)
- inventory[i] = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("ext" + i));
- }
-
- /**
- * @return
- */
- @Override
- public int getSizeInventory()
- {
- return inventory.length;
- }
-
- /**
- * @param slot
- * @return
- */
- @Override
- public ItemStack getStackInSlot(int slot)
- {
- return inventory[slot];
- }
-
- /**
- * @param slot
- * @param amount
- * @return
- */
- @Override
- public ItemStack decrStackSize(int slot, int amount)
- {
- ItemStack stack = getStackInSlot(slot);
- if (stack != null) if (stack.stackSize > amount){
- stack = stack.splitStack(amount);
- markDirty();
- }else setInventorySlotContents(slot, null);
- return stack;
- }
-
- /**
- * @param slot
- * @return
- */
- @Override
- public ItemStack getStackInSlotOnClosing(int slot)
- {
- ItemStack stack = getStackInSlot(slot);
- setInventorySlotContents(slot, null);
- return stack;
- }
-
- /**
- * @param slot
- * @param stack
- */
- @Override
- public void setInventorySlotContents(int slot, ItemStack stack)
- {
- inventory[slot] = stack;
- if (stack != null && stack.stackSize > getInventoryStackLimit()) stack.stackSize = getInventoryStackLimit();
- markDirty();
- }
-
- /**
- * @return
- */
- @Override
- public String getInventoryName()
- {
- return "Jewelry";
- }
-
- /**
- * @return
- */
- @Override
- public boolean hasCustomInventoryName()
- {
- return false;
- }
-
- /**
- * @return
- */
- @Override
- public int getInventoryStackLimit()
- {
- return 1;
- }
-
- /**
- *
- */
- @Override
- public void markDirty()
- {
- NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
- for(int i = 0; i < 18; i++)
- if (inventory[i] != null) nbt.setTag("ext" + i, inventory[i].writeToNBT(nbt.getCompoundTag("ext" + i)));
- else nbt.removeTag("ext" + i);
- }
-
- /**
- * @param player
- * @return
- */
- @Override
- public boolean isUseableByPlayer(EntityPlayer player)
- {
- return true;
- }
-
- /**
- *
- */
- @Override
- public void openInventory()
- {}
-
- /**
- *
- */
- @Override
- public void closeInventory()
- {}
-
- /**
- * @param slot
- * @param stack
- * @return
- */
- @Override
- public boolean isItemValidForSlot(int slot, ItemStack stack)
- {
- if (slot >= 0 && slot <= 9 && stack.getItem() instanceof ItemRing) return true;
- else if (slot >= 10 && slot <= 13 && stack.getItem() instanceof ItemBracelet) return true;
- else if (slot >= 14 && slot <= 16 && stack.getItem() instanceof ItemNecklace) return true;
- else if (slot == 17 && stack.getItem() instanceof ItemEarrings) return true;
- return false;
- }
+public class JewelryInventory implements IInventory {
+ public EntityPlayer player;
+ public ItemStack[] inventory = new ItemStack[18];
+
+ /**
+ * @param player
+ */
+ public JewelryInventory(EntityPlayer player) {
+ this.player = player;
+ NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player,
+ Variables.MODID);
+ for (int i = 0; i < 18; i++)
+ inventory[i] = ItemStack
+ .loadItemStackFromNBT(nbt.getCompoundTag("ext" + i));
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getSizeInventory() {
+ return inventory.length;
+ }
+
+ /**
+ * @param slot
+ * @return
+ */
+ @Override
+ public ItemStack getStackInSlot(int slot) {
+ return inventory[slot];
+ }
+
+ /**
+ * @param slot
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int slot, int amount) {
+ ItemStack stack = getStackInSlot(slot);
+ if (stack != null)
+ if (stack.stackSize > amount) {
+ stack = stack.splitStack(amount);
+ markDirty();
+ } else
+ setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ /**
+ * @param slot
+ * @return
+ */
+ @Override
+ public ItemStack getStackInSlotOnClosing(int slot) {
+ ItemStack stack = getStackInSlot(slot);
+ setInventorySlotContents(slot, null);
+ return stack;
+ }
+
+ /**
+ * @param slot
+ * @param stack
+ */
+ @Override
+ public void setInventorySlotContents(int slot, ItemStack stack) {
+ inventory[slot] = stack;
+ if (stack != null && stack.stackSize > getInventoryStackLimit())
+ stack.stackSize = getInventoryStackLimit();
+ markDirty();
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public String getInventoryName() {
+ return "Jewelry";
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public boolean hasCustomInventoryName() {
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getInventoryStackLimit() {
+ return 1;
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void markDirty() {
+ NBTTagCompound nbt = PlayerUtils.getModPlayerPersistTag(player,
+ Variables.MODID);
+ for (int i = 0; i < 18; i++)
+ if (inventory[i] != null)
+ nbt.setTag("ext" + i, inventory[i]
+ .writeToNBT(nbt.getCompoundTag("ext" + i)));
+ else
+ nbt.removeTag("ext" + i);
+ }
+
+ /**
+ * @param playr
+ * @return
+ */
+ @Override
+ public boolean isUseableByPlayer(EntityPlayer playr) {
+ return true;
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void openInventory() {
+ // Do nothing
+ }
+
+ /**
+ *
+ */
+ @Override
+ public void closeInventory() {
+ // Do nothing
+ }
+
+ /**
+ * @param slot
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValidForSlot(int slot, ItemStack stack) {
+ if (slot >= 0 && slot <= 9 && stack.getItem() instanceof ItemRing)
+ return true;
+ else if (slot >= 10 && slot <= 13
+ && stack.getItem() instanceof ItemBracelet)
+ return true;
+ else if (slot >= 14 && slot <= 16
+ && stack.getItem() instanceof ItemNecklace)
+ return true;
+ else if (slot == 17 && stack.getItem() instanceof ItemEarrings)
+ return true;
+ return false;
+ }
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/Page.java b/src/main/java/darkknight/jewelrycraft/client/Page.java
index 866f6f3..f3fcec9 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/Page.java
+++ b/src/main/java/darkknight/jewelrycraft/client/Page.java
@@ -1,8 +1,10 @@
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;
@@ -10,155 +12,215 @@ 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();
- }
- }
+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<>();
+ 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<>();
+ 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<>();
+ 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<>();
+ 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 3468324..09ccb36 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/TabCurses.java
+++ b/src/main/java/darkknight/jewelrycraft/client/TabCurses.java
@@ -5,22 +5,19 @@ import darkknight.jewelrycraft.item.ItemList;
import darkknight.jewelrycraft.network.PacketKeyPressEvent;
import net.minecraft.item.ItemStack;
-public class TabCurses extends AbstractTab
-{
- public TabCurses()
- {
- super(0, 0, 0, new ItemStack(ItemList.testItem, 1, 4));
- }
+public class TabCurses extends AbstractTab {
+ public TabCurses() {
+ super(0, 0, 0, new ItemStack(ItemList.testItem, 1, 4));
+ }
- @Override
- public void onTabClicked ()
- {
- JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(1));
- }
+ @Override
+ public void onTabClicked() {
+ JewelrycraftMod.netWrapper
+ .sendToServer(new PacketKeyPressEvent(1));
+ }
- @Override
- public boolean shouldAddToList ()
- {
- return true;
- }
+ @Override
+ public boolean shouldAddToList() {
+ return true;
+ }
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java b/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java
index 31cd7b4..44d2118 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java
+++ b/src/main/java/darkknight/jewelrycraft/client/TabJewelry.java
@@ -5,22 +5,19 @@ import darkknight.jewelrycraft.item.ItemList;
import darkknight.jewelrycraft.network.PacketKeyPressEvent;
import net.minecraft.item.ItemStack;
-public class TabJewelry extends AbstractTab
-{
- public TabJewelry()
- {
- super(0, 0, 0, new ItemStack(ItemList.necklace));
- }
+public class TabJewelry extends AbstractTab {
+ public TabJewelry() {
+ super(0, 0, 0, new ItemStack(ItemList.necklace));
+ }
- @Override
- public void onTabClicked ()
- {
- JewelrycraftMod.netWrapper.sendToServer(new PacketKeyPressEvent(0));
- }
+ @Override
+ public void onTabClicked() {
+ JewelrycraftMod.netWrapper
+ .sendToServer(new PacketKeyPressEvent(0));
+ }
- @Override
- public boolean shouldAddToList ()
- {
- return true;
- }
+ @Override
+ public boolean shouldAddToList() {
+ return true;
+ }
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java
index fdc579f..21d8b9c 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java
+++ b/src/main/java/darkknight/jewelrycraft/client/TabRegistry.java
@@ -2,6 +2,7 @@ package darkknight.jewelrycraft.client;
import java.util.ArrayList;
import java.util.List;
+
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.common.Loader;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
@@ -16,7 +17,7 @@ import net.minecraftforge.client.event.GuiScreenEvent;
* @author TinkersConstruct
*/
public class TabRegistry {
- private static ArrayList<AbstractTab> tabList = new ArrayList<AbstractTab>();
+ private static ArrayList<AbstractTab> tabList = new ArrayList<>();
public static void registerTab(AbstractTab tab) {
tabList.add(tab);
@@ -26,6 +27,7 @@ public class TabRegistry {
return tabList;
}
+ @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT)
@SubscribeEvent
public void guiPostInit(GuiScreenEvent.InitGuiEvent.Post event) {
@@ -34,38 +36,50 @@ public class TabRegistry {
int ySize = 166;
int guiLeft = (event.gui.width - xSize) / 2;
int guiTop = (event.gui.height - ySize) / 2;
- if (!mc.thePlayer.getActivePotionEffects().isEmpty()) if (Loader.isModLoaded("NotEnoughItems")) {
- try {
- // Check whether NEI is hidden and enabled
- Class<?> c = Class.forName("codechicken.nei.NEIClientConfig");
- Object hidden = c.getMethod("isHidden").invoke(null);
- Object enabled = c.getMethod("isEnabled").invoke(null);
- if (hidden != null && hidden instanceof Boolean && enabled != null && enabled instanceof Boolean) if ((Boolean) hidden || !((Boolean) enabled)) guiLeft += 60;
- } catch (Exception e) {
- }
- } else guiLeft += 60;
+ if (!mc.thePlayer.getActivePotionEffects().isEmpty())
+ if (Loader.isModLoaded("NotEnoughItems")) {
+ try {
+ // Check whether NEI is hidden and enabled
+ Class<?> c = Class.forName(
+ "codechicken.nei.NEIClientConfig");
+ Object hidden =
+ c.getMethod("isHidden").invoke(null);
+ Object enabled =
+ c.getMethod("isEnabled").invoke(null);
+ if (hidden != null && hidden instanceof Boolean
+ && enabled != null
+ && enabled instanceof Boolean)
+ if ((Boolean) hidden || !((Boolean) enabled))
+ guiLeft += 60;
+ } catch (Exception e) {
+ // Do nothing
+ }
+ } else
+ guiLeft += 60;
updateTabValues(guiLeft, guiTop, InventoryTabVanilla.class);
addTabsToList(event.buttonList);
}
}
- private static Minecraft mc = FMLClientHandler.instance().getClient();
+ private static Minecraft mc = FMLClientHandler.instance().getClient();
public static void openInventoryGui() {
- mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(mc.thePlayer.openContainer.windowId));
+ mc.thePlayer.sendQueue.addToSendQueue(new C0DPacketCloseWindow(
+ mc.thePlayer.openContainer.windowId));
GuiInventory inventory = new GuiInventory(mc.thePlayer);
mc.displayGuiScreen(inventory);
}
- public static void updateTabValues(int cornerX, int cornerY, Class<?> selectedButton) {
+ public static void updateTabValues(int cornerX, int cornerY,
+ Class<?> selectedButton) {
int count = 0;
for (int i = 0; i < tabList.size(); i++) {
AbstractTab t = tabList.get(i);
if (t.shouldAddToList()) {
if (selectedButton.equals(TabCurses.class)) {
t.xPosition = cornerX + 195;
- t.yPosition = cornerY + count*20;
- }else if (selectedButton.equals(TabJewelry.class)) {
+ t.yPosition = cornerY + count * 20;
+ } else if (selectedButton.equals(TabJewelry.class)) {
t.xPosition = cornerX + 140 + count * 20;
t.yPosition = cornerY + 64;
} else {
@@ -73,13 +87,15 @@ public class TabRegistry {
t.yPosition = cornerY + 64;
}
t.enabled = !t.getClass().equals(selectedButton);
- if (t.enabled) count++;
+ if (t.enabled)
+ count++;
}
}
}
- public static void addTabsToList(List buttonList) {
+ public static void addTabsToList(List<AbstractTab> buttonList) {
for (AbstractTab tab : tabList)
- if (tab.shouldAddToList() && tab.enabled) buttonList.add(tab);
+ if (tab.shouldAddToList() && tab.enabled)
+ buttonList.add(tab);
}
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java
index 16b946c..acd1a69 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiCurseInfo.java
@@ -2,7 +2,9 @@ package darkknight.jewelrycraft.client.gui;
import java.util.ArrayList;
import java.util.List;
+
import org.lwjgl.opengl.GL11;
+
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.api.Curse;
import darkknight.jewelrycraft.client.TabCurses;
@@ -23,13 +25,14 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
public class GuiCurseInfo extends GuiContainer {
- World world;
- EntityPlayer player;
- ResourceLocation texture;
- int page = 0, maxPages = 1;
- String selectedCurse = "";
+ World world;
+ EntityPlayer player;
+ ResourceLocation texture;
+ int page = 0, maxPages = 1;
+ String selectedCurse = "";
- public GuiCurseInfo(Container container, World world, EntityPlayer player, ResourceLocation texture) {
+ public GuiCurseInfo(Container container, World world,
+ EntityPlayer player, ResourceLocation texture) {
super(container);
this.world = world;
this.player = player;
@@ -38,47 +41,75 @@ public class GuiCurseInfo extends GuiContainer {
ySize = 166;
}
+ @Override
public void drawScreen(int x, int y, float size) {
super.drawScreen(x, y, size);
}
@Override
- public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX,
+ int mouseY) {
GL11.glColor3f(1, 1, 1);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if (player != null) {
- NBTTagCompound playerInfo = PlayerUtils.getModPlayerPersistTag(player, Variables.MODID);
- 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);
+ NBTTagCompound playerInfo = PlayerUtils
+ .getModPlayerPersistTag(player, Variables.MODID);
+ 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);
}
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);
- this.drawString(fontRendererObj, (page + 1) + "/" + (maxPages + 1), guiLeft + 90, guiTop + 153, 0xffffff);
- this.drawString(fontRendererObj, "Click on an active curse to see its description", guiLeft, guiTop + 170, 0xffffff);
+ drawTexturedModalRect(guiLeft + 5, guiTop + ySize - 14, 0, ySize,
+ 13, 11);
+ drawTexturedModalRect(guiLeft + xSize - 38, guiTop + ySize - 14,
+ 13, ySize, 13, 11);
+ this.drawString(fontRendererObj, (page + 1) + "/" + (maxPages + 1),
+ guiLeft + 90, guiTop + 153, 0xffffff);
+ this.drawString(fontRendererObj,
+ "Click on an active curse to see its description", guiLeft,
+ guiTop + 170, 0xffffff);
if (player.capabilities.isCreativeMode) {
- drawText(this, "To enable or disable a curse simply hold the CTRL key and click on one.", guiLeft - 100, guiTop, 20, 0xff0000);
- drawText(this, "If you do not have any curse points you need to type the command '/jw addCursePoints [playerUsername] [no of curse points]'. If you don't do this any curse you activate won't have any effect.", guiLeft - 100, guiTop + 50, 20, 0xff0000);
+ drawText(this,
+ "To enable or disable a curse simply hold the CTRL key and click on one.",
+ guiLeft - 100, guiTop, 20, 0xff0000);
+ drawText(this,
+ "If you do not have any curse points you need to type the command '/jw addCursePoints [playerUsername] [no of curse points]'. If you don't do this any curse you activate won't have any effect.",
+ guiLeft - 100, guiTop + 50, 20, 0xff0000);
}
}
- public static void drawText(GuiCurseInfo gui, String text, int x, int y, int characters, int color) {
+ public static void drawText(GuiCurseInfo gui, String text, int x,
+ int y, int characters, int color) {
String[] s = text.split(" ");
String displayText = "";
- ArrayList<String> textLines = new ArrayList<String>();
+ ArrayList<String> textLines = new ArrayList<>();
for (String element : s)
- if ((displayText + element + " ").length() <= characters) displayText += element + " ";
+ if ((displayText + element + " ").length() <= characters)
+ displayText += element + " ";
else {
textLines.add(displayText.trim());
displayText = element + " ";
}
textLines.add(displayText.trim());
for (int i = 0; i < textLines.size(); i++)
- gui.drawString(gui.getFont(), textLines.get(i), x, y + i * 9, color);
+ gui.drawString(gui.getFont(), textLines.get(i), x, y + i * 9,
+ color);
}
public FontRenderer getFont() {
@@ -92,41 +123,80 @@ public class GuiCurseInfo extends GuiContainer {
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 + 8 + (size - 8) * (ind - page * 5), 0, 32, 112, 22);
+ if (ind == page * 5 && selectedCurse == "")
+ selectedCurse = curse.getName();
+ 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);
+ 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);
+ 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);
+ 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);
+ 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.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glColor4f(1f, 1f, 1f, 0.5f);
- drawTexturedModalRect(guiLeft + 134, guiTop + 11 + (size - 8) * (ind - page * 5), 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();
}
- mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png"));
+ mc.renderEngine.bindTexture(
+ new ResourceLocation(Variables.MODID,
+ "textures/gui/"
+ + curse.getTexturePack()
+ + ".png"));
int tag = curse.getTextureID();
GL11.glPushMatrix();
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);
+ 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), 0xffffff);
+ this.drawString(fontRendererObj,
+ curse.getDisplayName(), guiLeft + 70,
+ guiTop + 15
+ + (ind - page * 5) * (size - 8),
+ 0xffffff);
}
ind++;
}
@@ -139,39 +209,69 @@ public class GuiCurseInfo extends GuiContainer {
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 (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);
- if (!curse.canCurseBeActivated() || !ConfigHandler.CURSES_ENABLED) GL11.glColor4f(1f, 0f, 0f, 0.5f);
- else GL11.glColor4f(1f, 1f, 1f, 0.5f);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA,
+ GL11.GL_ONE_MINUS_SRC_ALPHA);
+ if (!curse.canCurseBeActivated()
+ || !ConfigHandler.CURSES_ENABLED)
+ GL11.glColor4f(1f, 0f, 0f, 0.5f);
+ else
+ 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);
+ 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);
+ 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);
+ 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);
+ 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();
}
- mc.renderEngine.bindTexture(new ResourceLocation(Variables.MODID, "textures/gui/" + curse.getTexturePack() + ".png"));
+ 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);
+ 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);
+ 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);
+ 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();
@@ -182,12 +282,15 @@ public class GuiCurseInfo extends GuiContainer {
}
@Override
- public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {}
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
+ // Do nothing
+ }
@Override
protected void keyTyped(char charecter, int key) {
super.keyTyped(charecter, key);
- if (key == KeyBindings.curses.getKeyCode()) mc.thePlayer.closeScreen();
+ if (key == KeyBindings.curses.getKeyCode())
+ mc.thePlayer.closeScreen();
}
@Override
@@ -200,44 +303,78 @@ public class GuiCurseInfo extends GuiContainer {
TabRegistry.addTabsToList(this.buttonList);
}
+ @Override
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);
+ 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) {
+ 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);
+ 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 && curse.canCurseBeActivated() && ConfigHandler.CURSES_ENABLED) {
+ 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
+ && curse.canCurseBeActivated()
+ && ConfigHandler.CURSES_ENABLED) {
playerInfo.setInteger(curse.getName(), 1);
- playerInfo.setInteger("activeCurses", playerInfo.getInteger("activeCurses") + 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();
+ 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();
+ } 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) {
+ 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) {
+ if (page < maxPages && x > guiLeft + xSize - 38
+ && x < guiLeft + xSize - 25 && y > guiTop + ySize - 14
+ && y < guiTop + ySize - 3) {
page++;
selectedCurse = "";
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java
index aa47840..a91b5a4 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiGuide.java
@@ -2,7 +2,9 @@ package darkknight.jewelrycraft.client.gui;
import java.util.ArrayList;
import java.util.List;
+
import org.lwjgl.opengl.GL11;
+
import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.block.BlockShadowEye;
import net.minecraft.block.Block;
@@ -18,200 +20,219 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-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;
- // GUIDE
- public static GuiTab prevActive = new GuiTabIntroduction(0);
- public static int prevPage = 1;
-
- public GuiGuide(Container container, World world, ResourceLocation pageTex, ResourceLocation flipPageTex)
- {
- super(container);
- page = prevPage;
- rot = 0;
- del = 0;
- this.world = world;
- activeTab = 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(page + "/" + activeTab.getMaxPages());
- drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(), guiTop + 150 + 25, fontRendererObj);
- if (page < activeTab.getMaxPages()) {
- text.remove(0);
- text.add((page + 1) + "/" + activeTab.getMaxPages());
- 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;
- prevPage = page;
- }else
- if (prevHover && page > 1) {
- page -= 2;
- prevPage = page;
- }
- activeTab.mouseClick(this, x, y, button);
- for(GuiTab tab: tabs)
- if (activeTab != tab)
- if (tab.inRect(this, x, y)) {
- activeTab = tab;
- prevActive = tab;
- page = 1;
- 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);
- RenderHelper.enableGUIStandardItemLighting();
- }
+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;
+ // GUIDE
+ public static GuiTab prevActive = new GuiTabIntroduction(0);
+ public static int prevPage = 1;
+
+ public GuiGuide(Container container, World world,
+ ResourceLocation pageTex, ResourceLocation flipPageTex) {
+ super(container);
+ page = prevPage;
+ rot = 0;
+ del = 0;
+ this.world = world;
+ activeTab = 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<>();
+ text.add(page + "/" + activeTab.getMaxPages());
+ drawHoveringText(text, guiLeft - 10 + 20 - text.get(0).length(),
+ guiTop + 150 + 25, fontRendererObj);
+ if (page < activeTab.getMaxPages()) {
+ text.remove(0);
+ text.add((page + 1) + "/" + activeTab.getMaxPages());
+ 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;
+ prevPage = page;
+ } else if (prevHover && page > 1) {
+ page -= 2;
+ prevPage = page;
+ }
+ activeTab.mouseClick(this, x, y, button);
+ for (GuiTab tab : tabs)
+ if (activeTab != tab)
+ if (tab.inRect(this, x, y)) {
+ activeTab = tab;
+ prevActive = tab;
+ page = 1;
+ 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);
+ RenderHelper.enableGUIStandardItemLighting();
+ }
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java
index 0218886..ae21f08 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiHandler.java
@@ -16,78 +16,99 @@ import net.minecraft.tileentity.TileEntityChest;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
-public class GuiHandler implements IGuiHandler
-{
- ResourceLocation pageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePage.png");
- ResourceLocation flippedPageTexture = new ResourceLocation(Variables.MODID, "textures/gui/guidePageFlip.png");
- ResourceLocation chestTexture = new ResourceLocation(Variables.MODID, "textures/gui/chest_ring.png");
- ResourceLocation jewelryInvTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_tab.png");
- ResourceLocation cursesInvTexture = new ResourceLocation(Variables.MODID, "textures/gui/curses_tab.png");
- ResourceLocation jewlryModTexture = new ResourceLocation(Variables.MODID, "textures/gui/jewelry_modifier.png");
-
- /**
- *
- */
- public GuiHandler()
- {
- NetworkRegistry.INSTANCE.registerGuiHandler(JewelrycraftMod.instance, this);
- }
-
- /**
- * @param ID
- * @param player
- * @param world
- * @param x
- * @param y
- * @param z
- * @return
- */
- @Override
- public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- switch(ID)
- {
- case 0:
- return new ContainerRingChest(player.inventory, (TileEntityChest)world.getTileEntity(x, y, z));
- case 1:
- return new ContainerGuide();
- case 2:
- return new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player));
- case 3:
- return new ContainerJewelryModifier(player.inventory, new InventoryBasic("ItemModifier", false, 37));
- case 4:
- return new ContainerCurseInfo();
- default:
- return null;
- }
- }
-
- /**
- * @param ID
- * @param player
- * @param world
- * @param x
- * @param y
- * @param z
- * @return
- */
- @Override
- public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
- {
- switch(ID)
- {
- case 0:
- return new GuiRingChest((ContainerRingChest)getServerGuiElement(ID, player, world, x, y, z), chestTexture);
- case 1:
- return new GuiGuide((ContainerGuide)getServerGuiElement(ID, player, world, x, y, z), world, pageTexture, flippedPageTexture);
- case 2:
- return new GuiJewelry(new ContainerJewelryTab(player, player.inventory, new JewelryInventory(player)), jewelryInvTexture);
- case 3:
- return new GuiJewelryModifier((ContainerJewelryModifier)getServerGuiElement(ID, player, world, x, y, z), jewlryModTexture);
- case 4:
- return new GuiCurseInfo((ContainerCurseInfo)getServerGuiElement(ID, player, world, x, y, z), world, player, cursesInvTexture);
- default:
- return null;
- }
- }
+public class GuiHandler implements IGuiHandler {
+ ResourceLocation pageTexture = new ResourceLocation(
+ Variables.MODID, "textures/gui/guidePage.png");
+ ResourceLocation flippedPageTexture = new ResourceLocation(
+ Variables.MODID, "textures/gui/guidePageFlip.png");
+ ResourceLocation chestTexture = new ResourceLocation(
+ Variables.MODID, "textures/gui/chest_ring.png");
+ ResourceLocation jewelryInvTexture = new ResourceLocation(
+ Variables.MODID, "textures/gui/jewelry_tab.png");
+ ResourceLocation cursesInvTexture = new ResourceLocation(
+ Variables.MODID, "textures/gui/curses_tab.png");
+ ResourceLocation jewlryModTexture = new ResourceLocation(
+ Variables.MODID, "textures/gui/jewelry_modifier.png");
+
+ /**
+ *
+ */
+ public GuiHandler() {
+ NetworkRegistry.INSTANCE
+ .registerGuiHandler(JewelrycraftMod.instance, this);
+ }
+
+ /**
+ * @param ID
+ * @param player
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ public Object getServerGuiElement(int ID, EntityPlayer player,
+ World world, int x, int y, int z) {
+ switch (ID) {
+ case 0:
+ return new ContainerRingChest(player.inventory,
+ (TileEntityChest) world.getTileEntity(x, y, z));
+ case 1:
+ return new ContainerGuide();
+ case 2:
+ return new ContainerJewelryTab(player, player.inventory,
+ new JewelryInventory(player));
+ case 3:
+ return new ContainerJewelryModifier(player.inventory,
+ new InventoryBasic("ItemModifier", false, 37));
+ case 4:
+ return new ContainerCurseInfo();
+ default:
+ return null;
+ }
+ }
+
+ /**
+ * @param ID
+ * @param player
+ * @param world
+ * @param x
+ * @param y
+ * @param z
+ * @return
+ */
+ @Override
+ public Object getClientGuiElement(int ID, EntityPlayer player,
+ World world, int x, int y, int z) {
+ switch (ID) {
+ case 0:
+ return new GuiRingChest(
+ (ContainerRingChest) getServerGuiElement(ID,
+ player, world, x, y, z),
+ chestTexture);
+ case 1:
+ return new GuiGuide(
+ (ContainerGuide) getServerGuiElement(ID, player,
+ world, x, y, z),
+ world, pageTexture, flippedPageTexture);
+ case 2:
+ return new GuiJewelry(
+ new ContainerJewelryTab(player, player.inventory,
+ new JewelryInventory(player)),
+ jewelryInvTexture);
+ case 3:
+ return new GuiJewelryModifier(
+ (ContainerJewelryModifier) getServerGuiElement(ID,
+ player, world, x, y, z),
+ jewlryModTexture);
+ case 4:
+ return new GuiCurseInfo(
+ (ContainerCurseInfo) getServerGuiElement(ID,
+ player, world, x, y, z),
+ world, player, cursesInvTexture);
+ default:
+ return null;
+ }
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java
index b08ea37..bccf2b1 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelry.java
@@ -1,6 +1,7 @@
package darkknight.jewelrycraft.client.gui;
import org.lwjgl.opengl.GL11;
+
import darkknight.jewelrycraft.client.TabJewelry;
import darkknight.jewelrycraft.client.TabRegistry;
import darkknight.jewelrycraft.client.gui.container.ContainerJewelryTab;
@@ -10,65 +11,66 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.inventory.GuiInventory;
import net.minecraft.util.ResourceLocation;
-public class GuiJewelry extends GuiContainer
-{
- ResourceLocation texture;
-
- /**
- * @param containerJewelryTab
- * @param texture
- */
- public GuiJewelry(ContainerJewelryTab containerJewelryTab, ResourceLocation texture)
- {
- super(containerJewelryTab);
- xSize = 194;
- ySize = 166;
- this.texture = texture;
- }
-
- /**
- * @param f
- * @param mouseX
- * @param mouseY
- */
- @Override
- public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY)
- {
- GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
- drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
- GL11.glPushMatrix();
- GuiInventory.func_147046_a(guiLeft - 24, guiTop + 124, 60, (float)(guiLeft - 24) - mouseX, (float)(guiTop + 124 - 90) - mouseY, this.mc.thePlayer);
- GL11.glPopMatrix();
- }
-
- /**
- * @param mouseX
- * @param mouseY
- */
- @Override
- public void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
- {}
-
- /**
- * @param charecter
- * @param key
- */
- @Override
- protected void keyTyped(char charecter, int key)
- {
- super.keyTyped(charecter, key);
- if (key == KeyBindings.inventory.getKeyCode()) mc.thePlayer.closeScreen();
- }
+public class GuiJewelry extends GuiContainer {
+ ResourceLocation texture;
+
+ /**
+ * @param containerJewelryTab
+ * @param texture
+ */
+ public GuiJewelry(ContainerJewelryTab containerJewelryTab,
+ ResourceLocation texture) {
+ super(containerJewelryTab);
+ xSize = 194;
+ ySize = 166;
+ this.texture = texture;
+ }
+
+ /**
+ * @param f
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX,
+ int mouseY) {
+ GL11.glColor3f(1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
+ GL11.glPushMatrix();
+ GuiInventory.func_147046_a(guiLeft - 24, guiTop + 124, 60,
+ (float) (guiLeft - 24) - mouseX,
+ (float) (guiTop + 124 - 90) - mouseY, this.mc.thePlayer);
+ GL11.glPopMatrix();
+ }
+
+ /**
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
+ // Do nothing
+ }
+
+ /**
+ * @param charecter
+ * @param key
+ */
+ @Override
+ protected void keyTyped(char charecter, int key) {
+ super.keyTyped(charecter, key);
+ if (key == KeyBindings.inventory.getKeyCode())
+ mc.thePlayer.closeScreen();
+ }
- @Override
- public void initGui ()
- {
- super.initGui();
- int cornerX = guiLeft;
- int cornerY = guiTop;
- this.buttonList.clear();
- TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class);
- TabRegistry.addTabsToList(this.buttonList);
- }
+ @Override
+ public void initGui() {
+ super.initGui();
+ int cornerX = guiLeft;
+ int cornerY = guiTop;
+ this.buttonList.clear();
+ TabRegistry.updateTabValues(cornerX, cornerY, TabJewelry.class);
+ TabRegistry.addTabsToList(this.buttonList);
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java
index 23f137f..df8035c 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiJewelryModifier.java
@@ -4,8 +4,10 @@ import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
+
import darkknight.jewelrycraft.JewelrycraftMod;
import darkknight.jewelrycraft.client.gui.container.ContainerJewelryModifier;
import darkknight.jewelrycraft.network.PacketRequestSetSlot;
@@ -22,13 +24,21 @@ import net.minecraft.util.ResourceLocation;
public class GuiJewelryModifier extends GuiContainer {
private ResourceLocation texture;
private GuiTextField searchField, pages;
- private int page = 1, maxPages = 1, selectedX = 0, selectedY = 0, selectedPage = 0, enabled = 0;
+ private int page =
+ 1, maxPages = 1, selectedX = 0, selectedY = 0,
+ selectedPage = 0, enabled = 0;
private ItemStack selectedItem;
- private ArrayList<ItemStack> selectedItems = new ArrayList<ItemStack>();
- private List<Map<Integer, Map<Integer, Integer>>> selectedItemsPos = new ArrayList<Map<Integer, Map<Integer, Integer>>>();
+ private ArrayList<
+ ItemStack> selectedItems =
+ new ArrayList<>();
+ private List<Map<Integer,
+ Map<Integer,
+ Integer>>> selectedItemsPos =
+ new ArrayList<>();
ContainerJewelryModifier jMod;
- public GuiJewelryModifier(ContainerJewelryModifier containerJewelryTab, ResourceLocation texture) {
+ public GuiJewelryModifier(ContainerJewelryModifier containerJewelryTab,
+ ResourceLocation texture) {
super(containerJewelryTab);
xSize = 211;
ySize = 247;
@@ -38,17 +48,24 @@ public class GuiJewelryModifier extends GuiContainer {
}
@Override
- public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) {
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX,
+ int mouseY) {
GL11.glColor3f(1, 1, 1);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
- if (selectedX != 0 && selectedY != 0 && page == selectedPage) drawTexturedModalRect(k + selectedX, l + selectedY, 211, 0, 18, 18);
- for (Map<Integer, Map<Integer, Integer>> items : selectedItemsPos) {
+ if (selectedX != 0 && selectedY != 0 && page == selectedPage)
+ drawTexturedModalRect(k + selectedX, l + selectedY, 211, 0, 18,
+ 18);
+ for (Map<Integer,
+ Map<Integer, Integer>> items : selectedItemsPos) {
for (Object itemPage : items.keySet()) {
- if (page == (Integer) itemPage) for (int x : ((Map<Integer, Integer>) items.get(itemPage)).keySet())
- drawTexturedModalRect(k + x, l + (int) ((Map<Integer, Integer>) items.get(itemPage)).get(x), 211, 0, 18, 18);
+ if (page == (Integer) itemPage)
+ for (int x : items.get(itemPage).keySet())
+ drawTexturedModalRect(k + x,
+ l + items.get(itemPage).get(x), 211, 0, 18,
+ 18);
}
}
this.searchField.drawTextBox();
@@ -59,16 +76,29 @@ public class GuiJewelryModifier extends GuiContainer {
public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
int i = 0;
for (ItemStack item : JewelrycraftUtil.objects) {
- if (item != null && item.getItem() != null && (this.searchField.getText() == "" || item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase()))) {
+ if (item != null && item.getItem() != null
+ && (this.searchField.getText() == ""
+ || item.getDisplayName().toLowerCase()
+ .contains(this.searchField.getText()
+ .toLowerCase()))) {
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glColor3f(1F, 1F, 1F);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
- if (i >= (page - 1) * 48 && i < page * 48) try {
- itemRender.renderItemAndEffectIntoGUI(this.fontRendererObj, this.mc.getTextureManager(), item, 88 + 20 * (i % 6), 7 + 17 * (i / 6) - 136 * (page - 1));
- } catch (Exception e) {
- JewelrycraftMod.logger.info("Trying to display an item but gets this error: " + e.getMessage() + "\nThe item causing the issue is: " + item);
- }
+ if (i >= (page - 1) * 48 && i < page * 48)
+ try {
+ itemRender.renderItemAndEffectIntoGUI(
+ this.fontRendererObj,
+ this.mc.getTextureManager(), item,
+ 88 + 20 * (i % 6),
+ 7 + 17 * (i / 6) - 136 * (page - 1));
+ } catch (Exception e) {
+ JewelrycraftMod.logger
+ .info("Trying to display an item but gets this error: "
+ + e.getMessage()
+ + "\nThe item causing the issue is: "
+ + item);
+ }
GL11.glDisable(GL11.GL_LIGHTING);
i++;
}
@@ -80,22 +110,35 @@ public class GuiJewelryModifier extends GuiContainer {
if (this.searchField.textboxKeyTyped(character, key)) {
int items = 0;
for (ItemStack item : JewelrycraftUtil.objects)
- if (item != null && searchField != null && searchField.getText() != "" && item.getItem() != null && item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase())) items++;
+ if (item != null && searchField != null
+ && searchField.getText() != ""
+ && item.getItem() != null
+ && item.getDisplayName().toLowerCase().contains(
+ this.searchField.getText().toLowerCase()))
+ items++;
maxPages = items / 48 + 1;
page = 1;
this.pages.setText(page + "/" + maxPages);
- } else super.keyTyped(character, key);
+ } else
+ super.keyTyped(character, key);
}
+ @Override
protected void mouseClicked(int x, int y, int id) {
super.mouseClicked(x, y, id);
- if (x >= this.searchField.xPosition && x <= this.searchField.xPosition + this.searchField.width && y >= this.searchField.yPosition && y <= this.searchField.yPosition + this.searchField.height) {
+ if (x >= this.searchField.xPosition
+ && x <= this.searchField.xPosition + this.searchField.width
+ && y >= this.searchField.yPosition
+ && y <= this.searchField.yPosition
+ + this.searchField.height) {
this.searchField.setText("");
this.searchField.setFocused(true);
maxPages = JewelrycraftUtil.objects.size() / 48 + 1;
- } else this.searchField.setFocused(false);
+ } else
+ this.searchField.setFocused(false);
for (Object button : this.buttonList) {
- if (((GuiButton) button).id < 4 && ((GuiButton) button).mousePressed(mc, x, y)) {
+ if (((GuiButton) button).id < 4
+ && ((GuiButton) button).mousePressed(mc, x, y)) {
if (((GuiButton) button).id != 3) {
this.selectedItems.removeAll(selectedItems);
this.selectedItemsPos.removeAll(selectedItemsPos);
@@ -114,18 +157,35 @@ public class GuiJewelryModifier extends GuiContainer {
}
int i = 0;
for (ItemStack item : JewelrycraftUtil.objects) {
- if (item != null && item.getItem() != null && (this.searchField.getText() == "" || item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase()))) {
- if (i >= (page - 1) * 48 && i < page * 48 && x >= this.guiLeft + 88 + 20 * (i % 6) && x < this.guiLeft + 108 + 20 * (i % 6) && y >= this.guiTop + 9 + 17 * (i / 6) - 136 * (page - 1) && y < this.guiTop + 25 + 17 * (i / 6) - 136 * (page - 1)) {
+ if (item != null && item.getItem() != null
+ && (this.searchField.getText() == ""
+ || item.getDisplayName().toLowerCase()
+ .contains(this.searchField.getText()
+ .toLowerCase()))) {
+ if (i >= (page - 1) * 48 && i < page * 48
+ && x >= this.guiLeft + 88 + 20 * (i % 6)
+ && x < this.guiLeft + 108 + 20 * (i % 6)
+ && y >= this.guiTop + 9 + 17 * (i / 6)
+ - 136 * (page - 1)
+ && y < this.guiTop + 25 + 17 * (i / 6)
+ - 136 * (page - 1)) {
try {
- if (!((GuiButton) buttonList.get(0)).enabled || !((GuiButton) buttonList.get(1)).enabled || !((GuiButton) buttonList.get(2)).enabled) {
+ if (!((GuiButton) buttonList.get(0)).enabled
+ || !((GuiButton) buttonList.get(1)).enabled
+ || !((GuiButton) buttonList
+ .get(2)).enabled) {
this.selectedItem = item;
this.selectedX = 87 + 20 * (i % 6);
- this.selectedY = 6 + 17 * (i / 6) - 136 * (page - 1);
+ this.selectedY =
+ 6 + 17 * (i / 6) - 136 * (page - 1);
this.selectedPage = page;
- } else if (!((GuiButton) buttonList.get(3)).enabled) {
- Map<Integer, Map<Integer, Integer>> itemPage = new HashMap<Integer, Map<Integer, Integer>>();
- Map<Integer, Integer> pos = new HashMap<Integer, Integer>();
- pos.put(87 + 20 * (i % 6), 6 + 17 * (i / 6) - 136 * (page - 1));
+ } else if (!((GuiButton) buttonList
+ .get(3)).enabled) {
+ Map<Integer, Map<Integer, Integer>> itemPage =
+ new HashMap<>();
+ Map<Integer, Integer> pos = new HashMap<>();
+ pos.put(87 + 20 * (i % 6),
+ 6 + 17 * (i / 6) - 136 * (page - 1));
itemPage.put(page, pos);
if (!this.selectedItems.contains(item)) {
this.selectedItems.add(item);
@@ -136,35 +196,57 @@ public class GuiJewelryModifier extends GuiContainer {
}
}
} catch (Exception e) {
- JewelrycraftMod.logger.info("Trying to display an item but gets this error: " + e.getMessage() + "\nThe item causing the issue is: " + item);
+ JewelrycraftMod.logger
+ .info("Trying to display an item but gets this error: "
+ + e.getMessage()
+ + "\nThe item causing the issue is: "
+ + item);
}
}
i++;
}
}
- if (((GuiButton) buttonList.get(5)).mousePressed(mc, x, y) && page > 1) page--;
- if (((GuiButton) buttonList.get(6)).mousePressed(mc, x, y) && page < maxPages) page++;
+ if (((GuiButton) buttonList.get(5)).mousePressed(mc, x, y)
+ && page > 1)
+ page--;
+ if (((GuiButton) buttonList.get(6)).mousePressed(mc, x, y)
+ && page < maxPages)
+ page++;
if (jMod.modInv.getStackInSlot(36) != null) {
ItemStack targetItem = jMod.modInv.getStackInSlot(36).copy();
- if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y) && !((GuiButton) buttonList.get(0)).enabled) {
+ if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y)
+ && !((GuiButton) buttonList.get(0)).enabled) {
JewelryNBT.addIngotColor(targetItem, 16777215);
- JewelryNBT.addMetal(targetItem, new ItemStack(Item.getItemById(0), 0, 0));
- if (selectedItem != null) JewelryNBT.addMetal(targetItem, this.selectedItem);
- JewelrycraftMod.netWrapper.sendToServer(new PacketRequestSetSlot(targetItem));
+ JewelryNBT.addMetal(targetItem,
+ new ItemStack(Item.getItemById(0), 0, 0));
+ if (selectedItem != null)
+ JewelryNBT.addMetal(targetItem, this.selectedItem);
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketRequestSetSlot(targetItem));
}
- if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y) && !((GuiButton) buttonList.get(1)).enabled) {
+ if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y)
+ && !((GuiButton) buttonList.get(1)).enabled) {
JewelryNBT.addGemColor(targetItem, 16777215);
- JewelryNBT.addGem(targetItem, new ItemStack(Item.getItemById(0), 0, 0));
- if (selectedItem != null) JewelryNBT.addGem(targetItem, this.selectedItem);
- JewelrycraftMod.netWrapper.sendToServer(new PacketRequestSetSlot(targetItem));
+ JewelryNBT.addGem(targetItem,
+ new ItemStack(Item.getItemById(0), 0, 0));
+ if (selectedItem != null)
+ JewelryNBT.addGem(targetItem, this.selectedItem);
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketRequestSetSlot(targetItem));
}
- if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y) && !((GuiButton) buttonList.get(2)).enabled) {
- if (selectedItem != null) JewelryNBT.addItem(targetItem, selectedItem);
- JewelrycraftMod.netWrapper.sendToServer(new PacketRequestSetSlot(targetItem));
+ if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y)
+ && !((GuiButton) buttonList.get(2)).enabled) {
+ if (selectedItem != null)
+ JewelryNBT.addItem(targetItem, selectedItem);
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketRequestSetSlot(targetItem));
}
- if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y) && !((GuiButton) buttonList.get(3)).enabled) {
- if (!selectedItems.isEmpty()) JewelryNBT.addModifiers(targetItem, selectedItems);
- JewelrycraftMod.netWrapper.sendToServer(new PacketRequestSetSlot(targetItem));
+ if (((GuiButton) buttonList.get(4)).mousePressed(mc, x, y)
+ && !((GuiButton) buttonList.get(3)).enabled) {
+ if (!selectedItems.isEmpty())
+ JewelryNBT.addModifiers(targetItem, selectedItems);
+ JewelrycraftMod.netWrapper.sendToServer(
+ new PacketRequestSetSlot(targetItem));
}
}
this.pages.setText(page + "/" + maxPages);
@@ -173,36 +255,62 @@ public class GuiJewelryModifier extends GuiContainer {
@Override
public void initGui() {
super.initGui();
- this.searchField = new GuiTextField(this.fontRendererObj, this.guiLeft + 89, this.guiTop + 148, 115, this.fontRendererObj.FONT_HEIGHT + 3);
+ this.searchField = new GuiTextField(this.fontRendererObj,
+ this.guiLeft + 89, this.guiTop + 148, 115,
+ this.fontRendererObj.FONT_HEIGHT + 3);
this.searchField.setMaxStringLength(15);
this.searchField.setTextColor(16777215);
this.searchField.setVisible(true);
this.searchField.setCanLoseFocus(true);
- this.pages = new GuiTextField(this.fontRendererObj, this.guiLeft + 20, this.guiTop + 146, 50, this.fontRendererObj.FONT_HEIGHT + 3);
+ this.pages = new GuiTextField(this.fontRendererObj,
+ this.guiLeft + 20, this.guiTop + 146, 50,
+ this.fontRendererObj.FONT_HEIGHT + 3);
this.pages.setMaxStringLength(15);
this.pages.setTextColor(16777215);
this.pages.setVisible(true);
this.pages.setText(page + "/" + maxPages);
- this.buttonList.add(new GuiButton(0, this.guiLeft + 17, this.guiTop + 30, 52, 20, "Metal"));
- this.buttonList.add(new GuiButton(1, this.guiLeft + 17, this.guiTop + 52, 52, 20, "Gem"));
- this.buttonList.add(new GuiButton(2, this.guiLeft + 17, this.guiTop + 74, 52, 20, "Item"));
- this.buttonList.add(new GuiButton(3, this.guiLeft + 17, this.guiTop + 96, 52, 20, "Modifiers"));
- this.buttonList.add(new GuiButton(4, this.guiLeft + 17, this.guiTop + 118, 52, 20, "Add Items"));
- this.buttonList.add(new GuiButton(5, this.guiLeft + 5, this.guiTop + 142, 13, 20, "<<"));
- this.buttonList.add(new GuiButton(6, this.guiLeft + 73, this.guiTop + 142, 13, 20, ">>"));
+ this.buttonList.add(new GuiButton(0, this.guiLeft + 17,
+ this.guiTop + 30, 52, 20, "Metal"));
+ this.buttonList.add(new GuiButton(1, this.guiLeft + 17,
+ this.guiTop + 52, 52, 20, "Gem"));
+ this.buttonList.add(new GuiButton(2, this.guiLeft + 17,
+ this.guiTop + 74, 52, 20, "Item"));
+ this.buttonList.add(new GuiButton(3, this.guiLeft + 17,
+ this.guiTop + 96, 52, 20, "Modifiers"));
+ this.buttonList.add(new GuiButton(4, this.guiLeft + 17,
+ this.guiTop + 118, 52, 20, "Add Items"));
+ this.buttonList.add(new GuiButton(5, this.guiLeft + 5,
+ this.guiTop + 142, 13, 20, "<<"));
+ this.buttonList.add(new GuiButton(6, this.guiLeft + 73,
+ this.guiTop + 142, 13, 20, ">>"));
((GuiButton) buttonList.get(enabled)).enabled = false;
}
+ @Override
public void drawScreen(int x, int y, float z) {
super.drawScreen(x, y, z);
int i = 0;
- List<String> list = new ArrayList<String>();
+ List<String> list = new ArrayList<>();
for (ItemStack item : JewelrycraftUtil.objects) {
- if (item != null && item.getItem() != null && (this.searchField.getText() == "" || item.getDisplayName().toLowerCase().contains(this.searchField.getText().toLowerCase()))) {
- if (i >= (page - 1) * 48 && i < page * 48 && x >= this.guiLeft + 88 + 20 * (i % 6) && x < this.guiLeft + 108 + 20 * (i % 6) && y >= this.guiTop + 9 + 17 * (i / 6) - 136 * (page - 1) && y < this.guiTop + 25 + 17 * (i / 6) - 136 * (page - 1)) {
+ if (item != null && item.getItem() != null
+ && (this.searchField.getText() == ""
+ || item.getDisplayName().toLowerCase()
+ .contains(this.searchField.getText()
+ .toLowerCase()))) {
+ if (i >= (page - 1) * 48 && i < page * 48
+ && x >= this.guiLeft + 88 + 20 * (i % 6)
+ && x < this.guiLeft + 108 + 20 * (i % 6)
+ && y >= this.guiTop + 9 + 17 * (i / 6)
+ - 136 * (page - 1)
+ && y < this.guiTop + 25 + 17 * (i / 6)
+ - 136 * (page - 1)) {
list.add(item.getDisplayName());
- if (item.getTooltip(mc.thePlayer, mc.gameSettings.advancedItemTooltips) != null) this.renderToolTip(item, x, y);
- else this.drawHoveringText(list, x, y, this.fontRendererObj);
+ if (item.getTooltip(mc.thePlayer,
+ mc.gameSettings.advancedItemTooltips) != null)
+ this.renderToolTip(item, x, y);
+ else
+ this.drawHoveringText(list, x, y,
+ this.fontRendererObj);
}
i++;
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java
index 7a20854..9ce5814 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRectangle.java
@@ -1,96 +1,95 @@
package darkknight.jewelrycraft.client.gui;
import java.util.Arrays;
+
import net.minecraft.item.ItemStack;
-public class GuiRectangle
-{
- private int x;
- private int y;
- private int w;
- private int h;
-
- /**
- * @param x
- * @param y
- * @param w
- * @param h
- */
- public GuiRectangle(int x, int y, int w, int h)
- {
- this.x = x;
- this.y = y;
- this.w = w;
- this.h = h;
- }
-
- /**
- * @param gui
- * @param mouseX
- * @param mouseY
- * @return
- */
- public boolean inRect(GuiGuide gui, int mouseX, int mouseY)
- {
- mouseX -= gui.getLeft();
- mouseY -= gui.getTop();
- return x <= mouseX && mouseX <= x + w && y <= mouseY && mouseY <= y + h;
- }
-
- /**
- * @param x
- */
- public void setX(int x)
- {
- this.x = x;
- }
-
- /**
- * @param y
- */
- public void setY(int y)
- {
- this.y = y;
- }
-
- /**
- * @param gui
- * @param srcX
- * @param srcY
- */
- public void draw(GuiGuide gui, int srcX, int srcY)
- {
- gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, w, h);
- }
-
- /**
- * @param gui
- * @param srcX
- * @param srcY
- * @param width
- * @param height
- */
- public void draw(GuiGuide gui, int srcX, int srcY, int width, int height)
- {
- gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, width, height);
- }
-
- /**
- * @param gui
- * @param mouseX
- * @param mouseY
- * @param str
- */
- public void drawString(GuiGuide gui, int mouseX, int mouseY, String str)
- {
- if (inRect(gui, mouseX, mouseY)) gui.drawHoverString(Arrays.asList(str.split("\n")), mouseX - gui.getLeft(), mouseY - gui.getTop());
- }
-
- /**
- * @return
- */
- public ItemStack getIcon()
- {
- return null;
- }
+public class GuiRectangle {
+ private int x;
+ private int y;
+ private int w;
+ private int h;
+
+ /**
+ * @param x
+ * @param y
+ * @param w
+ * @param h
+ */
+ public GuiRectangle(int x, int y, int w, int h) {
+ this.x = x;
+ this.y = y;
+ this.w = w;
+ this.h = h;
+ }
+
+ /**
+ * @param gui
+ * @param mouseX
+ * @param mouseY
+ * @return
+ */
+ public boolean inRect(GuiGuide gui, int mouseX, int mouseY) {
+ mouseX -= gui.getLeft();
+ mouseY -= gui.getTop();
+ return x <= mouseX && mouseX <= x + w && y <= mouseY
+ && mouseY <= y + h;
+ }
+
+ /**
+ * @param x
+ */
+ public void setX(int x) {
+ this.x = x;
+ }
+
+ /**
+ * @param y
+ */
+ public void setY(int y) {
+ this.y = y;
+ }
+
+ /**
+ * @param gui
+ * @param srcX
+ * @param srcY
+ */
+ public void draw(GuiGuide gui, int srcX, int srcY) {
+ gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y,
+ srcX, srcY, w, h);
+ }
+
+ /**
+ * @param gui
+ * @param srcX
+ * @param srcY
+ * @param width
+ * @param height
+ */
+ public void draw(GuiGuide gui, int srcX, int srcY, int width,
+ int height) {
+ gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y,
+ srcX, srcY, width, height);
+ }
+
+ /**
+ * @param gui
+ * @param mouseX
+ * @param mouseY
+ * @param str
+ */
+ public void drawString(GuiGuide gui, int mouseX, int mouseY,
+ String str) {
+ if (inRect(gui, mouseX, mouseY))
+ gui.drawHoverString(Arrays.asList(str.split("\n")),
+ mouseX - gui.getLeft(), mouseY - gui.getTop());
+ }
+
+ /**
+ * @return
+ */
+ public ItemStack getIcon() {
+ return null;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java
index c31b311..4a71b11 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiRingChest.java
@@ -1,50 +1,49 @@
package darkknight.jewelrycraft.client.gui;
import org.lwjgl.opengl.GL11;
+
import darkknight.jewelrycraft.client.gui.container.ContainerRingChest;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.util.ResourceLocation;
-public class GuiRingChest extends GuiContainer
-{
- public ContainerRingChest container;
- ResourceLocation texture;
-
- /**
- * @param container
- * @param texture
- */
- public GuiRingChest(ContainerRingChest container, ResourceLocation texture)
- {
- super(container);
- this.container = container;
- xSize = 176;
- ySize = 166;
- this.texture = texture;
- }
-
- /**
- * @param f
- * @param mouseX
- * @param mouseY
- */
- @Override
- public void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY)
- {
- GL11.glColor3f(1, 1, 1);
- Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
- drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
- }
-
- /**
- * @param mouseX
- * @param mouseY
- */
- @Override
- public void drawGuiContainerForegroundLayer(int mouseX, int mouseY)
- {
- fontRendererObj.drawString("Linked Chest", 8, 6, 0x404040);
- fontRendererObj.drawString("Inventory", 8, 72, 0x404040);
- }
+public class GuiRingChest extends GuiContainer {
+ public ContainerRingChest container;
+ ResourceLocation texture;
+
+ /**
+ * @param container
+ * @param texture
+ */
+ public GuiRingChest(ContainerRingChest container,
+ ResourceLocation texture) {
+ super(container);
+ this.container = container;
+ xSize = 176;
+ ySize = 166;
+ this.texture = texture;
+ }
+
+ /**
+ * @param f
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerBackgroundLayer(float f, int mouseX,
+ int mouseY) {
+ GL11.glColor3f(1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
+ drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
+ }
+
+ /**
+ * @param mouseX
+ * @param mouseY
+ */
+ @Override
+ public void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
+ fontRendererObj.drawString("Linked Chest", 8, 6, 0x404040);
+ fontRendererObj.drawString("Inventory", 8, 72, 0x404040);
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTab.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTab.java
index 3ef224a..27ad51f 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTab.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTab.java
@@ -5,8 +5,8 @@ import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public abstract class GuiTab extends GuiRectangle {
- protected int values;
- protected int del;
+ protected int values;
+ protected int del;
public GuiTab(int id) {
super(-62, 10 + 19 * id, 19, 18);
@@ -18,15 +18,21 @@ public abstract class GuiTab extends GuiRectangle {
return "";
}
- public abstract void drawBackground(GuiGuide gui, int x, int y, int page);
+ public abstract void drawBackground(GuiGuide gui, int x, int y,
+ int page);
- public abstract void drawForeground(GuiGuide gui, int x, int y, int page);
+ public abstract void drawForeground(GuiGuide gui, int x, int y,
+ int page);
- public void mouseClick(GuiGuide gui, int x, int y, int button) {}
+ public void mouseClick(GuiGuide gui, int x, int y, int button) {
+ }
- public void mouseMoveClick(GuiGuide gui, int x, int y, int button, long timeSinceClicked) {}
+ public void mouseMoveClick(GuiGuide gui, int x, int y, int button,
+ long timeSinceClicked) {
+ }
- public void mouseReleased(GuiGuide gui, int x, int y, int button) {}
+ public void mouseReleased(GuiGuide gui, int x, int y, int button) {
+ }
public int getMaxPages() {
return 1;
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java
index afbcc3e..8a48a1b 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java
@@ -9,133 +9,213 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-public class GuiTabBlocks extends GuiTab
-{
-
- /**
- * @param id
- */
- public GuiTabBlocks(int id)
- {
- super(id);
- }
-
- public String getName()
- {
- return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.blocks");
- }
-
- /**
- * @return
- */
- @Override
- public ItemStack getIcon()
- {
- return new ItemStack(BlockList.smelter);
- }
-
- /**
- * @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 = "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, 180f, 0, -18, true, 42, 100, true);
- break;
- case 2:
- 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 = "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 = "is right click on it with any ore or ingot. It can melt multiple 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 = "The molder is a key piece in creating jewelry. 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 = "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 = "This table allows you to add a gem to a piece of jewelry. Right click the block while holding jewelry 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 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 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 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 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 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 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 14:
- text = "piece of jewelry 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 15:
- if (del == 0) values++;
- del++;
- 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, 180f, 0, -18, true, 48, 120, true);
- break;
- default:
- ;
- }
- }
-
- /**
- * @return
- */
- @Override
- public int getMaxPages()
- {
- return 15;
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param page
- */
- @Override
- public void drawForeground(GuiGuide gui, int x, int y, int page)
- {}
+public class GuiTabBlocks extends GuiTab {
+
+ /**
+ * @param id
+ */
+ public GuiTabBlocks(int id) {
+ super(id);
+ }
+
+ @Override
+ public String getName() {
+ return StatCollector.translateToLocal(
+ "guide." + Variables.MODID + ".tab.blocks");
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon() {
+ return new ItemStack(BlockList.smelter);
+ }
+
+ /**
+ * @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 = "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, 180f, 0, -18, true, 42, 100, true);
+ break;
+ case 2:
+ 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 = "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 = "is right click on it with any ore or ingot. It can melt multiple 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 = "The molder is a key piece in creating jewelry. 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 = "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 = "This table allows you to add a gem to a piece of jewelry. Right click the block while holding jewelry 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 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 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 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 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 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 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 14:
+ text = "piece of jewelry 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 15:
+ if (del == 0)
+ values++;
+ del++;
+ 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,
+ 180f, 0, -18, true, 48, 120, true);
+ break;
+ default:
+ ;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages() {
+ return 15;
+ }
+
+ /**
+ * @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/GuiTabCurses.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java
index 9e544cb..03de3c2 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabCurses.java
@@ -7,14 +7,15 @@ import darkknight.jewelrycraft.util.Variables;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-public class GuiTabCurses extends GuiTab
-{
+public class GuiTabCurses extends GuiTab {
public GuiTabCurses(int id) {
super(id);
}
+ @Override
public String getName() {
- return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.curses");
+ return StatCollector.translateToLocal(
+ "guide." + Variables.MODID + ".tab.curses");
}
@Override
@@ -27,51 +28,107 @@ public class GuiTabCurses extends GuiTab
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. At lest the items you can't. But if you touched an entity with your bear hands while the curse is active and then no longer have it, you should be able to mine it with an iron pick or higher. THe golden statue will drop gold nuggets depending on the size of the entity.";
- 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. Challenges are found in the Achievements menu.";
- 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;
- case 11:
- text = "All the damage you do pierces through armor or any other type of defense, but creatures no longer drop XP.";
- Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.testItem, 1, 10), text, 40f, 0, 0, Curse.getCurseList().get(page-1).getDisplayName(), 45, 10, false);
- break;
- default:;
+ 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. At lest the items you can't. But if you touched an entity with your bear hands while the curse is active and then no longer have it, you should be able to mine it with an iron pick or higher. THe golden statue will drop gold nuggets depending on the size of the entity.";
+ 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. Challenges are found in the Achievements menu.";
+ 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;
+ case 11:
+ text = "All the damage you do pierces through armor or any other type of defense, but creatures no longer drop XP.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop() - 5,
+ new ItemStack(ItemList.testItem, 1, 10), text, 40f,
+ 0, 0, Curse.getCurseList().get(page - 1)
+ .getDisplayName(),
+ 45, 10, false);
+ break;
+ default:
+ ;
}
}
@@ -81,5 +138,6 @@ public class GuiTabCurses extends GuiTab
}
@Override
- public void drawForeground(GuiGuide gui, int x, int y, int page) {}
+ 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 f72766a..086084f 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabGemsAndIngots.java
@@ -1,6 +1,7 @@
package darkknight.jewelrycraft.client.gui;
import org.lwjgl.opengl.GL11;
+
import darkknight.jewelrycraft.util.JewelrycraftUtil;
import darkknight.jewelrycraft.util.Variables;
import net.minecraft.init.Items;
@@ -8,89 +9,129 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
-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)
- {}
+public class GuiTabGemsAndIngots extends GuiTab {
+
+ /**
+ * @param id
+ */
+ public GuiTabGemsAndIngots(int id) {
+ super(id);
+ }
+
+ @Override
+ 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 1aac70e..b7b9a62 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabIntroduction.java
@@ -6,49 +6,48 @@ import darkknight.jewelrycraft.util.Variables;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-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)
- {}
+public class GuiTabIntroduction extends GuiTab {
+ public GuiTabIntroduction(int id) {
+ super(id);
+ }
+
+ @Override
+ public ItemStack getIcon() {
+ return new ItemStack(ItemList.ring);
+ }
+
+ @Override
+ 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 a66798b..a741af3 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java
@@ -2,6 +2,7 @@ package darkknight.jewelrycraft.client.gui;
import java.awt.Desktop;
import java.net.URL;
+
import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.client.Page;
import darkknight.jewelrycraft.item.ItemList;
@@ -14,156 +15,232 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
-public class GuiTabItems extends GuiTab
-{
-
- /**
- * @param id
- */
- public GuiTabItems(int id)
- {
- super(id);
- }
-
- public String getName()
- {
- return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.items");
- }
-
- /**
- * @return
- */
- @Override
- public ItemStack getIcon()
- {
- return new ItemStack(ItemList.thiefGloves);
- }
-
- /**
- * @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 = "Shadow ingots are obtained by smelting shadow ore. They are used in a few recipes and an important key for making some jewelry work.";
- 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 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 = "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:
- text = "In order to get the ingot back from the smelter you need a mold for it. However, this mold can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 0), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball));
- break;
- case 5:
- text = "To create a ring you need a mold for it. However, this one is too soft to be used. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 1), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null);
- break;
- case 6:
- text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 2), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null);
- break;
- case 7:
- text = "To create a bracelet you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 3), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball));
- break;
- case 8:
- text = "To create earrings you need a mold for them. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
- Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 4), null, null, null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, null, null);
- break;
- case 9:
- if (del == 0) values++;
- del++;
- if (del >= 300) del = 0;
- if (values > 4) values = 0;
- text = "By smelting a clay mold you get a harder version which can be used to create jewelry. Simply right click with this on a molder to attach it and you're ready to go.";
- Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true, new ItemStack(ItemList.clayMolds, 1, values), new ItemStack(ItemList.molds, 1, values));
- break;
- case 10:
- if (del == 0) values++;
- 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 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() - 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 >= 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, 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 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 = "who want to test the mod and can't wait for the normal processes to finish (Smelter, Jeweler's 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:
- ;
- }
- }
-
- /**
- * @return
- */
- @Override
- public int getMaxPages()
- {
- return 15;
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param button
- */
- @Override
- public void mouseClick(GuiGuide gui, int x, int y, int button)
- {
- 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){}
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param page
- */
- @Override
- public void drawForeground(GuiGuide gui, int x, int y, int page)
- {}
+public class GuiTabItems extends GuiTab {
+
+ /**
+ * @param id
+ */
+ public GuiTabItems(int id) {
+ super(id);
+ }
+
+ @Override
+ public String getName() {
+ return StatCollector.translateToLocal(
+ "guide." + Variables.MODID + ".tab.items");
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon() {
+ return new ItemStack(ItemList.thiefGloves);
+ }
+
+ /**
+ * @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 = "Shadow ingots are obtained by smelting shadow ore. They are used in a few recipes and an important key for making some jewelry work.";
+ 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 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 = "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:
+ text = "In order to get the ingot back from the smelter you need a mold for it. However, this mold can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), true, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 0),
+ new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball));
+ break;
+ case 5:
+ text = "To create a ring you need a mold for it. However, this one is too soft to be used. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), false, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 1), null,
+ new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null);
+ break;
+ case 6:
+ text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), false, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 2),
+ new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null);
+ break;
+ case 7:
+ text = "To create a bracelet you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), false, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 3),
+ new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball),
+ new ItemStack(Items.clay_ball));
+ break;
+ case 8:
+ text = "To create earrings you need a mold for them. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), false, text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, 4), null,
+ null, null, new ItemStack(Items.clay_ball), null,
+ new ItemStack(Items.clay_ball), null, null, null);
+ break;
+ case 9:
+ if (del == 0)
+ values++;
+ del++;
+ if (del >= 300)
+ del = 0;
+ if (values > 4)
+ values = 0;
+ text = "By smelting a clay mold you get a harder version which can be used to create jewelry. Simply right click with this on a molder to attach it and you're ready to go.";
+ Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos,
+ gui.getTop(), text, x, y, true,
+ new ItemStack(ItemList.clayMolds, 1, values),
+ new ItemStack(ItemList.molds, 1, values));
+ break;
+ case 10:
+ if (del == 0)
+ values++;
+ 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 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() - 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 >= 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, 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 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 = "who want to test the mod and can't wait for the normal processes to finish (Smelter, Jeweler's 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:
+ ;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages() {
+ return 15;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ */
+ @Override
+ public void mouseClick(GuiGuide gui, int x, int y, int button) {
+ 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) {
+ }
+ }
+
+ /**
+ * @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/GuiTabModifiers.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java
index 4f155c5..91f5873 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabModifiers.java
@@ -7,84 +7,92 @@ import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-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)
- {}
+public class GuiTabModifiers extends GuiTab {
+ int maxPages;
+
+ public GuiTabModifiers(int id) {
+ super(id);
+ }
+
+ @Override
+ 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) {
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java
index a0b0e4b..71ad370 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabOresToIngots.java
@@ -1,78 +1,88 @@
package darkknight.jewelrycraft.client.gui;
import org.lwjgl.opengl.GL11;
+
import darkknight.jewelrycraft.block.BlockList;
import darkknight.jewelrycraft.util.JewelrycraftUtil;
import darkknight.jewelrycraft.util.Variables;
import net.minecraft.item.ItemStack;
import net.minecraft.util.StatCollector;
-public class GuiTabOresToIngots extends GuiTab
-{
- /**
- * @param id
- */
- public GuiTabOresToIngots(int id)
- {
- super(id);
- }
-
- public String getName()
- {
- return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.oretoingot");
- }
-
- /**
- * @return
- */
- @Override
- public ItemStack getIcon()
- {
- return new ItemStack(BlockList.shadowOre);
- }
-
- /**
- * @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);
- int i = 0;
- for(ItemStack ore: JewelrycraftUtil.oreToIngot.keySet()){
- if (i >= (page - 1) * 5 && i < page * 5){
- gui.renderItem(ore, gui.getLeft() + xPos + 10, gui.getTop() + 12 + 32 * (i - 5 * (page - 1)), 30f, true, 0, 0, 0);
- gui.renderItem(JewelrycraftUtil.oreToIngot.get(ore), gui.getLeft() + xPos + 10, gui.getTop() + 28 + 32 * (i - 5 * (page - 1)), 30f, true, 0, 0, 0);
- gui.getFont().drawString(String.format("%-1.18s", ore.getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 2 + 32 * (i - 5 * (page - 1)), 0);
- gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.oreToIngot.get(ore).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 18 + 32 * (i - 5 * (page - 1)), 0);
- GL11.glDisable(GL11.GL_LIGHTING);
- }
- i++;
- }
- GL11.glDisable(GL11.GL_BLEND);
- }
-
- /**
- * @return
- */
- @Override
- public int getMaxPages()
- {
- return JewelrycraftUtil.oreToIngot.size() / 5 + 2;
- }
-
- /**
- * @param gui
- * @param x
- * @param y
- * @param page
- */
- @Override
- public void drawForeground(GuiGuide gui, int x, int y, int page)
- {}
+public class GuiTabOresToIngots extends GuiTab {
+ /**
+ * @param id
+ */
+ public GuiTabOresToIngots(int id) {
+ super(id);
+ }
+
+ @Override
+ public String getName() {
+ return StatCollector.translateToLocal(
+ "guide." + Variables.MODID + ".tab.oretoingot");
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon() {
+ return new ItemStack(BlockList.shadowOre);
+ }
+
+ /**
+ * @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);
+ int i = 0;
+ for (ItemStack ore : JewelrycraftUtil.oreToIngot.keySet()) {
+ if (i >= (page - 1) * 5 && i < page * 5) {
+ gui.renderItem(ore, gui.getLeft() + xPos + 10,
+ gui.getTop() + 12 + 32 * (i - 5 * (page - 1)), 30f,
+ true, 0, 0, 0);
+ gui.renderItem(JewelrycraftUtil.oreToIngot.get(ore),
+ gui.getLeft() + xPos + 10,
+ gui.getTop() + 28 + 32 * (i - 5 * (page - 1)), 30f,
+ true, 0, 0, 0);
+ gui.getFont().drawString(
+ String.format("%-1.18s", ore.getDisplayName()),
+ gui.getLeft() + xPos + 20,
+ gui.getTop() + 2 + 32 * (i - 5 * (page - 1)), 0);
+ gui.getFont().drawString(
+ String.format("%-1.18s",
+ JewelrycraftUtil.oreToIngot.get(ore)
+ .getDisplayName()),
+ gui.getLeft() + xPos + 20,
+ gui.getTop() + 18 + 32 * (i - 5 * (page - 1)), 0);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ i++;
+ }
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages() {
+ return JewelrycraftUtil.oreToIngot.size() / 5 + 2;
+ }
+
+ /**
+ * @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/GuiTabRitual.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java
index 30f220c..dd4df87 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabRitual.java
@@ -8,124 +8,231 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
-public class GuiTabRitual extends GuiTab
-{
- public GuiTabRitual(int id)
- {
- super(id);
- }
-
- public String getName()
- {
- return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.ritual");
- }
-
- @Override
- public ItemStack getIcon()
- {
- return new ItemStack(BlockList.handPedestal);
- }
-
- @Override
- public void drawBackground(GuiGuide gui, int x, int y, int page)
- {
- int xPos = page % 2 == 0 ? 107 : -35;
- switch(page)
- {
- case 1:
- Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 1", gui.getLeft() + xPos + 35, gui.getTop() - 30);
- for(int i = -1; i < 10; i++)
- for(int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
-
- //Top
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*0, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.handPedestal), 0, -45, 0);
-
- //Left
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, 45, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*-1, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 90, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0);
-
- //Bottom
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 135, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*10, x, y, new ItemStack(BlockList.handPedestal), 0, 180, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0);
-
- //Right
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*3, x, y, new ItemStack(BlockList.handPedestal), 0, -35, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*9, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 270, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*7, x, y, new ItemStack(BlockList.handPedestal), 0, 225, 0);
-
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.handPedestal), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- break;
-
- case 2:
- Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 2", gui.getLeft() + xPos + 35, gui.getTop() - 30);
- for(int i = -1; i < 10; i++)
- for(int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
-
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- break;
-
- case 3:
- Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 3", gui.getLeft() + xPos + 35, gui.getTop() - 30);
- for(int i = -1; i < 10; i++)
- for(int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*1, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*8, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*0, gui.getTop() + 11*9, x, y, new ItemStack(BlockList.shadowBlock), 0, 0, 0);
-
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stonebrick), 0, 0, 0);
- break;
-
- case 4:
- Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 4", gui.getLeft() + xPos + 35, gui.getTop() - 30);
- for(int i = -1; i < 10; i++)
- for(int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*2, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 180);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(BlockList.shadowEye), 0, 90, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, 90, 180);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*6, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_brick_stairs), 0, -90, 0);
- break;
-
- case 5:
- Page.drawText(gui, EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Layer 5", gui.getLeft() + xPos + 35, gui.getTop() - 30);
- for(int i = -1; i < 10; i++)
- for(int j = 0; j < 11; j++)
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*i, gui.getTop() + 11*j, x, y, new ItemStack(Blocks.air), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*3, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*4, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
- Page.addSlotItem(gui, gui.getLeft() + xPos + 11*5, gui.getTop() + 11*5, x, y, new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
- break;
- }
- }
-
- @Override
- public int getMaxPages()
- {
- return 5;
- }
-
- @Override
- public void drawForeground(GuiGuide gui, int x, int y, int page)
- {}
+public class GuiTabRitual extends GuiTab {
+ public GuiTabRitual(int id) {
+ super(id);
+ }
+
+ @Override
+ public String getName() {
+ return StatCollector.translateToLocal(
+ "guide." + Variables.MODID + ".tab.ritual");
+ }
+
+ @Override
+ public ItemStack getIcon() {
+ return new ItemStack(BlockList.handPedestal);
+ }
+
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page) {
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch (page) {
+ case 1:
+ Page.drawText(gui,
+ EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ + "Layer 1",
+ gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos + 11 * i,
+ gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
+ gui.getTop() + 11 * 1, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
+ gui.getTop() + 11 * 1, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
+ gui.getTop() + 11 * 9, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
+ gui.getTop() + 11 * 9, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+
+ // Top
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
+ gui.getTop() + 11 * 1, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 45, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
+ gui.getTop() + 11 * 0, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
+ gui.getTop() + 11 * 1, x, y,
+ new ItemStack(BlockList.handPedestal), 0, -45, 0);
+
+ // Left
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
+ gui.getTop() + 11 * 3, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 45, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * -1,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 90, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
+ gui.getTop() + 11 * 7, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 135, 0);
+
+ // Bottom
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
+ gui.getTop() + 11 * 9, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 135, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
+ gui.getTop() + 11 * 10, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 180, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
+ gui.getTop() + 11 * 9, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 225, 0);
+
+ // Right
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
+ gui.getTop() + 11 * 3, x, y,
+ new ItemStack(BlockList.handPedestal), 0, -35, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 9,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 270, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
+ gui.getTop() + 11 * 7, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 225, 0);
+
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(BlockList.handPedestal), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ break;
+
+ case 2:
+ Page.drawText(gui,
+ EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ + "Layer 2",
+ gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos + 11 * i,
+ gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
+ gui.getTop() + 11 * 1, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
+ gui.getTop() + 11 * 1, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
+ gui.getTop() + 11 * 9, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
+ gui.getTop() + 11 * 9, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ break;
+
+ case 3:
+ Page.drawText(gui,
+ EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ + "Layer 3",
+ gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos + 11 * i,
+ gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
+ gui.getTop() + 11 * 1, x, y,
+ new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
+ gui.getTop() + 11 * 1, x, y,
+ new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 8,
+ gui.getTop() + 11 * 9, x, y,
+ new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 0,
+ gui.getTop() + 11 * 9, x, y,
+ new ItemStack(BlockList.shadowBlock), 0, 0, 0);
+
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stonebrick), 0, 0, 0);
+ break;
+
+ case 4:
+ Page.drawText(gui,
+ EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ + "Layer 4",
+ gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos + 11 * i,
+ gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 2,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_brick_stairs), 0, 90,
+ 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 3,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_brick_stairs), 0, -90,
+ 180);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(BlockList.shadowEye), 0, 90, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 5,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_brick_stairs), 0, 90,
+ 180);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 6,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_brick_stairs), 0, -90,
+ 0);
+ break;
+
+ case 5:
+ Page.drawText(gui,
+ EnumChatFormatting.DARK_BLUE + "\u00a7n"
+ + "Layer 5",
+ gui.getLeft() + xPos + 35, gui.getTop() - 30);
+ for (int i = -1; i < 10; i++)
+ for (int j = 0; j < 11; j++)
+ Page.addSlotItem(gui,
+ gui.getLeft() + xPos + 11 * i,
+ gui.getTop() + 11 * j, x, y,
+ new ItemStack(Blocks.air), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 3,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 4,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ Page.addSlotItem(gui, gui.getLeft() + xPos + 11 * 5,
+ gui.getTop() + 11 * 5, x, y,
+ new ItemStack(Blocks.stone_slab, 1, 5), 0, 0, 0);
+ break;
+ }
+ }
+
+ @Override
+ public int getMaxPages() {
+ return 5;
+ }
+
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page) {
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerCurseInfo.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerCurseInfo.java
index 24588bd..5b92385 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerCurseInfo.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerCurseInfo.java
@@ -4,20 +4,17 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
-public class ContainerCurseInfo extends Container
-{
- public ContainerCurseInfo()
- {}
-
- @Override
- public void addCraftingToCrafters(ICrafting c)
- {
- return;
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer entityplayer)
- {
- return true;
- }
+public class ContainerCurseInfo extends Container {
+ public ContainerCurseInfo() {
+ }
+
+ @Override
+ public void addCraftingToCrafters(ICrafting c) {
+ return;
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer entityplayer) {
+ return true;
+ }
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerGuide.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerGuide.java
index ccb9ca9..fc6c5bf 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerGuide.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerGuide.java
@@ -6,22 +6,20 @@ import net.minecraft.inventory.Container;
/**
* User: joel / Date: 16.12.13 / Time: 22:36
*/
-public class ContainerGuide extends Container
-{
-
- /**
- *
- */
- public ContainerGuide()
- {}
-
- /**
- * @param entityplayer
- * @return
- */
- @Override
- public boolean canInteractWith(EntityPlayer entityplayer)
- {
- return true;
- }
+public class ContainerGuide extends Container {
+
+ /**
+ *
+ */
+ public ContainerGuide() {
+ }
+
+ /**
+ * @param entityplayer
+ * @return
+ */
+ @Override
+ public boolean canInteractWith(EntityPlayer entityplayer) {
+ return true;
+ }
} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java
index e749506..652d628 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryModifier.java
@@ -7,41 +7,45 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class ContainerJewelryModifier extends Container
-{
- public IInventory modInv;
- public ContainerJewelryModifier(InventoryPlayer inv, IInventory mod)
- {
- int x, y;
- modInv = mod;
- for(x = 0; x < 9; x++)
- addSlotToContainer(new Slot(inv, x, 26 + 18 * x, 225));
- for(y = 0; y < 3; y++)
- for(x = 0; x < 9; x++)
- addSlotToContainer(new Slot(inv, x + 9 + y * 9, 26 + 18 * x, 167 + y * 18));
- addSlotToContainer(new Slot(mod, 36, 37, 9));
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer player)
- {
- return true;
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
- {
- ItemStack itemstack = null;
- Slot slot = (Slot)inventorySlots.get(par2);
- if (slot != null && slot.getHasStack()){
- ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
- if (par2 < 27){
- if (!mergeItemStack(itemstack1, 27, inventorySlots.size(), true)) return null;
- }else if (!mergeItemStack(itemstack1, 0, 27, false)) return null;
- if (itemstack1.stackSize == 0) slot.putStack((ItemStack)null);
- else slot.onSlotChanged();
- }
- return itemstack;
- }
+public class ContainerJewelryModifier extends Container {
+ public IInventory modInv;
+
+ public ContainerJewelryModifier(InventoryPlayer inv, IInventory mod) {
+ int x, y;
+ modInv = mod;
+ for (x = 0; x < 9; x++)
+ addSlotToContainer(new Slot(inv, x, 26 + 18 * x, 225));
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 9; x++)
+ addSlotToContainer(new Slot(inv, x + 9 + y * 9,
+ 26 + 18 * x, 167 + y * 18));
+ addSlotToContainer(new Slot(mod, 36, 37, 9));
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return true;
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer,
+ int par2) {
+ ItemStack itemstack = null;
+ Slot slot = (Slot) inventorySlots.get(par2);
+ if (slot != null && slot.getHasStack()) {
+ ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+ if (par2 < 27) {
+ if (!mergeItemStack(itemstack1, 27, inventorySlots.size(),
+ true))
+ return null;
+ } else if (!mergeItemStack(itemstack1, 0, 27, false))
+ return null;
+ if (itemstack1.stackSize == 0)
+ slot.putStack((ItemStack) null);
+ else
+ slot.onSlotChanged();
+ }
+ return itemstack;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java
index dd12540..3061bfd 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerJewelryTab.java
@@ -17,98 +17,139 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class ContainerJewelryTab extends Container
-{
- public ContainerJewelryTab(EntityPlayer player, IInventory inv, IInventory extra)
- {
- int x, y;
- // Rings
- for(x = 0; x <= 9; x++)
- addSlotToContainer(new SlotRing(extra, x, 8 + x * 18, 7));
- // Bracelets
- for(x = 10; x <= 13; x++)
- addSlotToContainer(new SlotBracelet(extra, x, 8 + (x - 10) * 18, 26));
- // Necklaces
- for(x = 14; x <= 16; x++)
- addSlotToContainer(new SlotNecklace(extra, x, 8 + (x - 14) * 18, 45));
- // Earrings
- addSlotToContainer(new SlotEarrings(extra, 17, 8, 64));
- // Hotbar
- for(x = 0; x < 9; ++x)
- addSlotToContainer(new Slot(inv, x, 17 + x * 18, 142));
- // Inventory
- for(x = 0; x < 3; ++x)
- for(y = 0; y < 9; ++y)
- addSlotToContainer(new Slot(inv, 9 + y + x * 9, 17 + y * 18, 84 + x * 18));
- }
-
- @Override
- public boolean canInteractWith(EntityPlayer player)
- {
- return true;
- }
-
- public ItemStack slotClick(int slotID, int j, int k, EntityPlayer player)
- {
- if (slotID >= 0 && slotID <= 17 && !player.worldObj.isRemote) {
- try{
- if (player.inventory.getItemStack() == null && inventoryItemStacks.get(slotID) != null && ((ItemStack)inventoryItemStacks.get(slotID)).getItem() instanceof ItemBaseJewelry)
- ((ItemBaseJewelry)((ItemStack)inventoryItemStacks.get(slotID)).getItem()).onJewelryUnequipped((ItemStack)inventoryItemStacks.get(slotID));
- else if (player.inventory.getItemStack() != null && player.inventory.getItemStack().getItem() instanceof ItemBaseJewelry && inventoryItemStacks.get(slotID) == null)
- ((ItemBaseJewelry)player.inventory.getItemStack().getItem()).onJewelryEquipped(player.inventory.getItemStack());
- if (player.inventory.getItemStack() == null && inventoryItemStacks.get(slotID) != null && ((ItemStack)inventoryItemStacks.get(slotID)).getItem() instanceof IJewelryItem)
- ((IJewelryItem)((ItemStack)inventoryItemStacks.get(slotID)).getItem()).onJewelryUnequipped((ItemStack)inventoryItemStacks.get(slotID));
- else if (player.inventory.getItemStack() != null && player.inventory.getItemStack().getItem() instanceof IJewelryItem && inventoryItemStacks.get(slotID) == null)
- ((IJewelryItem)player.inventory.getItemStack().getItem()).onJewelryEquipped(player.inventory.getItemStack());
- }
- catch(Exception e){
- JewelrycraftMod.logger.error("An error has occured while equipping an item.");
- e.printStackTrace();
- }
- }
- return super.slotClick(slotID, j, k, player);
- }
-
- @Override
- public ItemStack transferStackInSlot(EntityPlayer player, int slotID)
- {
- ItemStack itemstack = null;
- Slot slot = (Slot)inventorySlots.get(slotID);
- if (slot != null && slot.getHasStack()) {
- ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
- if (slotID >= 18) {
- if (itemstack.getItem() instanceof ItemRing || (itemstack.getItem() instanceof IJewelryItem && ((IJewelryItem)itemstack.getItem()).type() == 0)) {
- if (!mergeItemStack(itemstack, 0, 10, false) && !slot.getHasStack())
- return null;
- }else if (itemstack.getItem() instanceof ItemBracelet || (itemstack.getItem() instanceof IJewelryItem && ((IJewelryItem)itemstack.getItem()).type() == 1)) {
- if (!mergeItemStack(itemstack, 10, 14, false) && !slot.getHasStack())
- return null;
- }else if (itemstack.getItem() instanceof ItemNecklace || (itemstack.getItem() instanceof IJewelryItem && ((IJewelryItem)itemstack.getItem()).type() == 2)) {
- if (!mergeItemStack(itemstack, 14, 17, false) && !slot.getHasStack())
- return null;
- }else if (itemstack.getItem() instanceof ItemEarrings || (itemstack.getItem() instanceof IJewelryItem && ((IJewelryItem)itemstack.getItem()).type() == 3)) {
- if (!mergeItemStack(itemstack, 17, 18, false) && !slot.getHasStack())
- return null;
- }else{
- if (slotID < 27) {
- if (!mergeItemStack(itemstack, 27, 36 + 18, false))
- return null;
- }else{
- if (!mergeItemStack(itemstack, 18, 27, false))
- return null;
- }
- }
- }else
- if (!mergeItemStack(itemstack, 18, inventorySlots.size(), false))
- return null;
- if (itemstack.stackSize == 0)
- slot.putStack(null);
- else slot.onSlotChanged();
- if (itemstack.stackSize != itemstack.stackSize)
- slot.onPickupFromSlot(player, itemstack);
- else return null;
- }
- return itemstack;
- }
+public class ContainerJewelryTab extends Container {
+ public ContainerJewelryTab(EntityPlayer player, IInventory inv,
+ IInventory extra) {
+ int x, y;
+ // Rings
+ for (x = 0; x <= 9; x++)
+ addSlotToContainer(new SlotRing(extra, x, 8 + x * 18, 7));
+ // Bracelets
+ for (x = 10; x <= 13; x++)
+ addSlotToContainer(
+ new SlotBracelet(extra, x, 8 + (x - 10) * 18, 26));
+ // Necklaces
+ for (x = 14; x <= 16; x++)
+ addSlotToContainer(
+ new SlotNecklace(extra, x, 8 + (x - 14) * 18, 45));
+ // Earrings
+ addSlotToContainer(new SlotEarrings(extra, 17, 8, 64));
+ // Hotbar
+ for (x = 0; x < 9; ++x)
+ addSlotToContainer(new Slot(inv, x, 17 + x * 18, 142));
+ // Inventory
+ for (x = 0; x < 3; ++x)
+ for (y = 0; y < 9; ++y)
+ addSlotToContainer(new Slot(inv, 9 + y + x * 9,
+ 17 + y * 18, 84 + x * 18));
+ }
+
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return true;
+ }
+
+ @Override
+ public ItemStack slotClick(int slotID, int j, int k,
+ EntityPlayer player) {
+ if (slotID >= 0 && slotID <= 17 && !player.worldObj.isRemote) {
+ try {
+ if (player.inventory.getItemStack() == null
+ && inventoryItemStacks.get(slotID) != null
+ && ((ItemStack) inventoryItemStacks.get(slotID))
+ .getItem() instanceof ItemBaseJewelry)
+ ((ItemBaseJewelry) ((ItemStack) inventoryItemStacks
+ .get(slotID)).getItem()).onJewelryUnequipped(
+ (ItemStack) inventoryItemStacks
+ .get(slotID));
+ else if (player.inventory.getItemStack() != null
+ && player.inventory.getItemStack()
+ .getItem() instanceof ItemBaseJewelry
+ && inventoryItemStacks.get(slotID) == null)
+ ((ItemBaseJewelry) player.inventory.getItemStack()
+ .getItem()).onJewelryEquipped(
+ player.inventory.getItemStack());
+ if (player.inventory.getItemStack() == null
+ && inventoryItemStacks.get(slotID) != null
+ && ((ItemStack) inventoryItemStacks.get(slotID))
+ .getItem() instanceof IJewelryItem)
+ ((IJewelryItem) ((ItemStack) inventoryItemStacks
+ .get(slotID)).getItem()).onJewelryUnequipped(
+ (ItemStack) inventoryItemStacks
+ .get(slotID));
+ else if (player.inventory.getItemStack() != null
+ && player.inventory.getItemStack()
+ .getItem() instanceof IJewelryItem
+ && inventoryItemStacks.get(slotID) == null)
+ ((IJewelryItem) player.inventory.getItemStack()
+ .getItem()).onJewelryEquipped(
+ player.inventory.getItemStack());
+ } catch (Exception e) {
+ JewelrycraftMod.logger.error(
+ "An error has occured while equipping an item.");
+ e.printStackTrace();
+ }
+ }
+ return super.slotClick(slotID, j, k, player);
+ }
+
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer player, int slotID) {
+ ItemStack itemstack = null;
+ Slot slot = (Slot) inventorySlots.get(slotID);
+ if (slot != null && slot.getHasStack()) {
+ ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+ if (slotID >= 18) {
+ if (itemstack.getItem() instanceof ItemRing
+ || (itemstack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) itemstack.getItem())
+ .type() == 0)) {
+ if (!mergeItemStack(itemstack, 0, 10, false)
+ && !slot.getHasStack())
+ return null;
+ } else if (itemstack.getItem() instanceof ItemBracelet
+ || (itemstack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) itemstack.getItem())
+ .type() == 1)) {
+ if (!mergeItemStack(itemstack, 10, 14, false)
+ && !slot.getHasStack())
+ return null;
+ } else if (itemstack.getItem() instanceof ItemNecklace
+ || (itemstack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) itemstack.getItem())
+ .type() == 2)) {
+ if (!mergeItemStack(itemstack, 14, 17, false)
+ && !slot.getHasStack())
+ return null;
+ } else if (itemstack.getItem() instanceof ItemEarrings
+ || (itemstack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) itemstack.getItem())
+ .type() == 3)) {
+ if (!mergeItemStack(itemstack, 17, 18, false)
+ && !slot.getHasStack())
+ return null;
+ } else {
+ if (slotID < 27) {
+ if (!mergeItemStack(itemstack, 27, 36 + 18, false))
+ return null;
+ } else {
+ if (!mergeItemStack(itemstack, 18, 27, false))
+ return null;
+ }
+ }
+ } else if (!mergeItemStack(itemstack, 18,
+ inventorySlots.size(), false))
+ return null;
+ if (itemstack.stackSize == 0)
+ slot.putStack(null);
+ else
+ slot.onSlotChanged();
+ if (itemstack.stackSize != itemstack.stackSize)
+ slot.onPickupFromSlot(player, itemstack);
+ else
+ return null;
+ }
+ return itemstack;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java
index 3d7beb6..e848b38 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/ContainerRingChest.java
@@ -8,57 +8,63 @@ import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntityChest;
-public class ContainerRingChest extends Container
-{
- public TileEntityChest theChest;
-
- /**
- * @param inv
- * @param chest
- */
- public ContainerRingChest(InventoryPlayer inv, TileEntityChest chest)
- {
- theChest = chest;
- int x, y;
- for(x = 0; x < 9; x++)
- addSlotToContainer(new SlotRingChest(inv, x, 8 + 18 * x, 142, x == inv.currentItem));
- for(y = 0; y < 3; y++)
- for(x = 0; x < 9; x++)
- addSlotToContainer(new Slot(inv, x + 9 + y * 9, 8 + 18 * x, 84 + y * 18));
- for(y = 0; y < 3; y++)
- for(x = 0; x < 9; x++)
- addSlotToContainer(new SlotRingChest(chest, 26 - (x + y * 9), 8 + 18 * (8 - x), 17 + (2 - y) * 18, false));
- }
-
- /**
- * @param player
- * @return
- */
- @Override
- public boolean canInteractWith(EntityPlayer player)
- {
- return true;
- }
-
- /**
- * @param par1EntityPlayer
- * @param par2
- * @return
- */
- @Override
- public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
- {
- ItemStack itemstack = null;
- Slot slot = (Slot)inventorySlots.get(par2);
- if (slot != null && slot.getHasStack()){
- ItemStack itemstack1 = slot.getStack();
- itemstack = itemstack1.copy();
- if (par2 < 27){
- if (!mergeItemStack(itemstack1, 27, inventorySlots.size(), true)) return null;
- }else if (!mergeItemStack(itemstack1, 0, 27, false)) return null;
- if (itemstack1.stackSize == 0) slot.putStack((ItemStack)null);
- else slot.onSlotChanged();
- }
- return itemstack;
- }
+public class ContainerRingChest extends Container {
+ public TileEntityChest theChest;
+
+ /**
+ * @param inv
+ * @param chest
+ */
+ public ContainerRingChest(InventoryPlayer inv, TileEntityChest chest) {
+ theChest = chest;
+ int x, y;
+ for (x = 0; x < 9; x++)
+ addSlotToContainer(new SlotRingChest(inv, x, 8 + 18 * x, 142,
+ x == inv.currentItem));
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 9; x++)
+ addSlotToContainer(new Slot(inv, x + 9 + y * 9, 8 + 18 * x,
+ 84 + y * 18));
+ for (y = 0; y < 3; y++)
+ for (x = 0; x < 9; x++)
+ addSlotToContainer(new SlotRingChest(chest,
+ 26 - (x + y * 9), 8 + 18 * (8 - x),
+ 17 + (2 - y) * 18, false));
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canInteractWith(EntityPlayer player) {
+ return true;
+ }
+
+ /**
+ * @param par1EntityPlayer
+ * @param par2
+ * @return
+ */
+ @Override
+ public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer,
+ int par2) {
+ ItemStack itemstack = null;
+ Slot slot = (Slot) inventorySlots.get(par2);
+ if (slot != null && slot.getHasStack()) {
+ ItemStack itemstack1 = slot.getStack();
+ itemstack = itemstack1.copy();
+ if (par2 < 27) {
+ if (!mergeItemStack(itemstack1, 27, inventorySlots.size(),
+ true))
+ return null;
+ } else if (!mergeItemStack(itemstack1, 0, 27, false))
+ return null;
+ if (itemstack1.stackSize == 0)
+ slot.putStack((ItemStack) null);
+ else
+ slot.onSlotChanged();
+ }
+ return itemstack;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java
index cfd2e20..2f3a9cc 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotBracelet.java
@@ -7,47 +7,44 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotBracelet extends Slot
-{
-
- /**
- * @param tile
- * @param slotID
- * @param x
- * @param y
- */
- public SlotBracelet(IInventory tile, int slotID, int x, int y)
- {
- super(tile, slotID, x, y);
- }
-
- /**
- * @param stack
- * @return
- */
- @Override
- public boolean isItemValid(ItemStack stack)
- {
- return stack.getItem() instanceof ItemBracelet || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 1);
- }
-
- /**
- * @param amount
- * @return
- */
- @Override
- public ItemStack decrStackSize(int amount)
- {
- return super.decrStackSize(amount);
- }
-
- /**
- * @param player
- * @return
- */
- @Override
- public boolean canTakeStack(EntityPlayer player)
- {
- return true;
- }
+public class SlotBracelet extends Slot {
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotBracelet(IInventory tile, int slotID, int x, int y) {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack) {
+ return stack.getItem() instanceof ItemBracelet
+ || (stack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) stack.getItem()).type() == 1);
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount) {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player) {
+ return true;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java
index e0603a3..c563f4d 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotEarrings.java
@@ -7,47 +7,44 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotEarrings extends Slot
-{
-
- /**
- * @param tile
- * @param slotID
- * @param x
- * @param y
- */
- public SlotEarrings(IInventory tile, int slotID, int x, int y)
- {
- super(tile, slotID, x, y);
- }
-
- /**
- * @param stack
- * @return
- */
- @Override
- public boolean isItemValid(ItemStack stack)
- {
- return stack.getItem() instanceof ItemEarrings || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 3);
- }
-
- /**
- * @param amount
- * @return
- */
- @Override
- public ItemStack decrStackSize(int amount)
- {
- return super.decrStackSize(amount);
- }
-
- /**
- * @param player
- * @return
- */
- @Override
- public boolean canTakeStack(EntityPlayer player)
- {
- return true;
- }
+public class SlotEarrings extends Slot {
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotEarrings(IInventory tile, int slotID, int x, int y) {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack) {
+ return stack.getItem() instanceof ItemEarrings
+ || (stack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) stack.getItem()).type() == 3);
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount) {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player) {
+ return true;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java
index 4b810be..ab2d04e 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotNecklace.java
@@ -7,47 +7,44 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotNecklace extends Slot
-{
-
- /**
- * @param tile
- * @param slotID
- * @param x
- * @param y
- */
- public SlotNecklace(IInventory tile, int slotID, int x, int y)
- {
- super(tile, slotID, x, y);
- }
-
- /**
- * @param stack
- * @return
- */
- @Override
- public boolean isItemValid(ItemStack stack)
- {
- return stack.getItem() instanceof ItemNecklace || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 2);
- }
-
- /**
- * @param amount
- * @return
- */
- @Override
- public ItemStack decrStackSize(int amount)
- {
- return super.decrStackSize(amount);
- }
-
- /**
- * @param player
- * @return
- */
- @Override
- public boolean canTakeStack(EntityPlayer player)
- {
- return true;
- }
+public class SlotNecklace extends Slot {
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotNecklace(IInventory tile, int slotID, int x, int y) {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack) {
+ return stack.getItem() instanceof ItemNecklace
+ || (stack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) stack.getItem()).type() == 2);
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount) {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player) {
+ return true;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java
index 4fb9265..6c16509 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRing.java
@@ -7,47 +7,44 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotRing extends Slot
-{
-
- /**
- * @param tile
- * @param slotID
- * @param x
- * @param y
- */
- public SlotRing(IInventory tile, int slotID, int x, int y)
- {
- super(tile, slotID, x, y);
- }
-
- /**
- * @param stack
- * @return
- */
- @Override
- public boolean isItemValid(ItemStack stack)
- {
- return stack.getItem() instanceof ItemRing || (stack.getItem() instanceof IJewelryItem && ((IJewelryItem)stack.getItem()).type() == 0);
- }
-
- /**
- * @param amount
- * @return
- */
- @Override
- public ItemStack decrStackSize(int amount)
- {
- return super.decrStackSize(amount);
- }
-
- /**
- * @param player
- * @return
- */
- @Override
- public boolean canTakeStack(EntityPlayer player)
- {
- return true;
- }
+public class SlotRing extends Slot {
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ */
+ public SlotRing(IInventory tile, int slotID, int x, int y) {
+ super(tile, slotID, x, y);
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack) {
+ return stack.getItem() instanceof ItemRing
+ || (stack.getItem() instanceof IJewelryItem
+ && ((IJewelryItem) stack.getItem()).type() == 0);
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount) {
+ return super.decrStackSize(amount);
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player) {
+ return true;
+ }
}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRingChest.java b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRingChest.java
index 8cc5431..72c149d 100644..100755
--- a/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRingChest.java
+++ b/src/main/java/darkknight/jewelrycraft/client/gui/container/slots/SlotRingChest.java
@@ -5,51 +5,48 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
-public class SlotRingChest extends Slot
-{
- public boolean locked = false;
-
- /**
- * @param tile
- * @param slotID
- * @param x
- * @param y
- * @param locked
- */
- public SlotRingChest(IInventory tile, int slotID, int x, int y, boolean locked)
- {
- super(tile, slotID, x, y);
- this.locked = locked;
- }
-
- /**
- * @param stack
- * @return
- */
- @Override
- public boolean isItemValid(ItemStack stack)
- {
- return !locked;
- }
-
- /**
- * @param amount
- * @return
- */
- @Override
- public ItemStack decrStackSize(int amount)
- {
- if (!locked) return super.decrStackSize(amount);
- return null;
- }
-
- /**
- * @param player
- * @return
- */
- @Override
- public boolean canTakeStack(EntityPlayer player)
- {
- return !locked;
- }
+public class SlotRingChest extends Slot {
+ public boolean locked = false;
+
+ /**
+ * @param tile
+ * @param slotID
+ * @param x
+ * @param y
+ * @param locked
+ */
+ public SlotRingChest(IInventory tile, int slotID, int x, int y,
+ boolean locked) {
+ super(tile, slotID, x, y);
+ this.locked = locked;
+ }
+
+ /**
+ * @param stack
+ * @return
+ */
+ @Override
+ public boolean isItemValid(ItemStack stack) {
+ return !locked;
+ }
+
+ /**
+ * @param amount
+ * @return
+ */
+ @Override
+ public ItemStack decrStackSize(int amount) {
+ if (!locked)
+ return super.decrStackSize(amount);
+ return null;
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canTakeStack(EntityPlayer player) {
+ return !locked;
+ }
}