diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-03 21:09:09 +0000 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-02-03 21:09:09 +0000 |
| commit | 3f4c717de5ebc9b942d65ae45ac87c43bdf8a31b (patch) | |
| tree | 15c68c8b61dbd0b7f44937a5c790c4b844e50f58 /java/darkknight/jewelrycraft/container | |
| parent | 73ca377dc01f859dabd7b07738cb7aeb762272b1 (diff) | |
Made a few modifications to some classes, added earrings and bracelets. Improved coloring algorithm and balanced the Thieving Glove
Diffstat (limited to 'java/darkknight/jewelrycraft/container')
| -rw-r--r-- | java/darkknight/jewelrycraft/container/GuiTabBlocks.java | 169 | ||||
| -rw-r--r-- | java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java (renamed from java/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java) | 26 | ||||
| -rw-r--r-- | java/darkknight/jewelrycraft/container/GuiTabItems.java | 201 | ||||
| -rw-r--r-- | java/darkknight/jewelrycraft/container/GuiTabModifiers.java | 50 | ||||
| -rw-r--r-- | java/darkknight/jewelrycraft/container/GuiTabNecklaces.java | 405 | ||||
| -rw-r--r-- | java/darkknight/jewelrycraft/container/GuiTabRings.java | 613 | ||||
| -rw-r--r-- | java/darkknight/jewelrycraft/container/Page.java | 92 |
7 files changed, 213 insertions, 1343 deletions
diff --git a/java/darkknight/jewelrycraft/container/GuiTabBlocks.java b/java/darkknight/jewelrycraft/container/GuiTabBlocks.java index 507808b..237466c 100644 --- a/java/darkknight/jewelrycraft/container/GuiTabBlocks.java +++ b/java/darkknight/jewelrycraft/container/GuiTabBlocks.java @@ -26,53 +26,28 @@ public class GuiTabBlocks extends GuiTab @Override public void drawBackground(GuiGuide gui, int x, int y, int page) { - ArrayList<String> text = new ArrayList<String>(); + String text = ""; ArrayList<ItemStack> items = new ArrayList<ItemStack>(); int xPos = (page % 2 == 0) ? 107 : -35; switch (page) { case 1: - text.add(" This ore is extremely"); - text.add("rare and can be found"); - text.add("only between Y level 5"); - text.add("and 8. It can only be"); - text.add("mined using a diamond"); - text.add("pickaxe."); + 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); break; case 2: - text.add(" The Shadow Block is"); - text.add("crafted using 9 shadow"); - text.add("ingots. It has been"); - text.add("discovered that it"); - text.add("poseses abnormal"); - text.add("properties in the"); - text.add("shadow. The darker it"); + 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"; items.add(new ItemStack(BlockList.shadowBlock)); for (int i = 1; i <= 9; i++) items.add(new ItemStack(ItemList.shadowIngot)); Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; case 3: - text.add("is, the more"); - text.add("transparent it will be,"); - text.add("until it becomes"); - text.add("walkable through. If a"); - text.add("comparator is attached"); - text.add("to it, the output"); - text.add("strength will be equal"); - text.add("to the value of"); - text.add("darkness it is in."); + 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.add(" The smelter is one of"); - text.add("the first blocks needed"); - text.add("to get started with"); - text.add("Jewelrycraft. Requiring"); - text.add("just some cobble and"); - text.add("a couple buckets, it's"); - text.add("the most important"); + 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"; items.add(new ItemStack(BlockList.smelter)); items.add(new ItemStack(Blocks.cobblestone)); items.add(new ItemStack(Items.bucket)); @@ -86,37 +61,15 @@ public class GuiTabBlocks extends GuiTab Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; case 5: - text.add("block as it can melt"); - text.add("ingots which can be"); - text.add("made into pieces of"); - text.add("jewellery, like rings"); - text.add("or necklaces. To use"); - text.add("the block all you need"); - text.add("to do is right click"); - text.add("on it with any ingot."); - text.add("If left clicked while"); - text.add("smelting, a message"); - text.add("will appear saying the"); - text.add("percentage it is done."); + 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.add("If left clicked when"); - text.add("it's done smelting,"); - text.add("a message will be"); - text.add("displayed, mentioning"); - text.add("the contents of the"); - text.add("block."); + 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.add(" The molder is a key"); - text.add("piece in creating"); - text.add("jewellery. You need"); - text.add("to pour the molten"); - text.add("metal out of the"); - text.add("smelter somewhere."); - text.add("That somewhere is the"); + 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"; items.add(new ItemStack(BlockList.molder)); items.add(new ItemStack(Blocks.cobblestone)); @@ -127,43 +80,15 @@ public class GuiTabBlocks extends GuiTab Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; case 8: - text.add("molder. But before"); - text.add("pouring the molten"); - text.add("metal in it, you must"); - text.add("first add a mold."); - text.add("You can do that by"); - text.add("simply right clicking"); - text.add("the block with the"); - text.add("mold of your choice."); - text.add("If you want to get the"); - text.add("mold out, simply crouch"); - text.add("and right click it with"); - text.add("an empty hand."); + 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.add(" Once you have a mold"); - text.add("inside, left click on"); - text.add("the smelter and wait"); - text.add("for the metal to cool"); - text.add("down. When it's done,"); - text.add("left click on the"); - text.add("molder to get the"); - text.add("jewellery. " + EnumChatFormatting.DARK_RED + "Be aware"); - text.add(EnumChatFormatting.DARK_RED + "that this block must be"); - text.add(EnumChatFormatting.DARK_RED + "placed directly in front"); - text.add(EnumChatFormatting.DARK_RED + "of the smelter,"); - text.add(EnumChatFormatting.DARK_RED + "otherwise it won't work!"); + 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.add(" Your jewellery on"); - text.add("their own don't do"); - text.add("much. They need to be"); - text.add("modified a bit and the"); - text.add("only way to do that is"); - text.add("by using this block."); - text.add("Simply right click the"); + 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; @@ -180,39 +105,15 @@ public class GuiTabBlocks extends GuiTab Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; case 11: - text.add("block while holding the"); - text.add("jewellery to place it in."); - text.add("After that just add in"); - text.add("a jewel or a modifier,"); - text.add("or even both, to the"); - text.add("block. To do that simply"); - text.add("right click with them on"); - text.add("the block. Once it's"); - text.add("done modifying, left"); - text.add("click on it to retrieve"); - text.add("the modified item. If"); - text.add("you wish to know how"); + 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.add("much is left before the"); - text.add("transformation is done,"); - text.add("simply left click on the"); - text.add("table in the process."); - text.add(" A list with all the"); - text.add("possible modifiers is"); - text.add("located in a separate"); - text.add("tab."); + 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.add(" This block can store"); - text.add("any jewellery in it"); - text.add("and activate their"); - text.add("effects as it were a"); - text.add("player. However, it"); - text.add("does not work with"); - text.add("everything. You can"); + 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 +"; items.add(new ItemStack(BlockList.jewelAltar)); items.add(new ItemStack(Blocks.end_stone)); items.add(new ItemStack(Blocks.wool, 1, 5)); @@ -226,24 +127,11 @@ public class GuiTabBlocks extends GuiTab Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; case 14: - text.add("find out which jewellery"); - text.add("works by looking in"); - text.add("their apropriate tab."); - text.add(" Each item will have a"); - text.add("note where it is"); - text.add("mentioned their effect"); - text.add("when placed in this"); - text.add("block."); + text = "Right Click to retreive the jewellery."; Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); break; case 15: - text.add(" The Storage"); - text.add("Displayer, as the"); - text.add("name suggests, can"); - text.add("store a large amount"); - text.add("of a single item/block"); - text.add("placed in it. This will"); - text.add("display all possible"); + 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"; items.add(new ItemStack(BlockList.displayer)); items.add(null); items.add(new ItemStack(Items.iron_ingot)); @@ -257,28 +145,15 @@ public class GuiTabBlocks extends GuiTab Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; case 16: - text.add("infromation about the"); - text.add("object in it, such as"); - text.add("the name, durability,"); - text.add("enchantments and many"); - text.add("more. Below the name"); - text.add("is shown the amount"); - text.add("stored. To store"); - text.add("something in it simply"); - text.add("right click with that"); - text.add("object on it and the"); - text.add("whole amount of items"); - text.add("or blocks will be"); + 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.add("immediately stored"); - text.add("inside. To retrieve"); - text.add("a single item just"); - text.add("left click the block."); - text.add("If you wish to get"); - text.add("a whole stack, just"); - text.add("crouch and left click."); + 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; default: diff --git a/java/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java b/java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java index d586348..7e9c815 100644 --- a/java/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java +++ b/java/darkknight/jewelrycraft/container/GuiTabGemsAndIngots.java @@ -9,11 +9,11 @@ import org.lwjgl.opengl.GL11; import darkknight.jewelrycraft.client.GuiGuide; import darkknight.jewelrycraft.util.JewelrycraftUtil; -public class GuiTabJewelsAndModifiers extends GuiTab +public class GuiTabGemsAndIngots extends GuiTab { - public GuiTabJewelsAndModifiers(int id) + public GuiTabGemsAndIngots(int id) { - super("Gems, modifiers and ingots", id); + super("Gems and ingots", id); } public ItemStack getIcon() @@ -25,41 +25,33 @@ public class GuiTabJewelsAndModifiers extends GuiTab 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); - gui.getFont().drawString(JewelrycraftUtil.gem.get(i).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 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.modifiers.size() && page > 0) - { - gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Modifiers", gui.getLeft() + xPos + 40, gui.getTop(), 0); - gui.renderItem(JewelrycraftUtil.modifiers.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16 * (i - 9 * (page - 1)), 30f); - gui.getFont().drawString(JewelrycraftUtil.modifiers.get(i).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 0); - GL11.glDisable(GL11.GL_LIGHTING); - } - } - page -= (JewelrycraftUtil.modifiers.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); - gui.getFont().drawString(JewelrycraftUtil.metal.get(i).copy().getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16 * (i - 9 * (page - 1)), 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); } public int getMaxPages() { - return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.modifiers.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2; + return JewelrycraftUtil.gem.size() / 9 + JewelrycraftUtil.metal.size() / 9 + 2; } @Override diff --git a/java/darkknight/jewelrycraft/container/GuiTabItems.java b/java/darkknight/jewelrycraft/container/GuiTabItems.java index 60d4fb6..5950218 100644 --- a/java/darkknight/jewelrycraft/container/GuiTabItems.java +++ b/java/darkknight/jewelrycraft/container/GuiTabItems.java @@ -11,6 +11,8 @@ 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 { @@ -28,31 +30,19 @@ public class GuiTabItems extends GuiTab @Override public void drawBackground(GuiGuide gui, int x, int y, int page) { - ArrayList<String> text = new ArrayList<String>(); + String text = ""; ArrayList<ItemStack> items = new ArrayList<ItemStack>(); int xPos = (page % 2 == 0) ? 107 : -35; switch (page) { case 1: - text.add(" Shadow ingots are"); - text.add("obtained by smelting"); - text.add("shadow ore. They are"); - text.add("used in a few recipes"); - text.add("and an important key"); - text.add("for making some"); - text.add("jewellery work."); + text = "Shadow ingots are obtained by smelting shadow ore. They are used in a few recipes and an important key for making some jewellery work."; items.add(new ItemStack(BlockList.shadowOre)); items.add(new ItemStack(ItemList.shadowIngot)); Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y); break; case 2: - text.add(" These gloves allow"); - text.add("you to steal the trades"); - text.add("the pesky Testificates"); - text.add("have to offer."); - text.add(" To use these simply"); - text.add("open their gui at least"); - text.add("once, then crouch and"); + text = "These gloves give you the chance to steal the trades those pesky Testificates have to offer. To use these simply open their gui at least once, then Crouch and"; items.add(new ItemStack(ItemList.thiefGloves)); items.add(new ItemStack(ItemList.shadowIngot)); items.add(null); @@ -66,62 +56,18 @@ public class GuiTabItems extends GuiTab Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; case 3: - text.add("right click on the them"); - text.add("to steal the trades."); - text.add("A villager has 7 of the"); - text.add("same trade item. So, for"); - text.add("example, if he wants 2"); - text.add("emeralds in exchange"); - text.add("for 4 diamonds, you will"); - text.add("get 28 diamonds from"); - text.add("him, because 7*4=28."); - text.add("However, if you have"); - text.add("traded with him before,"); - text.add("then he will have that"); + 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.add("many times less of the"); - text.add("item. This has a maximum"); - text.add("of 10 uses before it"); - text.add("breaks."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 5: - text.add(" In order to get the"); - text.add("ingot back from the"); - text.add("smelter you need a"); - text.add("mold for it. However,"); - text.add("this mold can't be used."); - text.add("It is too soft. It needs"); - text.add("to be hardened in"); - text.add("order for it to be used."); + 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."; items.add(new ItemStack(ItemList.clayMolds, 1, 0)); items.add(new ItemStack(Items.clay_ball)); items.add(new ItemStack(Items.clay_ball)); Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, items, x, y); break; - case 6: - text.add(" By smelting the clay_ball"); - text.add("mold you get a harder"); - text.add("version which can be"); - text.add("used to create ingots."); - text.add("Simply right click with"); - text.add("this on a molder to"); - text.add("attach it and you're"); - text.add("ready to go."); - items.add(new ItemStack(ItemList.clayMolds, 1, 0)); - items.add(new ItemStack(ItemList.molds, 1, 0)); - Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y); - break; - case 7: - text.add(" In order to create a"); - text.add("ring you need a mold"); - text.add("for it. However, this"); - text.add("one can't be used. It is"); - text.add("too soft. It needs to be"); - text.add("hardened in order for"); - text.add("it to be used."); + 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."; items.add(new ItemStack(ItemList.clayMolds, 1, 1)); items.add(null); items.add(new ItemStack(Items.clay_ball)); @@ -134,27 +80,8 @@ public class GuiTabItems extends GuiTab items.add(null); Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; - case 8: - text.add(" By smelting the clay_ball"); - text.add("mold you get a harder"); - text.add("version which can be"); - text.add("used to create rings."); - text.add("Simply right click with"); - text.add("this on a molder to"); - text.add("attach it and you're"); - text.add("ready to go."); - items.add(new ItemStack(ItemList.clayMolds, 1, 1)); - items.add(new ItemStack(ItemList.molds, 1, 1)); - Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y); - break; - case 9: - text.add(" In order to create a"); - text.add("necklace you need a"); - text.add("mold for it. However,"); - text.add("this one can't be used."); - text.add("It is too soft. It needs"); - text.add("to be hardened in"); - text.add("order for it to be used."); + 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."; items.add(new ItemStack(ItemList.clayMolds, 1, 2)); items.add(new ItemStack(Items.clay_ball)); items.add(null); @@ -167,25 +94,46 @@ public class GuiTabItems extends GuiTab items.add(null); Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; - case 10: - text.add(" By smelting the clay_ball"); - text.add("mold you get a harder"); - text.add("version which can be"); - text.add("used to create"); - text.add("necklaces. Simply right"); - text.add("click with this on a"); - text.add("molder to attach it and"); - text.add("you're ready to go."); - items.add(new ItemStack(ItemList.clayMolds, 1, 2)); - items.add(new ItemStack(ItemList.molds, 1, 2)); + 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."; + items.add(new ItemStack(ItemList.clayMolds, 1, 3)); + items.add(new ItemStack(Items.clay_ball)); + items.add(new ItemStack(Items.clay_ball)); + items.add(new ItemStack(Items.clay_ball)); + items.add(new ItemStack(Items.clay_ball)); + items.add(null); + items.add(new ItemStack(Items.clay_ball)); + items.add(new ItemStack(Items.clay_ball)); + items.add(new ItemStack(Items.clay_ball)); + items.add(new ItemStack(Items.clay_ball)); + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); + 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."; + items.add(new ItemStack(ItemList.clayMolds, 1, 4)); + items.add(null); + items.add(null); + items.add(null); + items.add(new ItemStack(Items.clay_ball)); + items.add(null); + items.add(new ItemStack(Items.clay_ball)); + items.add(null); + items.add(null); + items.add(null); + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); + 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 jewellery. Simply right click with this on a molder to attach it and you're ready to go."; + items.add(new ItemStack(ItemList.clayMolds, 1, values)); + items.add(new ItemStack(ItemList.molds, 1, values)); Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, items, x, y); break; - case 11: - text.add(" Crystals don't do"); - text.add("much. They can be dyed"); - text.add("in any color and used"); - text.add("as jewels to create a"); - text.add("nice jewellery."); + 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 jewellery."; items.add(new ItemStack(ItemList.crystal, 1, 15)); items.add(null); items.add(new ItemStack(Blocks.glass)); @@ -198,7 +146,7 @@ public class GuiTabItems extends GuiTab items.add(null); Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); break; - case 12: + case 11: if (del == 0) values++; del++; if (del >= 300) del = 0; @@ -213,42 +161,37 @@ public class GuiTabItems extends GuiTab items.add(new ItemStack(ItemList.crystal, 1, values)); Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop() + 60, true, text, items, x, y); break; - case 13: + case 12: if (del == 0) values++; del++; if (del >= 300) del = 0; - if (values >= 3) values = 0; - text.add(" It's this exact guide."); - text.add("I don't even know why"); - text.add("you're reading this."); - text.add("I added this recipe in"); - text.add("case you lose the"); - text.add("original. In case you"); - text.add("don't have it, I suggest"); - text.add("adding NEI so you can"); + 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"; items.add(new ItemStack(ItemList.guide)); items.add(new ItemStack(ItemList.molds, 1, values)); items.add(new ItemStack(Items.book)); Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, items, x, y); break; - case 14: + case 13: String link = "HERE"; - if (x >= gui.getLeft() + 138 && x <= gui.getLeft() + 168 && y >= gui.getTop() + 98 && y <= gui.getTop() + 108) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK; - text.add("see all the recipes."); - text.add("Since you are reading"); - text.add("this, how about making"); - text.add("a youtube video"); - text.add("spotlighting this mod."); - text.add("I'd really appreciate it."); - text.add("After that you can"); - text.add("share it in the main"); - text.add("thread " + link + "."); - text.add(" This mod was made by"); - text.add("DarkKnight (or sor1n"); - text.add("depending from where"); - text.add("you got this)"); + 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); + break; default: ; } @@ -256,12 +199,12 @@ public class GuiTabItems extends GuiTab public int getMaxPages() { - return 13; + return 15; } public void mouseClick(GuiGuide gui, int x, int y, int button) { - if (gui.page == 13 && x >= gui.getLeft() + 138 && x <= gui.getLeft() + 168 && y >= gui.getTop() + 98 && y <= gui.getTop() + 108) + if (gui.page == 13 && x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) { try { diff --git a/java/darkknight/jewelrycraft/container/GuiTabModifiers.java b/java/darkknight/jewelrycraft/container/GuiTabModifiers.java new file mode 100644 index 0000000..6a0143d --- /dev/null +++ b/java/darkknight/jewelrycraft/container/GuiTabModifiers.java @@ -0,0 +1,50 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; + +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 GuiTabModifiers extends GuiTab +{ + public GuiTabModifiers(int id) + { + super("Modifiers", id); + } + + public ItemStack getIcon() + { + return new ItemStack(Items.blaze_powder); + } + + @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 is a test to see if the program works or not! And it does seem to be working. Yaaay! Thank God I made this. This is so much easier :D"; + Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(Items.blaze_powder), text, 40f); + break; + default:; + } + } + + public int getMaxPages() + { + return 1; + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + { + } + +} diff --git a/java/darkknight/jewelrycraft/container/GuiTabNecklaces.java b/java/darkknight/jewelrycraft/container/GuiTabNecklaces.java deleted file mode 100644 index 531de4a..0000000 --- a/java/darkknight/jewelrycraft/container/GuiTabNecklaces.java +++ /dev/null @@ -1,405 +0,0 @@ -package darkknight.jewelrycraft.container; - -import java.util.ArrayList; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.client.GuiGuide; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -public class GuiTabNecklaces extends GuiTab -{ - int jValues; - - public GuiTabNecklaces(int id) - { - super("Necklaces", id); - jValues = 0; - } - - public ItemStack getIcon() - { - ItemStack it = new ItemStack(ItemList.necklace); - JewelryNBT.addMetal(it, new ItemStack(Items.iron_ingot)); - JewelryNBT.addGem(it, new ItemStack(Blocks.redstone_block)); - return it; - } - - @Override - public void drawBackground(GuiGuide gui, int x, int y, int page) - { - ArrayList<String> text = new ArrayList<String>(); - ArrayList<ItemStack> gems = new ArrayList<ItemStack>(); - ItemStack item = new ItemStack(ItemList.necklace); - int xPos = (page % 2 == 0) ? 107 : -35; - switch (page) - { - case 1: - 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()); - JewelryNBT.addGem(item, new ItemStack(Items.ender_pearl)); - - text.add(EnumChatFormatting.DARK_GREEN + "gem: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "None"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring teleports"); - text.add("you and anyone around "); - text.add("in any location from the"); - text.add("same dimension. Just"); - text.add("right click once in a"); - text.add("location to se the "); - text.add("position. Then right "); - text.add("click any time you want"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 2: - text.add("to teleport there."); - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" This teleports anyone"); - text.add("or anything that steps"); - text.add("or goes near the altar"); - text.add("to the necklaces"); - text.add("coordonates, as long"); - text.add("as that is in the same"); - text.add("dimension."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 3: - 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()); - JewelryNBT.addGem(item, new ItemStack(Items.ender_pearl)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "gem: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bed"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" Just like the other"); - text.add("necklace this teleports"); - text.add("you and anybody close"); - text.add("to you to the set"); - text.add("destination. The only"); - text.add("difference is that you"); - text.add("can travel between"); - text.add("dimensions with this."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 4: - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" This teleports anyone"); - text.add("or anything that step"); - text.add("on or around the altar"); - text.add("to the set location, with"); - text.add("the benefit of it being"); - text.add("capable of"); - text.add("inter-dimensional"); - text.add("travels."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 5: - gems.add(null); - gems.add(new ItemStack(Items.diamond)); - gems.add(new ItemStack(Items.emerald)); - gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Blaze Powder"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Fire Resistance"); - text.add("when activated and in"); - text.add("your inventory. To"); - text.add("deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 6: - text.add("Depending on the gem"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Fire"); - text.add(EnumChatFormatting.DARK_RED + "Resistance" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any gem,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 7: - gems.add(null); - gems.add(new ItemStack(Items.diamond)); - gems.add(new ItemStack(Items.emerald)); - gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Sugar"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To"); - text.add("deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 8: - text.add("Depending on the gem"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " I"); - text.add("if you haven't got any"); - text.add("gem, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 9: - gems.add(null); - gems.add(new ItemStack(Items.diamond)); - gems.add(new ItemStack(Items.emerald)); - gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Iron Pickaxe"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To"); - text.add("deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 10: - text.add("Depending on the gem"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " I"); - text.add("if you haven't got any"); - text.add("gem, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 11: - gems.add(null); - gems.add(new ItemStack(Items.diamond)); - gems.add(new ItemStack(Items.emerald)); - gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Feather"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To"); - text.add("deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 12: - text.add("Depending on the gem"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Jump Boost"); - text.add("I if you haven't got any"); - text.add("gem, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 13: - gems.add(null); - gems.add(new ItemStack(Items.diamond)); - gems.add(new ItemStack(Items.emerald)); - gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "8min Potion of"); - text.add("Invisibility"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This necklace gives"); - text.add("you and those around"); - text.add("you " + EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To"); - text.add("deactivate it simply"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 14: - text.add("right click with it."); - text.add("Depending on the gem"); - text.add("used, you and the"); - text.add("others get " + EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " I"); - text.add("if you haven't got any"); - text.add("gem, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 15: - gems.add(null); - gems.add(new ItemStack(Items.diamond)); - gems.add(new ItemStack(Items.emerald)); - gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bone Meal"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This hydrates the"); - text.add("farm blocks under you"); - text.add("in a defined area. If"); - text.add("you right click with this,"); - text.add("it will help plants in"); - text.add("that area grow faster."); - text.add("The are it affects is"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 16: - text.add("determined by the gem"); - text.add("used. For none, the"); - text.add("area is a block, diamond"); - text.add("is 3x3, emerald 5x5 and"); - text.add("nether star 11x11."); - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" In the altar, this"); - text.add("has the ability to"); - text.add("hydrate any tilted land"); - text.add("and speed up the"); - text.add("growth of plants in a"); - text.add("7x3x7 area."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 17: - JewelryNBT.addMetal(item, new ItemStack(ItemList.shadowIngot)); - JewelryNBT.addGem(item, new ItemStack(Items.nether_star)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "gem: " + EnumChatFormatting.BLACK + "Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Diamond Pick"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Shadow Ingot"); - text.add(" This will break all"); - text.add("blocks in a 3x3x1 area."); - text.add("Just right click on a"); - text.add("block and let the mining"); - text.add("begin."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - default: - ; - } - } - - public int getMaxPages() - { - return 17; - } - - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - { - } - -} diff --git a/java/darkknight/jewelrycraft/container/GuiTabRings.java b/java/darkknight/jewelrycraft/container/GuiTabRings.java deleted file mode 100644 index 1e30659..0000000 --- a/java/darkknight/jewelrycraft/container/GuiTabRings.java +++ /dev/null @@ -1,613 +0,0 @@ -package darkknight.jewelrycraft.container; - -import java.util.ArrayList; - -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import darkknight.jewelrycraft.client.GuiGuide; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; - -public class GuiTabRings extends GuiTab -{ - int jValues; - - public GuiTabRings(int id) - { - super("Rings", id); - jValues = 0; - } - - public ItemStack getIcon() - { - ItemStack it = new ItemStack(ItemList.ring); - JewelryNBT.addMetal(it, new ItemStack(Items.gold_ingot)); - JewelryNBT.addGem(it, new ItemStack(Items.ender_pearl)); - return it; - } - - @Override - public void drawBackground(GuiGuide gui, int x, int y, int page) - { - ArrayList<String> text = new ArrayList<String>(); - ArrayList<ItemStack> Gems = new ArrayList<ItemStack>(); - ItemStack item = new ItemStack(ItemList.ring); - int xPos = (page % 2 == 0) ? 107 : -35; - switch (page) - { - case 1: - 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()); - JewelryNBT.addGem(item, new ItemStack(Items.ender_pearl)); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "None"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring allows you"); - text.add("to teleport in any"); - text.add("location from the same"); - text.add("dimension. Simply right"); - text.add("click once in a location"); - text.add("to se the position. Then"); - text.add("right click any time you"); - text.add("want to teleport there."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 2: - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" If this ring is placed"); - text.add("in the altar and if the"); - text.add("ring has coordonates"); - text.add("memorized, then anyone"); - text.add("who steps on the block"); - text.add("will get teleported in"); - text.add("that location, as long"); - text.add("as it is in the same"); - text.add("dimension. This works"); - text.add("for other entities as"); - text.add("well, not just players."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 3: - 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()); - JewelryNBT.addGem(item, new ItemStack(Items.ender_pearl)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bed"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" Just like the other"); - text.add("ring that had only an"); - text.add("ender pearl as a Gem,"); - text.add("by adding a bed as a"); - text.add("modifier to it you can"); - text.add("travel between"); - text.add("dimensions."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 4: - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" Just like the other"); - text.add("one, when in the altar"); - text.add("if somebody steps on"); - text.add("the block they get"); - text.add("teleported in that spot."); - text.add("The only difference is"); - text.add("that you can teleport"); - text.add("between dimesnions with"); - text.add("this. It works for mobs"); - text.add("and other entities as"); - text.add("well."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 5: - Gems.add(null); - Gems.add(new ItemStack(Items.diamond)); - Gems.add(new ItemStack(Items.emerald)); - Gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > Gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, Gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Blaze Powder"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Fire Resistance" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory. To deactivate"); - text.add("it simply right click with"); - text.add("it. Depending on the"); - text.add("Gem you used, you"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 6: - text.add("get " + EnumChatFormatting.DARK_RED + "Fire Resistance" + EnumChatFormatting.BLACK + " I"); - text.add("if you haven't got any"); - text.add("Gem, II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 7: - Gems.add(null); - Gems.add(new ItemStack(Items.diamond)); - Gems.add(new ItemStack(Items.emerald)); - Gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > Gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, Gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Sugar"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " when activated"); - text.add("and in your inventory."); - text.add("To deactivate it simply"); - text.add("right click with it."); - text.add("Depending on the"); - text.add("Gem you used, you"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 8: - text.add("get " + EnumChatFormatting.DARK_RED + "Speed" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any Gem,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 9: - Gems.add(null); - Gems.add(new ItemStack(Items.diamond)); - Gems.add(new ItemStack(Items.emerald)); - Gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > Gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, Gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Iron Pickaxe"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " when activated"); - text.add("and in your inventory."); - text.add("To deactivate it simply"); - text.add("right click with it."); - text.add("Depending on the"); - text.add("Gem you used, you"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 10: - text.add("get " + EnumChatFormatting.DARK_RED + "Haste" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any Gem,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 11: - Gems.add(null); - Gems.add(new ItemStack(Items.diamond)); - Gems.add(new ItemStack(Items.emerald)); - Gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > Gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, Gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Feather"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory, as well as"); - text.add("remove any fall damage."); - text.add("To deactivate it simply"); - text.add("right click with it."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 12: - text.add("Depending on the Gem"); - text.add("you used, you get"); - text.add(EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any Gem,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 13: - Gems.add(null); - Gems.add(new ItemStack(Items.diamond)); - Gems.add(new ItemStack(Items.emerald)); - Gems.add(new ItemStack(Items.nether_star)); - - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > Gems.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, Gems.get(jValues)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "None, Diamond"); - text.add("Emerald or Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "8min Potion of"); - text.add("Invisibility"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring grants you"); - text.add(EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " when"); - text.add("activated and in your"); - text.add("inventory, as well as"); - text.add("remove any fall damage."); - text.add("To deactivate it simply"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 14: - text.add("right click with it."); - text.add("Depending on the Gem"); - text.add("you used, you get"); - text.add(EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " I if you"); - text.add("haven't got any Gem,"); - text.add("II for Diamond,"); - text.add("III for Emerald and"); - text.add("VIII for Nether Star."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 15: - 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()); - JewelryNBT.addGem(item, new ItemStack(Items.nether_star)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Book"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This has the power"); - text.add("to " + EnumChatFormatting.DARK_PURPLE + "Enchant" + EnumChatFormatting.BLACK + ", " + EnumChatFormatting.DARK_PURPLE + "Disenchant" + EnumChatFormatting.BLACK + ""); - text.add("or even" + EnumChatFormatting.DARK_PURPLE + " Transfer"); - text.add(EnumChatFormatting.DARK_PURPLE + "Enchantments" + EnumChatFormatting.BLACK + ". To"); - text.add("change its mode simply"); - text.add("right click it. However,"); - text.add("this ring only works"); - text.add("when it is being held."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 16: - text.add(EnumChatFormatting.DARK_PURPLE + "\u00a7nDisenchanting" + EnumChatFormatting.BLACK + ""); - text.add(" If the ring is held"); - text.add("and an enchanted item"); - text.add("is placed beside it in"); - text.add("the hotbar, the ring"); - text.add("will remove all the"); - text.add("enchantments from the"); - text.add("item and store them in"); - text.add("enchanted books, which"); - text.add("are placed in your"); - text.add("inventory. Be careful"); - text.add("however, because if"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 17: - text.add("there is no room in"); - text.add("your inventory for the"); - text.add("books, the enchantments"); - text.add("will go in the void with"); - text.add("no way of recovering"); - text.add("them. Unfortunately,"); - text.add("disenchanting is not"); - text.add("free. It requires 2"); - text.add("levels of experience"); - text.add("per ench and some of"); - text.add("your blood. It will also"); - text.add("damage the item a bit."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 18: - text.add(EnumChatFormatting.DARK_PURPLE + "\u00a7nEnchanting" + EnumChatFormatting.BLACK + ""); - text.add(" This mode allows you"); - text.add("to give a random"); - text.add("enchantment to an item"); - text.add("that can hold"); - text.add("enchantments in the"); - text.add("first place. However,"); - text.add("each enchanting comes"); - text.add("with a cost. The player"); - text.add("is required to have at"); - text.add("least 1 level of xp."); - text.add("The higher the number"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 19: - text.add("the better, as the level"); - text.add("of the enchantment will"); - text.add("be equal with the amount"); - text.add("of levels, but this value"); - text.add("can never go over 6."); - text.add("This gives allows people"); - text.add("to get an enchantment"); - text.add("of a higher value than"); - text.add("normal (5 being the"); - text.add("limit normally)."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 20: - text.add(EnumChatFormatting.DARK_PURPLE + "\u00a7nEnchantment Transfer" + EnumChatFormatting.BLACK + ""); - text.add(" This mode is very"); - text.add("special as it lets you"); - text.add("transfer enchantments"); - text.add("from an item or block to"); - text.add("another, not caring if"); - text.add("the item/block can"); - text.add("actually hold enchants."); - text.add("Just place the ench"); - text.add("item on the left of the"); - text.add("ring and to the right of"); - text.add("the ring, the item you"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 21: - text.add("want to transfer the"); - text.add("enchs to. The ring can"); - text.add("only transfer an ench"); - text.add("at a time, after each"); - text.add("transfer it requiring a"); - text.add("cooldown."); - text.add(EnumChatFormatting.DARK_RED + " Again, this ring only"); - text.add(EnumChatFormatting.DARK_RED + "works when it is in the"); - text.add(EnumChatFormatting.DARK_RED + "players hotbar and"); - text.add(EnumChatFormatting.DARK_RED + "being held!"); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 22: - 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()); - JewelryNBT.addGem(item, new ItemStack(Items.ender_pearl)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Chest"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring can link"); - text.add("to any chest and"); - text.add("access its inventory."); - text.add("To link to a chest just"); - text.add("crouch and right click"); - text.add("on the one you want."); - text.add("Then right click again"); - text.add("to open that inventory."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 23: - text.add("This only works if you"); - text.add("are in range to the"); - text.add("chest. You can go"); - text.add("about 128 blocks"); - text.add("before it stops"); - text.add("working. After that"); - text.add("a message will be"); - text.add("displayed saying the"); - text.add("amount of blocks you"); - text.add("need to be closer in"); - text.add("order for it to work"); - text.add("again."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 24: - 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()); - JewelryNBT.addGem(item, new ItemStack(Blocks.obsidian)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "Obsidian"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Eye of Ender"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring is connected"); - text.add("to your ender chest."); - text.add("Just right click it"); - text.add("anywhere to open the"); - text.add("ender chest gui."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 25: - 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()); - JewelryNBT.addGem(item, new ItemStack(Items.nether_star)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Chest"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" This ring can store"); - text.add("any entity in it. To do"); - text.add("that right click an"); - text.add("to store it in the ring"); - text.add("(crouch and right click"); - text.add("if right clicking the"); - text.add("entity opens a GUI,"); - text.add("such as villagers)."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 26: - text.add("Right click again on the"); - text.add("ground to release the"); - text.add("entity in that spot."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 27: - if (del == 0) - { - values++; - jValues++; - } - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - if (jValues > JewelrycraftUtil.gem.size() - 1) jValues = 0; - - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - JewelryNBT.addGem(item, JewelrycraftUtil.gem.get(jValues).copy()); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "Any"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Bone Meal"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" While having it in"); - text.add("the inventory it will"); - text.add("hydrate any farmland"); - text.add("you step on. If you"); - text.add("right click with this"); - text.add("on a plant, it will"); - text.add("speed up the growth a"); - text.add("bit. Better keep right"); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 28: - text.add("clicking if you want to"); - text.add("see an actual effect."); - text.add(EnumChatFormatting.DARK_RED + "\u00a7nAltar Effect"); - text.add(" In the altar, the ring"); - text.add("has the ability to"); - text.add("hydrate any tilted land"); - text.add("and speed up the"); - text.add("growth of plants in a"); - text.add("3x3x3 area."); - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 29: - 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()); - JewelryNBT.addGem(item, new ItemStack(Items.ender_pearl)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "Ender Pearl"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Diamond Pick"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Any"); - text.add(" You can right click"); - text.add("any block (or crouch"); - text.add("right click) to store"); - text.add("that block inside it."); - text.add("Right click on the"); - text.add("ground to place it"); - text.add("there. It can also"); - text.add("create golems/withers."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - case 30: - JewelryNBT.addMetal(item, new ItemStack(ItemList.shadowIngot)); - JewelryNBT.addGem(item, new ItemStack(Items.nether_star)); - JewelryNBT.addModifiers(item, JewelrycraftUtil.addRandomModifiers()); - - text.add(EnumChatFormatting.DARK_GREEN + "Gem: " + EnumChatFormatting.BLACK + "Nether Star"); - text.add(EnumChatFormatting.DARK_GREEN + "Modifier: " + EnumChatFormatting.BLACK + "Diamond Pick"); - text.add(EnumChatFormatting.DARK_GREEN + "Ingot: " + EnumChatFormatting.BLACK + "Shadow Ingot"); - text.add(" Right clicking with"); - text.add("this on any block will"); - text.add("cause that block to"); - text.add("break instantly."); - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), item, text, 50f, 0, -10, false, 45, 0); - break; - default: - ; - } - } - - public int getMaxPages() - { - return 30; - } - - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - { - } - -} diff --git a/java/darkknight/jewelrycraft/container/Page.java b/java/darkknight/jewelrycraft/container/Page.java index 77a0fa2..69de204 100644 --- a/java/darkknight/jewelrycraft/container/Page.java +++ b/java/darkknight/jewelrycraft/container/Page.java @@ -1,20 +1,24 @@ package darkknight.jewelrycraft.container; import java.util.ArrayList; - -import org.lwjgl.opengl.GL11; +import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + import darkknight.jewelrycraft.client.GuiGuide; public class Page { - public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, ArrayList<String> text, ArrayList<ItemStack> items, int mouseX, int mouseY) + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, String text, ArrayList<ItemStack> items, int mouseX, int mouseY) { 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.get(0).getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items.get(0).getDisplayName()) / 2) - 10, y - 2, 0); GL11.glColor4f(1, 1, 1, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip.png")); @@ -27,7 +31,9 @@ public class Page if (items.size() > 1 && items.get(1) != null) { gui.renderItem(items.get(1), x + 8, y + 16 + 10, 30f); - if (x - gui.getLeft() >= x + 8) gui.drawHoverString(text, x, y); + List<String> list = new ArrayList<String>(); + list.add(text); + if (x - gui.getLeft() >= x + 8) gui.drawHoverString(list, x, y); name.add(items.get(1).getDisplayName()); if (mouseX >= x && mouseX <= x + 16 && mouseY >= y + 10 && mouseY <= y + 26) gui.drawHoverString(name, x - 8, y + 10); name.removeAll(name); @@ -57,12 +63,11 @@ public class Page name.removeAll(name); GL11.glDisable(GL11.GL_LIGHTING); } - for (int i = 0; i < text.size(); i++) - gui.getFont().drawString(text.get(i), x, y + 55 + i * 12, 0); + drawText(gui, text, x, y + 25); } else { - gui.drawTexturedModalRect(x, y + 10, 145, 0, 111, 54); + gui.drawTexturedModalRect(x, y + 12, 145, 0, 111, 54); gui.renderItem(items.get(0), x + 91, y + 28 + 10, 30f); if (items.size() > 1 && items.get(1) != null) { @@ -114,80 +119,103 @@ public class Page } if (items.size() > 7 && items.get(7) != null) { - gui.renderItem(items.get(7), x + 8, y + 57, 30f); + gui.renderItem(items.get(7), x + 8, y + 54, 30f); name.add(items.get(7).getDisplayName()); - if (mouseX >= x && mouseX <= x + 16 && mouseY >= y + 47 && mouseY <= y + 47 + 16) gui.drawHoverString(name, x + 8, y + 47); + if (mouseX >= x && mouseX <= x + 16 && mouseY >= y + 44 && mouseY <= y + 44 + 16) gui.drawHoverString(name, x + 8, y + 44); name.removeAll(name); GL11.glDisable(GL11.GL_LIGHTING); } if (items.size() > 8 && items.get(8) != null) { - gui.renderItem(items.get(8), x + 28, y + 57, 30f); + gui.renderItem(items.get(8), x + 28, y + 54, 30f); name.add(items.get(8).getDisplayName()); - if (mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 47 && mouseY <= y + 47 + 16) gui.drawHoverString(name, x + 28, y + 47); + if (mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 44 && mouseY <= y + 44 + 16) gui.drawHoverString(name, x + 28, y + 44); name.removeAll(name); GL11.glDisable(GL11.GL_LIGHTING); } if (items.size() > 9 && items.get(9) != null) { - gui.renderItem(items.get(9), x + 45, y + 57, 30f); + gui.renderItem(items.get(9), x + 45, y + 54, 30f); name.add(items.get(9).getDisplayName()); - if (mouseX >= x + 40 && mouseX <= x + 16 + 40 && mouseY >= y + 47 && mouseY <= y + 47 + 16) gui.drawHoverString(name, x + 45, y + 47); + if (mouseX >= x + 40 && mouseX <= x + 16 + 40 && mouseY >= y + 44 && mouseY <= y + 44 + 16) gui.drawHoverString(name, x + 45, y + 44); name.removeAll(name); GL11.glDisable(GL11.GL_LIGHTING); } - for (int i = 0; i < text.size(); i++) - gui.getFont().drawString(text.get(i), x, y + 62 + i * 12, 0); + 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, ArrayList<String> text, ArrayList<ItemStack> items, int mouseX, int mouseY) + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, String text, ArrayList<ItemStack> items, int mouseX, int mouseY) { ArrayList<String> name = new ArrayList<String>(); - gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items.get(1).getDisplayName(), x + Math.abs(70 - gui.getFont().getStringWidth(items.get(0).getDisplayName()) / 2), y + 2, 0); + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + items.get(1).getDisplayName(), x + 30 - items.get(0).getDisplayName().length() / 2, y + 2, 0); GL11.glColor4f(1, 1, 1, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation("jewelrycraft", "textures/gui/guidePageFlip" + ".png")); - gui.drawTexturedModalRect(x, y + 10, 145, 100, 111, 46); + 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, 56); - gui.renderItem(items.get(0), x + 13, y + 20 + 10, 50f); + gui.renderItem(items.get(0), x + 13, y + 20 + 10, 35f); name.add(items.get(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.get(1), x + 77, y + 28 + 10, 50f); - - for (int i = 0; i < text.size(); i++) - gui.getFont().drawString(text.get(i), x, y + 60 + i * 12, 0); + gui.renderItem(items.get(1), x + 77, y + 28 + 10, 35f); + 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, ArrayList<String> text, float size) + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, String text, float size) { 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 + 2, 0); GL11.glColor4f(1, 1, 1, 1); gui.renderItem(item, x + 13, y + 18, size); - for (int i = 0; i < text.size(); i++) - gui.getFont().drawString(text.get(i), x, y + 30 + i * 12, 0); + drawText(gui, text, x, y); + GL11.glDisable(GL11.GL_BLEND); } - public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, ArrayList<String> text, float size, int txtX, int txtY, boolean showName, int imgX, int 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) { y += 5; + GL11.glEnable(GL11.GL_BLEND); + 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); - for (int i = 0; i < text.size(); i++) - gui.getFont().drawString(text.get(i), x + txtX, y + 30 + txtY + i * 12, 0); + drawText(gui, text, x + txtX, y + txtY); + GL11.glDisable(GL11.GL_BLEND); } - public static void addTextPage(GuiGuide gui, int x, int y, ArrayList<String> text) + public static void addTextPage(GuiGuide gui, int x, int y, String text) { y -= 25; - for (int i = 0; i < text.size(); i++) - gui.getFont().drawString(text.get(i), x, y + 30 + i * 12, 0); + 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 = ""; + ArrayList<String> textLines = new ArrayList<String>(); + for (int i = 0; i < s.length; i++) + { + if ((displayText + s[i] + " ").length() <= 24) displayText += s[i] + " "; + else + { + textLines.add(displayText.trim()); + displayText = s[i] + " "; + } + } + textLines.add(displayText.trim()); + for (int i = 0; i < textLines.size(); i++) + gui.getFont().drawString(textLines.get(i), x, y + 30 + i * 12, 0); + } } |
