From 256653501365eb4f95d3dddbcdfdc23a2a9594d5 Mon Sep 17 00:00:00 2001 From: OnyxDarkKnight Date: Tue, 15 Apr 2014 23:05:32 +0300 Subject: Moved source files --- .../jewelrycraft/container/ContainerGuide.java | 18 + .../jewelrycraft/container/ContainerRingChest.java | 71 +++ .../jewelrycraft/container/GuiHandler.java | 40 ++ .../jewelrycraft/container/GuiRectangle.java | 66 +++ .../darkknight/jewelrycraft/container/GuiTab.java | 37 ++ .../jewelrycraft/container/GuiTabBlocks.java | 295 +++++++++++ .../jewelrycraft/container/GuiTabItems.java | 278 ++++++++++ .../container/GuiTabJewelsAndModifiers.java | 87 +++ .../jewelrycraft/container/GuiTabNecklaces.java | 380 +++++++++++++ .../jewelrycraft/container/GuiTabRings.java | 587 +++++++++++++++++++++ .../darkknight/jewelrycraft/container/Page.java | 172 ++++++ .../jewelrycraft/container/SlotRingChest.java | 39 ++ 12 files changed, 2070 insertions(+) create mode 100644 src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/GuiHandler.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/GuiTab.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/GuiTabNecklaces.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/GuiTabRings.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/Page.java create mode 100644 src/main/java/darkknight/jewelrycraft/container/SlotRingChest.java (limited to 'src/main/java/darkknight/jewelrycraft/container') 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..ef05cc4 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/ContainerGuide.java @@ -0,0 +1,18 @@ +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() { + } + + @Override + public boolean canInteractWith(EntityPlayer entityplayer) { + return true; + } +} \ No newline at end of file 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..2728941 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/ContainerRingChest.java @@ -0,0 +1,71 @@ +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; + + 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)); + } + @Override + public boolean canInteractWith(EntityPlayer player) + { + return true; + } + + @Override + public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) + { + ItemStack itemstack = null; + Slot slot = (Slot)this.inventorySlots.get(par2); + + if (slot != null && slot.getHasStack()) + { + ItemStack itemstack1 = slot.getStack(); + itemstack = itemstack1.copy(); + + if (par2 < 27) + { + if (!this.mergeItemStack(itemstack1, 27, this.inventorySlots.size(), true)) + { + return null; + } + } + else if (!this.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..3efe71c --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/GuiHandler.java @@ -0,0 +1,40 @@ +package darkknight.jewelrycraft.container; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntityChest; +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.GuiRingChest; + +public class GuiHandler implements IGuiHandler +{ + public GuiHandler() + { + NetworkRegistry.INSTANCE.registerGuiHandler(JewelrycraftMod.instance, this); + } + + @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(); + default: return null; + } + } + + @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)); + case 1: return new GuiGuide((ContainerGuide) getServerGuiElement(ID, player, world, x, y, z), world); + 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..76dee04 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/GuiRectangle.java @@ -0,0 +1,66 @@ +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; + + public GuiRectangle(int x, int y, int w, int h) + { + this.x = x; + this.y = y; + this.w = w; + this.h = h; + } + + 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; + } + + public void setX(int x) + { + this.x = x; + } + + public void setY(int y) + { + this.y = y; + } + + + public void draw(GuiGuide gui, int srcX, int srcY) + { + gui.drawTexturedModalRect(gui.getLeft() + x, gui.getTop() + y, srcX, srcY, w, h); + } + + + 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); + } + + 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()); + } + } + + 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..c092ba6 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/GuiTab.java @@ -0,0 +1,37 @@ +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; + + public GuiTab(String name, int id) + { + super(-62, 10 + 19*id, 19, 18); + this.name = name; + values = 0; + del = 0; + } + + public String getName() + { + return name; + } + + public abstract void drawBackground(GuiGuide gui, int x, int y, int page); + public abstract void drawForeground(GuiGuide gui, int x, int y, int page); + public void mouseClick(GuiGuide gui, int x, int y, int button) {} + public void mouseMoveClick(GuiGuide gui, int x, int y, int button, long timeSinceClicked) {} + public void mouseReleased(GuiGuide gui, int x, int y, int button) {} + + 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..9627cf1 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabBlocks.java @@ -0,0 +1,295 @@ +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 GuiTabBlocks extends GuiTab +{ + + public GuiTabBlocks(int id) + { + super("Blocks", id); + } + + public ItemStack getIcon() + { + return new ItemStack(BlockList.jewelAltar); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + ArrayList text = new ArrayList(); + ArrayList items = new ArrayList(); + 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."); + 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"); + 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."); + 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"); + items.add(new ItemStack(BlockList.smelter)); + items.add(new ItemStack(Blocks.cobblestone)); + items.add(new ItemStack(Items.bucket)); + items.add(new ItemStack(Blocks.cobblestone)); + items.add(new ItemStack(Blocks.cobblestone)); + items.add(null); + items.add(new ItemStack(Blocks.cobblestone)); + items.add(new ItemStack(Blocks.cobblestone)); + items.add(new ItemStack(Items.lava_bucket)); + items.add(new ItemStack(Blocks.cobblestone)); + 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."); + 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."); + 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"); + + items.add(new ItemStack(BlockList.molder)); + items.add(new ItemStack(Blocks.cobblestone)); + items.add(null); + items.add(new ItemStack(Blocks.cobblestone)); + for(int i = 1; i <= 3; i++) items.add(new ItemStack(Blocks.cobblestone)); + 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."); + 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!"); + 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"); + if(del == 0) values++; + del++; + if(del >= 300) del = 0; + if(values >= 4) values = 0; + items.add(new ItemStack(BlockList.jewelCraftingTable)); + for(int i = 1; i <= 3; i++)items.add(new ItemStack(Blocks.planks, 1, values)); + items.add(new ItemStack(Blocks.cobblestone)); + items.add(null); + items.add(new ItemStack(Blocks.cobblestone)); + items.add(new ItemStack(Blocks.cobblestone)); + items.add(null); + items.add(new ItemStack(Blocks.cobblestone)); + 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"); + 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."); + 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"); + items.add(new ItemStack(BlockList.jewelAltar)); + items.add(new ItemStack(Blocks.end_stone)); + items.add(new ItemStack(Blocks.wool, 1, 5)); + items.add(new ItemStack(Blocks.end_stone)); + items.add(new ItemStack(Blocks.nether_brick)); + items.add(new ItemStack(Blocks.wool, 1, 5)); + items.add(new ItemStack(Blocks.nether_brick)); + items.add(new ItemStack(Blocks.nether_brick)); + items.add(new ItemStack(Blocks.nether_brick)); + items.add(new ItemStack(Blocks.nether_brick)); + 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."); + 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"); + items.add(new ItemStack(BlockList.displayer)); + items.add(null); + items.add(new ItemStack(Items.iron_ingot)); + items.add(null); + items.add(new ItemStack(Items.iron_ingot)); + items.add(new ItemStack(Items.iron_ingot)); + items.add(new ItemStack(Items.iron_ingot)); + items.add(new ItemStack(Blocks.emerald_block)); + items.add(new ItemStack(Blocks.emerald_block)); + items.add(new ItemStack(Blocks.emerald_block)); + 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"); + 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."); + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + default:; + } + } + + public int getMaxPages() + { + return 17; + } + + @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..a4ea44e --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabItems.java @@ -0,0 +1,278 @@ +package darkknight.jewelrycraft.container; + +import java.awt.Desktop; +import java.net.URL; +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 GuiTabItems extends GuiTab +{ + + public GuiTabItems(int id) + { + super("Items", id); + } + + public ItemStack getIcon() + { + return new ItemStack(ItemList.thiefGloves); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + ArrayList text = new ArrayList(); + ArrayList items = new ArrayList(); + 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."); + 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"); + items.add(new ItemStack(ItemList.thiefGloves)); + items.add(new ItemStack(ItemList.shadowIngot)); + items.add(null); + items.add(new ItemStack(ItemList.shadowIngot)); + items.add(new ItemStack(Blocks.wool, 1, 15)); + items.add(new ItemStack(ItemList.shadowIngot)); + items.add(new ItemStack(Blocks.wool, 1, 15)); + items.add(new ItemStack(Blocks.wool, 1, 15)); + items.add(new ItemStack(ItemList.shadowIngot)); + items.add(new ItemStack(Blocks.wool, 1, 15)); + 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"); + 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."); + 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."); + items.add(new ItemStack(ItemList.clayMolds, 1, 1)); + 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(new ItemStack(Items.clay_ball)); + items.add(null); + items.add(new ItemStack(Items.clay_ball)); + 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."); + items.add(new ItemStack(ItemList.clayMolds, 1, 2)); + 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(null); + items.add(new ItemStack(Items.clay_ball)); + items.add(null); + items.add(new ItemStack(Items.clay_ball)); + 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)); + 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."); + items.add(new ItemStack(ItemList.crystal, 1, 15)); + items.add(null); + items.add(new ItemStack(Blocks.glass)); + items.add(null); + items.add(new ItemStack(Blocks.glass)); + items.add(null); + items.add(new ItemStack(Blocks.glass)); + items.add(null); + items.add(new ItemStack(Blocks.glass)); + items.add(null); + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, items, x, y); + break; + case 12: + if(del == 0) values++; + del++; + if(del >= 300) del = 0; + if(values >= 15) values = 0; + items.add(new ItemStack(ItemList.crystal, 1, values)); + items.add(new ItemStack(Items.dye, 1, values)); + items.add(new ItemStack(ItemList.crystal, 1, 15)); + Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, items, x, y); + items.removeAll(items); + items.add(new ItemStack(ItemList.crystal, 1, 15)); + items.add(new ItemStack(Items.dye, 1, 15)); + 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: + 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"); + 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: + 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)"); + Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); + break; + default:; + } + } + + public int getMaxPages() + { + return 13; + } + + 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) + { + try + { + Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/topic/2210959-164smp-ssp-jewelrycraft-version-12/").toURI()); + } + catch (Exception e) {} + } + } + + @Override + public void drawForeground(GuiGuide gui, int x, int y, int page) + { + } + +} diff --git a/src/main/java/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java new file mode 100644 index 0000000..1085f7d --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabJewelsAndModifiers.java @@ -0,0 +1,87 @@ +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 GuiTabJewelsAndModifiers extends GuiTab +{ + public GuiTabJewelsAndModifiers(int id) + { + super("Jewels and modifiers", id); + } + + public ItemStack getIcon() + { + return new ItemStack(Items.emerald); + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + int xPos = (page%2==0)?107:-35; + switch(page) + { + case 1: + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Jewels", gui.getLeft() + xPos + 40, gui.getTop(), 0); + for(int i = 0; i <= 8; i++){ + gui.renderItem(JewelrycraftUtil.jewel.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); + gui.getFont().drawString(JewelrycraftUtil.jewel.get(i).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); + } + break; + case 2: + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Jewels", gui.getLeft() + xPos + 40, gui.getTop(), 0); + for(int i = 0; i <= 8; i++){ + gui.renderItem(JewelrycraftUtil.jewel.get(i+9), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); + gui.getFont().drawString(JewelrycraftUtil.jewel.get(i+9).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); + } + break; + case 3: + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Jewels", gui.getLeft() + xPos + 40, gui.getTop(), 0); + for(int i = 0; i <= 8; i++) + if(i+18 < JewelrycraftUtil.jewel.size()){ + gui.renderItem(JewelrycraftUtil.jewel.get(i+18), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); + gui.getFont().drawString(JewelrycraftUtil.jewel.get(i+18).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + break; + case 4: + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Modifiers", gui.getLeft() + xPos + 40, gui.getTop(), 0); + for(int i = 0; i <= 8; i++){ + if(i < JewelrycraftUtil.modifiers.size()) + { + gui.renderItem(JewelrycraftUtil.modifiers.get(i), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); + gui.getFont().drawString(JewelrycraftUtil.modifiers.get(i).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); + } + } + break; + case 5: + gui.getFont().drawString(EnumChatFormatting.DARK_BLUE + "\u00a7n" + "Modifiers", gui.getLeft() + xPos + 40, gui.getTop(), 0); + for(int i = 0; i <= 8; i++){ + if(i+9 < JewelrycraftUtil.modifiers.size()){ + gui.renderItem(JewelrycraftUtil.modifiers.get(i + 9), gui.getLeft() + xPos + 10, gui.getTop() + 22 + 16*i, 30f); + gui.getFont().drawString(JewelrycraftUtil.modifiers.get(i + 9).getDisplayName(), gui.getLeft() + xPos + 20, gui.getTop() + 12 + 16*i, 0); + GL11.glDisable(GL11.GL_LIGHTING); + } + } + break; + default:; + } + } + + 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/GuiTabNecklaces.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabNecklaces.java new file mode 100644 index 0000000..4271928 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabNecklaces.java @@ -0,0 +1,380 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +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.addJewel(it, new ItemStack(Blocks.redstone_block)); + return it; + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + ArrayList text = new ArrayList(); + ArrayList jewels = new ArrayList(); + 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)); + JewelryNBT.addJewel(item, new ItemStack(Items.ender_pearl)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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)); + JewelryNBT.addJewel(item, new ItemStack(Items.ender_pearl)); + JewelryNBT.addModifier(item, new ItemStack(Items.bed)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.blaze_powder)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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 jewel"); + 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 jewel,"); + 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.sugar)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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 jewel"); + 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("jewel, 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.iron_pickaxe)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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 jewel"); + 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("jewel, 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.feather)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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 jewel"); + 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("jewel, 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.potionitem, 1, 8270)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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 jewel"); + 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("jewel, 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.dye, 1, 15)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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 jewel"); + 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.addJewel(item, new ItemStack(Items.nether_star)); + JewelryNBT.addModifier(item, new ItemStack(Items.diamond_pickaxe)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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/src/main/java/darkknight/jewelrycraft/container/GuiTabRings.java b/src/main/java/darkknight/jewelrycraft/container/GuiTabRings.java new file mode 100644 index 0000000..646a78b --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/GuiTabRings.java @@ -0,0 +1,587 @@ +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.addJewel(it, new ItemStack(Items.ender_pearl)); + return it; + } + + @Override + public void drawBackground(GuiGuide gui, int x, int y, int page) + { + ArrayList text = new ArrayList(); + ArrayList jewels = new ArrayList(); + 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)); + JewelryNBT.addJewel(item, new ItemStack(Items.ender_pearl)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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)); + JewelryNBT.addJewel(item, new ItemStack(Items.ender_pearl)); + JewelryNBT.addModifier(item, new ItemStack(Items.bed)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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 jewel,"); + 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.blaze_powder)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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("jewel 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("jewel, 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.sugar)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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("jewel 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 jewel,"); + 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.iron_pickaxe)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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("jewel 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 jewel,"); + 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.feather)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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 jewel"); + text.add("you used, you get"); + text.add(EnumChatFormatting.DARK_RED + "Jump Boost" + EnumChatFormatting.BLACK + " I if you"); + text.add("haven't got any jewel,"); + 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: + jewels.add(null); + jewels.add(new ItemStack(Items.diamond)); + jewels.add(new ItemStack(Items.emerald)); + jewels.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 > jewels.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, jewels.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.potionitem, 1, 8270)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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 jewel"); + text.add("you used, you get"); + text.add(EnumChatFormatting.DARK_RED + "Invisibility" + EnumChatFormatting.BLACK + " I if you"); + text.add("haven't got any jewel,"); + 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)); + JewelryNBT.addJewel(item, new ItemStack(Items.nether_star)); + JewelryNBT.addModifier(item, new ItemStack(Items.book)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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)); + JewelryNBT.addJewel(item, new ItemStack(Items.ender_pearl)); + JewelryNBT.addModifier(item, new ItemStack(Blocks.chest)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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)); + JewelryNBT.addJewel(item, new ItemStack(Blocks.obsidian)); + JewelryNBT.addModifier(item, new ItemStack(Items.ender_eye)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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)); + JewelryNBT.addJewel(item, new ItemStack(Items.nether_star)); + JewelryNBT.addModifier(item, new ItemStack(Blocks.chest)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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.jewel.size() - 1) jValues = 0; + + JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values)); + JewelryNBT.addJewel(item, JewelrycraftUtil.jewel.get(jValues)); + JewelryNBT.addModifier(item, new ItemStack(Items.dye, 1, 15)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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)); + JewelryNBT.addJewel(item, new ItemStack(Items.ender_pearl)); + JewelryNBT.addModifier(item, new ItemStack(Items.diamond_pickaxe)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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.addJewel(item, new ItemStack(Items.nether_star)); + JewelryNBT.addModifier(item, new ItemStack(Items.diamond_pickaxe)); + + text.add(EnumChatFormatting.DARK_GREEN + "Jewel: " + 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/src/main/java/darkknight/jewelrycraft/container/Page.java b/src/main/java/darkknight/jewelrycraft/container/Page.java new file mode 100644 index 0000000..da12663 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/Page.java @@ -0,0 +1,172 @@ +package darkknight.jewelrycraft.container; + +import java.util.ArrayList; + +import org.lwjgl.opengl.GL11; + +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import darkknight.jewelrycraft.client.GuiGuide; + +public class Page +{ + public static void addCraftingRecipeTextPage(GuiGuide gui, int x, int y, boolean isSmall, ArrayList text, ArrayList items, int mouseX, int mouseY) + { + y+=5; + 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")); + ArrayList name = new ArrayList(); + if(isSmall){ + gui.drawTexturedModalRect(x, y + 10, 145, 54, 111, 46); + gui.renderItem(items.get(0), x + 89, y + 22 + 10, 30f); +// gui.drawRect(x, y + 10, x + 111, y + 46, 325325); + 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); + 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); + GL11.glDisable(GL11.GL_LIGHTING); + } + if(items.size() > 2 && items.get(2) != null){ + gui.renderItem(items.get(2), x + 30, y + 16 + 10, 30f); + name.add(items.get(2).getDisplayName()); + if(mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 10 && mouseY <= y + 26) gui.drawHoverString(name, x + 15, y + 10); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + if(items.size() > 3 && items.get(3) != null){ + gui.renderItem(items.get(3), x + 8, y + 40 + 10, 30f); + name.add(items.get(3).getDisplayName()); + if(mouseX >= x && mouseX <= x + 16 && mouseY >= y + 36 && mouseY <= y + 36 + 16) gui.drawHoverString(name, x - 8, y + 35); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + if(items.size() > 4 && items.get(4) != null){ + gui.renderItem(items.get(4), x + 30, y + 40 + 10, 30f); + name.add(items.get(4).getDisplayName()); + if(mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 36 && mouseY <= y + 36 + 16) gui.drawHoverString(name, x + 15, y + 35); + 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); + } + else{ + gui.drawTexturedModalRect(x, y + 10, 145, 0, 111, 54); + gui.renderItem(items.get(0), x + 91, y + 28 + 10, 30f); + if(items.size() > 1 && items.get(1) != null){ + gui.renderItem(items.get(1), x + 8, y + 20, 30f); + 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); + GL11.glDisable(GL11.GL_LIGHTING); + } + if(items.size() > 2 && items.get(2) != null){ + gui.renderItem(items.get(2), x + 28, y + 20, 30f); + name.add(items.get(2).getDisplayName()); + if(mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 10 && mouseY <= y + 26) gui.drawHoverString(name, x + 28, y + 10); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + if(items.size() > 3 && items.get(3) != null){ + gui.renderItem(items.get(3), x + 45, y + 20, 30f); + name.add(items.get(3).getDisplayName()); + if(mouseX >= x + 40 && mouseX <= x + 16 + 40 && mouseY >= y + 10 && mouseY <= y + 26) gui.drawHoverString(name, x + 45, y + 10); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + if(items.size() > 4 && items.get(4) != null){ + gui.renderItem(items.get(4), x + 8, y + 37, 30f); + name.add(items.get(4).getDisplayName()); + if(mouseX >= x && mouseX <= x + 16 && mouseY >= y + 27 && mouseY <= y + 27 + 16) gui.drawHoverString(name, x + 8, y + 27); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + if(items.size() > 5 && items.get(5) != null){ + gui.renderItem(items.get(5), x + 28, y + 37, 30f); + name.add(items.get(5).getDisplayName()); + if(mouseX >= x + 20 && mouseX <= x + 16 + 20 && mouseY >= y + 27 && mouseY <= y + 27 + 16) gui.drawHoverString(name, x + 28, y + 27); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + if(items.size() > 6 && items.get(6) != null){ + gui.renderItem(items.get(6), x + 45, y + 37, 30f); + name.add(items.get(6).getDisplayName()); + if(mouseX >= x + 40 && mouseX <= x + 16 + 40 && mouseY >= y + 27 && mouseY <= y + 27 + 16) gui.drawHoverString(name, x + 45, y + 27); + name.removeAll(name); + GL11.glDisable(GL11.GL_LIGHTING); + } + if(items.size() > 7 && items.get(7) != null){ + gui.renderItem(items.get(7), x + 8, y + 57, 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); + 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); + 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); + 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); + 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); + 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); + GL11.glColor4f(1, 1, 1, 1); + } + } + + public static void addSmeltingRecipeTextPage(GuiGuide gui, int x, int y, ArrayList text, ArrayList items, int mouseX, int mouseY) + { + ArrayList name = new ArrayList(); + 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); + 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); + + gui.renderItem(items.get(0), x + 13, y + 20 + 10, 50f); + 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); + GL11.glColor4f(1, 1, 1, 1); + } + + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, ArrayList text, float size) + { + y+=5; + 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); + } + + public static void addImageTextPage(GuiGuide gui, int x, int y, ItemStack item, ArrayList text, float size, int txtX, int txtY, boolean showName, int imgX, int imgY) + { + y+=5; + 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); + } + + public static void addTextPage(GuiGuide gui, int x, int y, ArrayList text) + { + y-=25; + for(int i = 0; i < text.size(); i++) gui.getFont().drawString(text.get(i), x, y + 30 + i*12, 0); + GL11.glColor4f(1, 1, 1, 1); + } +} 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..576dee7 --- /dev/null +++ b/src/main/java/darkknight/jewelrycraft/container/SlotRingChest.java @@ -0,0 +1,39 @@ +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; + + public SlotRingChest(IInventory tile, int slotID, int x, int y, boolean locked) + { + super(tile, slotID, x, y); + this.locked = locked; + } + + @Override + public boolean isItemValid(ItemStack stack) + { + return !locked; + } + + @Override + public ItemStack decrStackSize(int amount) + { + if (!locked) + { + return super.decrStackSize(amount); + } + return null; + } + + @Override + public boolean canTakeStack(EntityPlayer player) + { + return !locked; + } +} -- cgit v1.2.3