summaryrefslogtreecommitdiff
path: root/src/main/java/darkknight/jewelrycraft/container
diff options
context:
space:
mode:
authorOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-03-23 14:51:06 +0000
committerOnyxDarkKnight <sor1n.iliutza16@gmail.com>2015-03-23 14:51:06 +0000
commit6312636fd9a4d0f56dc7c9ff474a99d879bcb4e9 (patch)
treee3279753210bfb169a00cd3f146a80baf624150e /src/main/java/darkknight/jewelrycraft/container
parente86949a1ad3269ec66c9de65e2c92f5e66251411 (diff)
Reworked the whole repo.
Diffstat (limited to 'src/main/java/darkknight/jewelrycraft/container')
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java27
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java87
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java63
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiHandler.java78
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java97
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTab.java84
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java176
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java78
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabIntroduction.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java166
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabModifiers.java74
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/GuiTabRitual.java125
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/JewelryInventory.java165
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/Page.java197
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotBracelet.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotEarrings.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotNecklace.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotRing.java52
-rw-r--r--src/main/java/darkknight/jewelrycraft/container/SlotRingChest.java55
19 files changed, 1732 insertions, 0 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java b/src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java
new file mode 100644
index 0000000..b6513a3
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java
@@ -0,0 +1,27 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+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;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java b/src/main/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java
new file mode 100644
index 0000000..701b338
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/ContainerJewelryTab.java
@@ -0,0 +1,87 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.Container;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemBracelet;
+import darkknight.jewelrycraft.item.ItemEarrings;
+import darkknight.jewelrycraft.item.ItemNecklace;
+import darkknight.jewelrycraft.item.ItemRing;
+
+public class ContainerJewelryTab extends Container
+{
+
+ /**
+ * @param player
+ * @param inv
+ * @param extra
+ */
+ 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));
+ }
+
+ /**
+ * @param player
+ * @return
+ */
+ @Override
+ public boolean canInteractWith(EntityPlayer player)
+ {
+ return true;
+ }
+
+ /**
+ * @param player
+ * @param slotID
+ * @return
+ */
+ @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 (!mergeItemStack(itemstack1, 18, 18 + 36, true)) return null;
+ slot.onSlotChange(itemstack1, itemstack);
+ }else if (itemstack1.getItem() instanceof ItemRing){
+ if (!mergeItemStack(itemstack1, 0, 10, false)) return null;
+ }else if (itemstack1.getItem() instanceof ItemBracelet){
+ if (!mergeItemStack(itemstack1, 10, 14, false)) return null;
+ }else if (itemstack1.getItem() instanceof ItemNecklace){
+ if (!mergeItemStack(itemstack1, 14, 17, false)) return null;
+ }else if (itemstack1.getItem() instanceof ItemEarrings){
+ if (!mergeItemStack(itemstack1, 17, 18, false)) return null;
+ }else{
+ if (!mergeItemStack(itemstack1, 18, 54, true)) return null;
+ slot.onSlotChange(itemstack1, itemstack);
+ }
+ if (itemstack1.stackSize == 0) slot.putStack((ItemStack)null);
+ else slot.onSlotChanged();
+ }
+ return itemstack;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java b/src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java
new file mode 100644
index 0000000..925ded7
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java
@@ -0,0 +1,63 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.entity.player.InventoryPlayer;
+import net.minecraft.inventory.Container;
+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;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiHandler.java b/src/main/java/darkknight/jewelrycraft/container/GuiHandler.java
new file mode 100644
index 0000000..6ebd3e9
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiHandler.java
@@ -0,0 +1,78 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.tileentity.TileEntityChest;
+import net.minecraft.util.ResourceLocation;
+import net.minecraft.world.World;
+import cpw.mods.fml.common.network.IGuiHandler;
+import cpw.mods.fml.common.network.NetworkRegistry;
+import darkknight.jewelrycraft.JewelrycraftMod;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.client.GuiJewelry;
+import darkknight.jewelrycraft.client.GuiRingChest;
+
+public class GuiHandler implements IGuiHandler
+{
+ ResourceLocation pageTexture = new ResourceLocation("jewelrycraft", "textures/gui/guidePage.png");
+ ResourceLocation flippedPageTexture = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png");
+ ResourceLocation chestTexture = new ResourceLocation("jewelrycraft", "textures/gui/chest_ring.png");
+ ResourceLocation jewelryInvTexture = new ResourceLocation("jewelrycraft", "textures/gui/jewelry_tab.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));
+ 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);
+ default:
+ return null;
+ }
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java b/src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java
new file mode 100644
index 0000000..50b7cd5
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java
@@ -0,0 +1,97 @@
+package darkknight.jewelrycraft.container;
+
+import java.util.Arrays;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+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/container/GuiTab.java b/src/main/java/darkknight/jewelrycraft/container/GuiTab.java
new file mode 100644
index 0000000..e315d3a
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTab.java
@@ -0,0 +1,84 @@
+package darkknight.jewelrycraft.container;
+
+import cpw.mods.fml.relauncher.Side;
+import cpw.mods.fml.relauncher.SideOnly;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+@SideOnly (Side.CLIENT)
+public abstract class GuiTab extends GuiRectangle
+{
+ int values, del;
+ private String name;
+
+ /**
+ * @param name
+ * @param id
+ */
+ public GuiTab(String name, int id)
+ {
+ super(-62, 10 + 19 * id, 19, 18);
+ this.name = name;
+ values = 0;
+ del = 0;
+ }
+
+ /**
+ * @return
+ */
+ public String getName()
+ {
+ return name;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ public abstract void drawBackground(GuiGuide gui, int x, int y, int page);
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ public abstract void drawForeground(GuiGuide gui, int x, int y, int page);
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ */
+ public void mouseClick(GuiGuide gui, int x, int y, int button)
+ {}
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ * @param timeSinceClicked
+ */
+ public void mouseMoveClick(GuiGuide gui, int x, int y, int button, long timeSinceClicked)
+ {}
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ */
+ public void mouseReleased(GuiGuide gui, int x, int y, int button)
+ {}
+
+ /**
+ * @return
+ */
+ public int getMaxPages()
+ {
+ return 1;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java
new file mode 100644
index 0000000..de50533
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java
@@ -0,0 +1,176 @@
+package darkknight.jewelrycraft.container;
+
+import java.awt.Desktop;
+import java.net.URL;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.item.ItemList;
+
+public class GuiTabBlocks extends GuiTab
+{
+
+ /**
+ * @param id
+ */
+ public GuiTabBlocks(int id)
+ {
+ super("Blocks", id);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(BlockList.jewelAltar);
+ }
+
+ /**
+ * @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, 90f, true);
+ break;
+ case 2:
+ text = "The Shadow Block is crafted using 9 shadow ingots. Magicians believed it held the ability to merge with the shadows. It becomes more transparent as it";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowBlock), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot));
+ break;
+ case 3:
+ text = "gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 4:
+ text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.smelter), new ItemStack(Blocks.cobblestone), new ItemStack(Items.bucket), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone));
+ break;
+ case 5:
+ text = "melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do is right click on it with any ore or ingot. It can melt multimple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 6:
+ text = "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 7:
+ text = "The molder is a key piece in creating jewellery. You need to pour the molten metal out of the smelter somewhere. That somewhere is the";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.molder), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone));
+ break;
+ case 8:
+ text = "molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 9:
+ text = "have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 10:
+ text = "This table allows you to add a gem to a piece of jewellery. Right click the block while holding a jewellery to add it in. Then do the same with a gem (you";
+ 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.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone));
+ break;
+ case 11:
+ text = "can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 12:
+ text = "jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 13:
+ text = "This block can store any jewellery in it and activate their effects as it were a player. To do that simply right click the block with a jewellery. Crouch +";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.jewelAltar), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.wool, 1, 5), new ItemStack(Blocks.end_stone), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.wool, 1, 5), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.nether_brick), new ItemStack(Blocks.nether_brick));
+ break;
+ case 14:
+ text = "Right Click to retreive the jewellery.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 15:
+ 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";
+ 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 16:
+ text = "display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 17:
+ text = "If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 18:
+ text = "get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 19:
+ 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";
+ 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 20:
+ text = "sacrifices to 'The Dark One' in exchange for unimaginable powers.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 21:
+ 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";
+ 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 22:
+ text = "though, for He sees everything. To see how to create the ritual look in the Ritual tab.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ default:
+ ;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return 21;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ */
+ @Override
+ public void mouseClick(GuiGuide gui, int x, int y, int button)
+ {
+ if (gui.page == 21 && x >= gui.getLeft() + 130 && x <= gui.getLeft() + 160 && y >= gui.getTop() + 40 && y <= gui.getTop() + 50) try{
+ Desktop.getDesktop().browse(new URL("http://imgur.com/a/Zk0LW").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/container/GuiTabGemsAndIngots.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java
new file mode 100644
index 0000000..5f2bde0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java
@@ -0,0 +1,78 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import org.lwjgl.opengl.GL11;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class GuiTabGemsAndIngots extends GuiTab
+{
+
+ /**
+ * @param id
+ */
+ public GuiTabGemsAndIngots(int id)
+ {
+ super("Gems and ingots", id);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(Items.emerald);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ int xPos = page % 2 == 0 ? 107 : -35;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ for(int i = (page - 1) * 9; i < page * 9; i++)
+ if (i < JewelrycraftUtil.gem.size()){
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Gems", gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ gui.renderItem(JewelrycraftUtil.gem.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true, 0, 0, 0);
+ gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.gem.get(i).getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ page -= JewelrycraftUtil.gem.size() / 9 + 1;
+ for(int i = (page - 1) * 9; i < page * 9; i++)
+ if (i < JewelrycraftUtil.metal.size() && page > 0){
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Ingots", gui.getLeft() + xPos + 40, gui.getTop(), 0);
+ gui.renderItem(JewelrycraftUtil.metal.get(i).copy(), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f, true, 0, 0, 0);
+ gui.getFont().drawString(String.format("%-1.18s", JewelrycraftUtil.metal.get(i).copy().getDisplayName()), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 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/container/GuiTabIntroduction.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabIntroduction.java
new file mode 100644
index 0000000..f14c81e
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabIntroduction.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.item.ItemList;
+
+public class GuiTabIntroduction extends GuiTab
+{
+ public GuiTabIntroduction(int id)
+ {
+ super("Introduction", id);
+ }
+
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(ItemList.ring);
+ }
+
+ @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 = "Welcome to Jewelrycraft 2! This mod is about making jewelry that you can modify to your own will. To find out how to create a jewelry, please consult the book and look at the Smelter block. To add modifiers to it you need to perform a ritual. To see how to do that, look at the Cursed Eye";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 2:
+ text = "block in this giude. Please be aware that even if you can add anything as a modifier and can have multiple modifiers on one jewelry, this mod is still in alpha and does not have that many modifiers implemtnted and currently don't have any different effects depending on";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 3:
+ text = "the gem used. To see what modifiers are currently implemented, just look in the Modifiers tab located in this guide (it is the one with the blaze powder as an icon).";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ }
+ }
+
+ @Override
+ public int getMaxPages()
+ {
+ return 4;
+ }
+
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java
new file mode 100644
index 0000000..85c7211
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java
@@ -0,0 +1,166 @@
+package darkknight.jewelrycraft.container;
+
+import java.awt.Desktop;
+import java.net.URL;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.GuiGuide;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+
+public class GuiTabItems extends GuiTab
+{
+
+ /**
+ * @param id
+ */
+ public GuiTabItems(int id)
+ {
+ super("Items", id);
+ }
+
+ /**
+ * @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";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.thiefGloves), new ItemStack(ItemList.shadowIngot), null, new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15));
+ break;
+ case 3:
+ text = "right click on the them to hopefully steal the trades. If you traded with him before, then you have a chance of getting the traded emeralds back as well. This has a maximum of 10 uses before it breaks.";
+ 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), 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 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, 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:
+ text = "Crystals don't do much as of yet. They can be dyed in any color and used as gems to create a nice jewelry.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.crystal, 1, 15), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null, new ItemStack(Blocks.glass), null);
+ break;
+ case 11:
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values >= 15) values = 0;
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.crystal, 1, values), new ItemStack(Items.dye, 1, values), new ItemStack(ItemList.crystal, 1, 15));
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop() + 60, true, text, x, y, true, new ItemStack(ItemList.crystal, 1, 15), new ItemStack(Items.dye, 1, 15), new ItemStack(ItemList.crystal, 1, values));
+ break;
+ case 12:
+ 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";
+ 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 13:
+ String link = "HERE";
+ if (x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK;
+ text = "installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really appreciate it. After that you can share it in the main thread " + link + "." + " This mod was made by DarkKnight (or sor1n, depends";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 14:
+ text = "where you got this mod from) and the help of domi1819 and bspkrs.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 15:
+ ItemStack item = new ItemStack(ItemList.bucket);
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values > JewelrycraftUtil.metal.size() - 1) values = 0;
+ JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy());
+ text = "These buckets contain molten metal. To obtain one simply Right Click a full Smelter to get a bucket. You can pour the metal, other than that it has no use. You can place the molten metal back in a Smelter by Right Clicking one with it.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, item, text, 40f, 0, 0, true, 45, 10, true);
+ 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 == 13 && x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) try{
+ Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/topic/2210959-164smp-ssp-jewelrycraft-version-12/").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/container/GuiTabModifiers.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabModifiers.java
new file mode 100644
index 0000000..89db85b
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabModifiers.java
@@ -0,0 +1,74 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+public class GuiTabModifiers extends GuiTab
+{
+ int maxPages;
+ public GuiTabModifiers(int id)
+ {
+ super("Modifiers", id);
+ }
+
+ /**
+ * @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 of 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() - 7, 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() - 7, 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() - 7, new ItemStack(Items.ender_eye), text, 40f, true);
+ break;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return 4;
+ }
+
+ /**
+ * @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/container/GuiTabRitual.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabRitual.java
new file mode 100644
index 0000000..eed8072
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabRitual.java
@@ -0,0 +1,125 @@
+package darkknight.jewelrycraft.container;
+
+import org.lwjgl.opengl.GL11;
+import net.minecraft.init.Blocks;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+public class GuiTabRitual extends GuiTab
+{
+ public GuiTabRitual(int id)
+ {
+ super("Ritual", id);
+ }
+
+ @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/container/JewelryInventory.java b/src/main/java/darkknight/jewelrycraft/container/JewelryInventory.java
new file mode 100644
index 0000000..ce6f0b5
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/JewelryInventory.java
@@ -0,0 +1,165 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import darkknight.jewelrycraft.item.ItemBracelet;
+import darkknight.jewelrycraft.item.ItemEarrings;
+import darkknight.jewelrycraft.item.ItemNecklace;
+import darkknight.jewelrycraft.item.ItemRing;
+import darkknight.jewelrycraft.util.PlayerUtils;
+
+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, "Jewelrycraft");
+ 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, "Jewelrycraft");
+ 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;
+ }
+} \ No newline at end of file
diff --git a/src/main/java/darkknight/jewelrycraft/container/Page.java b/src/main/java/darkknight/jewelrycraft/container/Page.java
new file mode 100644
index 0000000..beaa0bc
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/Page.java
@@ -0,0 +1,197 @@
+package darkknight.jewelrycraft.container;
+
+import java.util.ArrayList;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.RenderHelper;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.ResourceLocation;
+import org.lwjgl.opengl.GL11;
+import org.lwjgl.opengl.GL12;
+import darkknight.jewelrycraft.client.GuiGuide;
+
+public class Page
+{
+ static ResourceLocation pageFlipped = new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png");
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param isSmall
+ * @param text
+ * @param mouseX
+ * @param mouseY
+ * @param items
+ */
+ public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[0].getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items[0].getDisplayName()) / 2) - 10, y - 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
+ ArrayList<String> name = new ArrayList<String>();
+ if (isSmall){
+ gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46);
+ gui.renderItem(items[0], x + 89, y + 22 + 10, 30f, rotate, 0, 0, 0);
+ for(int i = 1; i <= 4; i++)
+ if (items.length > i && items[i] != null){
+ int posX = x + 8 + (i - 1) % 2 * 22;
+ int posY = y + 26 + (i - 1) / 2 * 22;
+ gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
+ name.add(items[i].getDisplayName());
+ if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 16 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 14);
+ name.removeAll(name);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ drawText(gui, text, x, y + 25);
+ }else{
+ gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54);
+ gui.renderItem(items[0], x + 91, y + 28 + 10, 30f, rotate, 0, 0, 0);
+ for(int i = 1; i <= 9; i++)
+ if (items.length > i && items[i] != null){
+ int posX = x + 8 + (i - 1) % 3 * 19;
+ int posY = y + 22 + (i - 1) / 3 * 17;
+ gui.renderItem(items[i], posX, posY, 30f, rotate, 0, 0, 0);
+ name.add(items[i].getDisplayName());
+ if (mouseX >= posX - 8 && mouseX <= posX + 8 && mouseY >= posY - 10 && mouseY <= posY) gui.drawHoverString(name, posX - 20, posY - 12);
+ name.removeAll(name);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ }
+ drawText(gui, text, x, y + 32);
+ GL11.glColor4f(1, 1, 1, 1);
+ }
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param text
+ * @param mouseX
+ * @param mouseY
+ * @param items
+ */
+ public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, int mouseX, int mouseY, boolean rotate, ItemStack ... items)
+ {
+ ArrayList<String> name = new ArrayList<String>();
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items[1].getDisplayName(), x + 30 - items[0].getDisplayName().length() / 2, y + 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 52);
+ gui.renderItem(items[0], x + 13, y + 20 + 10, 35f, rotate, 0, 0, 0);
+ name.add(items[0].getDisplayName());
+ if (mouseX >= x && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 20 + 16) gui.drawHoverString(name, x, y + 20);
+ name.removeAll(name);
+ GL11.glDisable(GL11.GL_LIGHTING);
+ gui.renderItem(items[1], x + 77, y + 28 + 10, 35f, rotate, 0, 0, 0);
+ drawText(gui, text, x, y + 30);
+ GL11.glColor4f(1, 1, 1, 1);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param item
+ * @param text
+ * @param size
+ */
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, boolean rotate)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + (int)size/5, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ gui.renderItem(item, x + 13, y + 18, size, rotate, 0, 0, 0);
+ drawText(gui, text, x - 2, y - (int)(250 / size));
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ public static void addSlotItem(GuiGuide gui, int x, int y, int mouseX, int mouseY, ItemStack item, float xRot, float yRot, float zRot)
+ {
+ ArrayList<String> name = new ArrayList<String>();
+ GL11.glColor4f(1, 1, 1, 1);
+ Minecraft.getMinecraft().getTextureManager().bindTexture(pageFlipped);
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ gui.drawTexturedModalRect(x + 9, y + 19, 148, 153, 12, 12);
+ if(item.getItem() != null){
+ name.add(item.getDisplayName());
+ if (mouseX >= x + 10 && mouseX <= x + 20 && mouseY >= y + 20 && mouseY <= y + 30) gui.drawHoverString(name, x, y + 10);
+ name.removeAll(name);
+ }
+ GL11.glDisable(GL11.GL_LIGHTING);
+ GL11.glColor4f(1, 1, 1, 1);
+ if(item.getItem() != null) gui.renderItem(item, x + 15, y + 25, 40f, false, xRot, yRot, zRot);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param item
+ * @param text
+ * @param size
+ * @param txtX
+ * @param txtY
+ * @param showName
+ * @param imgX
+ * @param imgY
+ */
+ public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY, boolean rotate)
+ {
+ y += 5;
+ GL11.glEnable(GL11.GL_BLEND);
+ GL11.glEnable(GL12.GL_RESCALE_NORMAL);
+ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
+ if (showName) gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + item.getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(item.getDisplayName()) / 2) - 10, y + 2, 0);
+ GL11.glColor4f(1, 1, 1, 1);
+ gui.renderItem(item, x + 13 + imgX, y + 18 + imgY, size, rotate, 0, 0, 0);
+ drawText(gui, text, x + txtX, y + txtY);
+ GL11.glDisable(GL11.GL_BLEND);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param text
+ */
+ public static void addTextPage(GuiGuide gui, int x, int y, String text)
+ {
+ y -= 25;
+ drawText(gui, text, x, y);
+ GL11.glColor4f(1, 1, 1, 1);
+ }
+
+ /**
+ * @param gui
+ * @param text
+ * @param x
+ * @param y
+ */
+ public static void drawText(GuiGuide gui, String text, int x, int y)
+ {
+ String[] s = text.split(" ");
+ String displayText = "";
+ ArrayList<String> textLines = new ArrayList<String>();
+ for(String element: s)
+ if ((displayText + element + " ").length() <= 24) displayText += element + " ";
+ else{
+ textLines.add(displayText.trim());
+ displayText = element + " ";
+ }
+ textLines.add(displayText.trim());
+ for(int i = 0; i < textLines.size(); i++)
+ gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0);
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/container/SlotBracelet.java b/src/main/java/darkknight/jewelrycraft/container/SlotBracelet.java
new file mode 100644
index 0000000..c82421d
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotBracelet.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemBracelet;
+
+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;
+ }
+
+ /**
+ * @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/container/SlotEarrings.java b/src/main/java/darkknight/jewelrycraft/container/SlotEarrings.java
new file mode 100644
index 0000000..550f4f9
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotEarrings.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemEarrings;
+
+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;
+ }
+
+ /**
+ * @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/container/SlotNecklace.java b/src/main/java/darkknight/jewelrycraft/container/SlotNecklace.java
new file mode 100644
index 0000000..42543b0
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotNecklace.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemNecklace;
+
+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;
+ }
+
+ /**
+ * @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/container/SlotRing.java b/src/main/java/darkknight/jewelrycraft/container/SlotRing.java
new file mode 100644
index 0000000..52aa4fb
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotRing.java
@@ -0,0 +1,52 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.inventory.IInventory;
+import net.minecraft.inventory.Slot;
+import net.minecraft.item.ItemStack;
+import darkknight.jewelrycraft.item.ItemRing;
+
+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;
+ }
+
+ /**
+ * @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/container/SlotRingChest.java b/src/main/java/darkknight/jewelrycraft/container/SlotRingChest.java
new file mode 100644
index 0000000..b1f553c
--- /dev/null
+++ b/src/main/java/darkknight/jewelrycraft/container/SlotRingChest.java
@@ -0,0 +1,55 @@
+package darkknight.jewelrycraft.container;
+
+import net.minecraft.entity.player.EntityPlayer;
+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;
+ }
+}