diff options
| author | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-07-12 10:32:00 +0100 |
|---|---|---|
| committer | OnyxDarkKnight <sor1n.iliutza16@gmail.com> | 2015-07-12 10:32:00 +0100 |
| commit | 921f1ba6f30e66c80c803618ebff496778e78970 (patch) | |
| tree | e838c0805f45936a1a4a5c0a1615dd66e2c7dd4e /src | |
| parent | 48f7bfaa6bf4753020ada20ee060a7f0027b185b (diff) | |
Fixed a few recipes that were wrong in the book (the book does not lie)
Diffstat (limited to 'src')
4 files changed, 503 insertions, 503 deletions
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java index c6450d3..2712821 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabBlocks.java @@ -1,172 +1,172 @@ -package darkknight.jewelrycraft.client.gui; - -import java.awt.Desktop; -import java.net.URL; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.client.Page; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.Variables; - -public class GuiTabBlocks extends GuiTab -{ - - /** - * @param id - */ - public GuiTabBlocks(int id) - { - super(id); - } - - public String getName() - { - return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.blocks"); - } - - /** - * @return - */ - @Override - public ItemStack getIcon() - { - return new ItemStack(BlockList.smelter); - } - - /** - * @param gui - * @param x - * @param y - * @param page - */ - @Override - public void drawBackground(GuiGuide gui, int x, int y, int page) - { - String text = ""; - int xPos = page % 2 == 0 ? 107 : -35; - switch(page) - { - case 1: - text = "This ore is extremely rare and can be found only between Y-level 5 and 8. It can only be mined using a diamond pickaxe."; - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.shadowOre), text, 90f, true); - break; - case 2: - text = "The Shadow Block is crafted using 9 shadow ingots. Magicians believed it held the ability to merge with the shadows. It becomes more transparent as it"; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowBlock), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot)); - break; - case 3: - text = "gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in."; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 4: - text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to"; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.smelter), new ItemStack(Blocks.cobblestone), new ItemStack(Items.bucket), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone)); - break; - case 5: - text = "melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do is right click on it with any ore or ingot. It can melt multimple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items"; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 6: - text = "added. If right clicked when done smelting, it will say what the block contains."; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 7: - text = "The molder is a key piece in creating jewellery. You need to pour the molten metal out of the smelter somewhere. That somewhere is the"; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.molder), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone)); - break; - case 8: - text = "molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you"; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 9: - text = "have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!"; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 10: - text = "This table allows you to add a gem to a piece of jewellery. Right click the block while holding a jewellery to add it in. Then do the same with a gem (you"; - if (del == 0) values++; - del++; - if (del >= 300) del = 0; - if (values >= 4) values = 0; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.jewelCraftingTable), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone)); - break; - case 11: - text = "can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a"; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 12: - text = "jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem."; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 13: - text = "The Storage Displayer, as the name suggests, can store a large amount (Up to: " + Integer.MAX_VALUE + ") of a single item/block placed in it. It will"; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.displayer), null, new ItemStack(Items.iron_ingot), null, new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block)); - break; - case 14: - text = "display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside."; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 15: - text = "If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to"; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 16: - text = "get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory."; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 17: - text = "This mysterious shaped block is used in the ritual. The acient ones claimed it had the power to travel through worlds. They would use these to offer"; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.handPedestal), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), null, new ItemStack(Blocks.stonebrick), null, new ItemStack(Blocks.stone_slab, 1, 5), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stone_slab, 1, 5)); - break; - case 18: - text = "sacrifices to 'The Dark One' in exchange for unimaginable powers."; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 19: - text = "The Cursed Eye is an ancient artifact also known as 'The Dark One's Eye'. It is part of the sacrifice ritual the ancient ones talk about. Be careful"; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowEye), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Items.ender_eye), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick)); - break; - case 20: - text = "though, for He sees everything. To see how to create the ritual look in the Ritual tab. One you created the ritual, simple place a piece of jewelery in the middle pedestal and your modifiers of choice in the other ones (you don't need to put an item in every single pedestal). After"; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 21: - text = "you do that simply right click the eye to activate the ritual. Be careful not to leave the premise or you'll die! When the ritual is done, Shift+Right Click on the central hand pedestal to retrieve your newly modified item!"; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 22: - if (del == 0) values++; - del++; - if (del >= 300) del = 0; - if (values >= 15) values = 0; - text = "Crystals don't do much as of yet. They spawn naturally in caves and come in all 16 colors."; - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.crystal, 1, values), text, 40f, true); - break; - default: - ; - } - } - - /** - * @return - */ - @Override - public int getMaxPages() - { - return 22; - } - - /** - * @param gui - * @param x - * @param y - * @param page - */ - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - {} -} +package darkknight.jewelrycraft.client.gui;
+
+import java.awt.Desktop;
+import java.net.URL;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.Page;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.Variables;
+
+public class GuiTabBlocks extends GuiTab
+{
+
+ /**
+ * @param id
+ */
+ public GuiTabBlocks(int id)
+ {
+ super(id);
+ }
+
+ public String getName()
+ {
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.blocks");
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(BlockList.smelter);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ String text = "";
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch(page)
+ {
+ case 1:
+ text = "This ore is extremely rare and can be found only between Y-level 5 and 8. It can only be mined using a diamond pickaxe.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.shadowOre), text, 90f, true);
+ break;
+ case 2:
+ text = "The Shadow Block is crafted using 9 shadow ingots. Magicians believed it held the ability to merge with the shadows. It becomes more transparent as it";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowBlock), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot), new ItemStack(ItemList.shadowIngot));
+ break;
+ case 3:
+ text = "gets darker. If a comparator is attached to it, the output strength will be equal to the value of darkness it is in.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 4:
+ text = "The smelter is one of the first blocks needed to get started with Jewelrycraft. Requiring just some cobble and a couple buckets. It is required in order to";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.smelter), new ItemStack(Blocks.cobblestone), new ItemStack(Items.bucket), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Items.lava_bucket), new ItemStack(Blocks.cobblestone));
+ break;
+ case 5:
+ text = "melt ingots or even ores which can be made into rings, necklaces, bracelets or earrings. To use the block all you need to do is right click on it with any ore or ingot. It can melt multimple ingots/ores at a time. Crouch (default: Shift) + Right Click will remove all items";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 6:
+ text = "added. If right clicked when done smelting, it will say what the block contains.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 7:
+ text = "The molder is a key piece in creating jewellery. You need to pour the molten metal out of the smelter somewhere. That somewhere is the";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.molder), new ItemStack(Blocks.cobblestone), null, new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.cobblestone));
+ break;
+ case 8:
+ text = "molder. But before pouring the molten metal in it, you must first add a mold. You can do that by simply right clicking the block with the mold of your choice. If you want to get the mold out, simply crouch and Right Click it with an empty hand. Once you";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 9:
+ text = "have a mold inside, left click on the smelter and wait for the metal to cool down. When it's done, left click on the molder to get the jewellery. Be aware that this block must be placed directly in front of the smelter, otherwise it won't work!";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 10:
+ text = "This table allows you to add a gem to a piece of jewellery. Right click the block while holding a jewellery to add it in. Then do the same with a gem (you";
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values >= 4) values = 0;
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.jewelCraftingTable), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.planks, 1, values), new ItemStack(Blocks.stone), null, new ItemStack(Blocks.stone), new ItemStack(Blocks.stone), null, new ItemStack(Blocks.stone));
+ break;
+ case 11:
+ text = "can find a list with all possible gems in this guide). Crouch + Right Click to retreive placed items. Left Click the block to see the progress the crafting has made. Once the crafting is done, Left Click the block to get the item. You are able to recraft a";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 12:
+ text = "jewellery by readding the modified version to this block and adding a different gem to it. Once the crafting is done, the current gem will be replaced by the new one. There is also a 50% chance that you will get back the old gem.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 13:
+ text = "The Storage Displayer, as the name suggests, can store a large amount (Up to: " + Integer.MAX_VALUE + ") of a single item/block placed in it. It will";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.displayer), null, new ItemStack(Items.iron_ingot), null, new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Items.iron_ingot), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block), new ItemStack(Blocks.emerald_block));
+ break;
+ case 14:
+ text = "display all possible infromation about the object in it, such as the name, durability, enchantments etc. To store something in it simply right click with that object on it and the whole amount of items or blocks you are holding will be immediately stored inside.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 15:
+ text = "If a displayer already contains an item and you have that in your inventory, you can simply hold right click on it with an empty hand to add all of your items of that type from your inventory. To retrieve a single item just left click the block. If you wish to";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 16:
+ text = "get a whole stack, Crouch + Left Click on it. In creative mode you can simply hold Right Click on a displayer containing an object and it will add 64 of it with every right click, without it being in your inventory.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 17:
+ text = "This mysterious shaped block is used in the ritual. The acient ones claimed it had the power to travel through worlds. They would use these to offer";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.handPedestal), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), new ItemStack(Blocks.cobblestone_wall), null, new ItemStack(Blocks.stonebrick), null, new ItemStack(Blocks.stone_slab, 1, 5), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stone_slab, 1, 5));
+ break;
+ case 18:
+ text = "sacrifices to 'The Dark One' in exchange for unimaginable powers.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 19:
+ text = "The Cursed Eye is an ancient artifact also known as 'The Dark One's Eye'. It is part of the sacrifice ritual the ancient ones talk about. Be careful";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(BlockList.shadowEye), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Items.ender_eye), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stained_hardened_clay, 1, 15), new ItemStack(Blocks.stonebrick));
+ break;
+ case 20:
+ text = "though, for He sees everything. To see how to create the ritual look in the Ritual tab. One you created the ritual, simple place a piece of jewelery in the middle pedestal and your modifiers of choice in the other ones (you don't need to put an item in every single pedestal). After";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 21:
+ text = "you do that simply right click the eye to activate the ritual. Be careful not to leave the premise or you'll die! When the ritual is done, Shift+Right Click on the central hand pedestal to retrieve your newly modified item!";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 22:
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values >= 15) values = 0;
+ text = "Crystals don't do much as of yet. They spawn naturally in caves and come in all 16 colors.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop(), new ItemStack(BlockList.crystal, 1, values), text, 40f, true);
+ break;
+ default:
+ ;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return 22;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java index 495b1ad..de77a73 100644 --- a/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java +++ b/src/main/java/darkknight/jewelrycraft/client/gui/GuiTabItems.java @@ -1,165 +1,165 @@ -package darkknight.jewelrycraft.client.gui; - -import java.awt.Desktop; -import java.net.URL; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import darkknight.jewelrycraft.block.BlockList; -import darkknight.jewelrycraft.client.Page; -import darkknight.jewelrycraft.item.ItemList; -import darkknight.jewelrycraft.util.JewelryNBT; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.Variables; - -public class GuiTabItems extends GuiTab -{ - - /** - * @param id - */ - public GuiTabItems(int id) - { - super(id); - } - - public String getName() - { - return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.items"); - } - - /** - * @return - */ - @Override - public ItemStack getIcon() - { - return new ItemStack(ItemList.thiefGloves); - } - - /** - * @param gui - * @param x - * @param y - * @param page - */ - @Override - public void drawBackground(GuiGuide gui, int x, int y, int page) - { - String text = ""; - int xPos = page % 2 == 0 ? 107 : -35; - switch(page) - { - case 1: - text = "Shadow ingots are obtained by smelting shadow ore. They are used in a few recipes and an important key for making some jewelry work."; - Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true, new ItemStack(BlockList.shadowOre), new ItemStack(ItemList.shadowIngot)); - break; - case 2: - text = "These gloves give you the chance to steal the trades those pesky Testificates have to offer. To use these simply open their gui at least once, then Crouch and"; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.thiefGloves), new ItemStack(ItemList.shadowIngot), null, new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15)); - break; - case 3: - text = "right click on the them to hopefully steal the trades. If you traded with him before, then you have a chance of getting the traded emeralds back as well. This has a maximum of 10 uses before it breaks."; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 4: - text = "In order to get the ingot back from the smelter you need a mold for it. However, this mold can't be used. It is too soft. It needs to be hardened in order for it to be used."; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 0), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball)); - break; - case 5: - text = "To create a ring you need a mold for it. However, this one is too soft to be used. It needs to be hardened in order for it to be used."; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 1), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null); - break; - case 6: - text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used."; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 2), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null); - break; - case 7: - text = "To create a bracelet you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used."; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 3), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball)); - break; - case 8: - text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used."; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 4), null, null, null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, null, null); - break; - case 9: - if (del == 0) values++; - del++; - if (del >= 300) del = 0; - if (values > 4) values = 0; - text = "By smelting a clay mold you get a harder version which can be used to create jewelry. Simply right click with this on a molder to attach it and you're ready to go."; - Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true, new ItemStack(ItemList.clayMolds, 1, values), new ItemStack(ItemList.molds, 1, values)); - break; - case 10: - if (del == 0) values++; - del++; - if (del >= 300) del = 0; - if (values > 4) values = 0; - text = "It's this exact guide. I don't even know why you're reading this. I added this recipe in case you lose the original. Even if this is more helpful than NEI, I do suggest"; - Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.guide), new ItemStack(ItemList.molds, 1, values), new ItemStack(Items.book)); - break; - case 11: - String link = "HERE"; - if (x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK; - text = "installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really appreciate it. After that you can share it in the main thread " + link + "."; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - case 12: - ItemStack item = new ItemStack(ItemList.bucket); - if (del == 0) values++; - del++; - if (del >= 300) del = 0; - if (values > JewelrycraftUtil.metal.size() - 1) values = 0; - JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy()); - text = "These buckets contain molten metal. To obtain one simply Right Click a full Smelter to get a bucket. You can pour the metal, other than that it has no use. You can place the molten metal back in a Smelter by Right Clicking one with it."; - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, item, text, 40f, 0, 0, true, 45, 10, true); - break; - case 13: - text = "This item is a creative only item! Right click it while in creative mode to open a GUI. Place a piece of jewelery inside the slot, select what you want to add, then click on 'Add Items'. If you selected Modifiers, you can select multiple"; - Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.jewelryModifier), text, 40f, 0, 0, true, 45, 10, true); - break; - case 14: - text = "items at once. The 'Item' button is to add an Item to a Golden Object, which can not be obtained normally. This tool can be really useful, especially for those who want to test the mod and can't wait for the normal processes to finish (Smelter, Jewelers Table, Ritual)."; - Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text); - break; - default: - ; - } - } - - /** - * @return - */ - @Override - public int getMaxPages() - { - return 16; - } - - /** - * @param gui - * @param x - * @param y - * @param button - */ - @Override - public void mouseClick(GuiGuide gui, int x, int y, int button) - { - if (gui.page == 13 && x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) try{ - Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/forums/topics/2414865").toURI()); - } - catch(Exception e){} - } - - /** - * @param gui - * @param x - * @param y - * @param page - */ - @Override - public void drawForeground(GuiGuide gui, int x, int y, int page) - {} -} +package darkknight.jewelrycraft.client.gui;
+
+import java.awt.Desktop;
+import java.net.URL;
+import net.minecraft.init.Blocks;
+import net.minecraft.init.Items;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import darkknight.jewelrycraft.block.BlockList;
+import darkknight.jewelrycraft.client.Page;
+import darkknight.jewelrycraft.item.ItemList;
+import darkknight.jewelrycraft.util.JewelryNBT;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.Variables;
+
+public class GuiTabItems extends GuiTab
+{
+
+ /**
+ * @param id
+ */
+ public GuiTabItems(int id)
+ {
+ super(id);
+ }
+
+ public String getName()
+ {
+ return StatCollector.translateToLocal("guide." + Variables.MODID + ".tab.items");
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public ItemStack getIcon()
+ {
+ return new ItemStack(ItemList.thiefGloves);
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawBackground(GuiGuide gui, int x, int y, int page)
+ {
+ String text = "";
+ int xPos = page % 2 == 0 ? 107 : -35;
+ switch(page)
+ {
+ case 1:
+ text = "Shadow ingots are obtained by smelting shadow ore. They are used in a few recipes and an important key for making some jewelry work.";
+ Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true, new ItemStack(BlockList.shadowOre), new ItemStack(ItemList.shadowIngot));
+ break;
+ case 2:
+ text = "These gloves give you the chance to steal the trades those pesky Testificates have to offer. To use these simply open their gui at least once, then Crouch and";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.thiefGloves), new ItemStack(ItemList.shadowIngot), null, new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15), new ItemStack(Blocks.wool, 1, 15), new ItemStack(ItemList.shadowIngot), new ItemStack(Blocks.wool, 1, 15));
+ break;
+ case 3:
+ text = "right click on the them to hopefully steal the trades. If you traded with him before, then you have a chance of getting the traded emeralds back as well. This has a maximum of 10 uses before it breaks.";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 4:
+ text = "In order to get the ingot back from the smelter you need a mold for it. However, this mold can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 0), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball));
+ break;
+ case 5:
+ text = "To create a ring you need a mold for it. However, this one is too soft to be used. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 1), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null);
+ break;
+ case 6:
+ text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 2), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null);
+ break;
+ case 7:
+ text = "To create a bracelet you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 3), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball), new ItemStack(Items.clay_ball));
+ break;
+ case 8:
+ text = "To create a necklace you need a mold for it. However, this one can't be used. It is too soft. It needs to be hardened in order for it to be used.";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), false, text, x, y, true, new ItemStack(ItemList.clayMolds, 1, 4), null, null, null, new ItemStack(Items.clay_ball), null, new ItemStack(Items.clay_ball), null, null, null);
+ break;
+ case 9:
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values > 4) values = 0;
+ text = "By smelting a clay mold you get a harder version which can be used to create jewelry. Simply right click with this on a molder to attach it and you're ready to go.";
+ Page.addSmeltingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text, x, y, true, new ItemStack(ItemList.clayMolds, 1, values), new ItemStack(ItemList.molds, 1, values));
+ break;
+ case 10:
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values > 4) values = 0;
+ text = "It's this exact guide. I don't even know why you're reading this. I added this recipe in case you lose the original. Even if this is more helpful than NEI, I do suggest";
+ Page.addCraftingRecipeTextPage(gui, gui.getLeft() + xPos, gui.getTop(), true, text, x, y, true, new ItemStack(ItemList.guide), new ItemStack(ItemList.molds, 1, values), new ItemStack(Items.book));
+ break;
+ case 11:
+ String link = "HERE";
+ if (x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) link = EnumChatFormatting.DARK_BLUE + "HERE" + EnumChatFormatting.BLACK;
+ text = "installing it so you can see all the recipes. Since you are reading this, how about making a youtube video spotlighting this mod. I'd really appreciate it. After that you can share it in the main thread " + link + ".";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ case 12:
+ ItemStack item = new ItemStack(ItemList.bucket);
+ if (del == 0) values++;
+ del++;
+ if (del >= 300) del = 0;
+ if (values > JewelrycraftUtil.metal.size() - 1) values = 0;
+ JewelryNBT.addMetal(item, JewelrycraftUtil.metal.get(values).copy());
+ text = "These buckets contain molten metal. To obtain one simply Right Click a full Smelter to get a bucket. You can pour the metal, other than that it has no use. You can place the molten metal back in a Smelter by Right Clicking one with it.";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, item, text, 40f, 0, 0, true, 45, 10, true);
+ break;
+ case 13:
+ text = "This item is a creative only item! Right click it while in creative mode to open a GUI. Place a piece of jewelery inside the slot, select what you want to add, then click on 'Add Items'. If you selected Modifiers, you can select multiple";
+ Page.addImageTextPage(gui, gui.getLeft() + xPos, gui.getTop() - 5, new ItemStack(ItemList.jewelryModifier), text, 40f, 0, 0, true, 45, 10, true);
+ break;
+ case 14:
+ text = "items at once. The 'Item' button is to add an Item to a Golden Object, which can not be obtained normally. This tool can be really useful, especially for those who want to test the mod and can't wait for the normal processes to finish (Smelter, Jewelers Table, Ritual).";
+ Page.addTextPage(gui, gui.getLeft() + xPos, gui.getTop(), text);
+ break;
+ default:
+ ;
+ }
+ }
+
+ /**
+ * @return
+ */
+ @Override
+ public int getMaxPages()
+ {
+ return 16;
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param button
+ */
+ @Override
+ public void mouseClick(GuiGuide gui, int x, int y, int button)
+ {
+ if (gui.page == 13 && x >= gui.getLeft() && x <= gui.getLeft() + 30 && y >= gui.getTop() + 104 && y <= gui.getTop() + 124) try{
+ Desktop.getDesktop().browse(new URL("http://www.minecraftforum.net/forums/topics/2414865").toURI());
+ }
+ catch(Exception e){}
+ }
+
+ /**
+ * @param gui
+ * @param x
+ * @param y
+ * @param page
+ */
+ @Override
+ public void drawForeground(GuiGuide gui, int x, int y, int page)
+ {}
+}
diff --git a/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java b/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java index 204eab4..5d47498 100644 --- a/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java +++ b/src/main/java/darkknight/jewelrycraft/item/ItemThiefGloves.java @@ -1,165 +1,165 @@ -package darkknight.jewelrycraft.item; - -import java.util.Iterator; -import java.util.List; -import java.util.Random; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.potion.Potion; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChatComponentText; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.village.MerchantRecipe; -import net.minecraft.village.MerchantRecipeList; -import org.lwjgl.input.Keyboard; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.relauncher.ReflectionHelper; -import cpw.mods.fml.relauncher.Side; -import darkknight.jewelrycraft.util.JewelrycraftUtil; -import darkknight.jewelrycraft.util.PlayerUtils; -import darkknight.jewelrycraft.util.Variables; - -public class ItemThiefGloves extends Item -{ - public Random rand = new Random(); - - public ItemThiefGloves() - { - super(); - setCreativeTab(CreativeTabs.tabTools); - setMaxStackSize(1); - setMaxDamage(10); - } - - /** - * @param stack - * @param player - * @param entity - * @return - */ - @Override - public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity) - { - String villagerString = StatCollector.translateToLocal("info." + Variables.MODID + ".villager"); - if (entity instanceof EntityVillager){ - EntityVillager villager = (EntityVillager)entity; - int wealth = (Integer)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "wealth", "field_70956_bz"); - MerchantRecipeList buyingList = (MerchantRecipeList)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "buyingList", "field_70963_i"); - int chance = 5; - boolean areOtherVillagersAround = false, canTheySeeYou = false; - AxisAlignedBB axisalignedbb = villager.boundingBox.expand(4.0D, 4.0D, 4.0D); - List entities = villager.worldObj.getEntitiesWithinAABBExcludingEntity(villager, axisalignedbb); - for(Object s: entities) - if (s instanceof EntityVillager){ - areOtherVillagersAround = true; - chance += rand.nextInt(2); - if (((EntityVillager)s).canEntityBeSeen(player)){ - chance += 2; - canTheySeeYou = true; - } - } - if (villager.canEntityBeSeen(player)) chance += 5; - if (player.isPotionActive(Potion.invisibility)) chance -= 0.8 * chance; - if (player.capabilities.isCreativeMode) chance = 1; - int steal = rand.nextInt(chance); - if (steal == 0){ - villager.dropItem(Items.emerald, wealth); - ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 0, "wealth", "field_70956_bz"); - } - if (buyingList != null){ - Iterator<?> iterator = buyingList.iterator(); - if (steal == 0){ - while (iterator.hasNext()){ - MerchantRecipe recipe = (MerchantRecipe)iterator.next(); - int toolUses = (Integer)ReflectionHelper.getPrivateValue(MerchantRecipe.class, recipe, "toolUses", "field_77400_d"); - int quantity; - if (recipe.getItemToSell().isStackable()) quantity = recipe.getItemToSell().stackSize * (7 - toolUses); - else quantity = recipe.getItemToSell().stackSize; - ItemStack s = new ItemStack(recipe.getItemToSell().getItem(), quantity, recipe.getItemToSell().getItemDamage()); - s.setTagCompound(recipe.getItemToSell().getTagCompound()); - if (player.inventory.addItemStackToInventory(s)) ; - else villager.entityDropItem(s, 0); - if (!player.capabilities.isCreativeMode) JewelrycraftUtil.addCursePoints(player, 5); - player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + ": "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".villager.confusion") + s.getDisplayName() + "!")); - stack.damageItem(1, player); - } - buyingList.clear(); - ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 300, "timeUntilReset", "field_70961_j"); - ReflectionHelper.setPrivateValue(EntityVillager.class, villager, true, "needsInitilization", "field_70959_by"); - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".whisper")+": ")); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".stealSuccess1"))); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".stealSuccess2"))); - player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".stealSuccess3"))); - }else{ - stack.damageItem(1, player); - if (!player.capabilities.isCreativeMode) JewelrycraftUtil.addCursePoints(player, 25); - if (player.isPotionActive(Potion.invisibility)){ - player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " " +StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal.fail"))); - } - else{ - if (areOtherVillagersAround){ - if (!canTheySeeYou){ - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal.caught1")+" "+villagerString+" #" + villager.getProfession() + ".")); - player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal2"))); - return true; - } - else{ - player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal.caught2")+" "+villagerString+" #" + villager.getProfession() + ".")); - player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal2"))); - return true; - } - }else{ - player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal1"))); - player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal2"))); - return true; - } - } - } - } - return true; - }else return super.itemInteractionForEntity(stack, player, entity); - } - - /** - * @param stack - * @param player - * @param list - * @param par4 - */ - @Override - @SuppressWarnings ("unchecked") - public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings ("rawtypes") List list, boolean par4) - { - if (!shouldAddAdditionalInfo()) list.add(EnumChatFormatting.GRAY + additionalInfoInstructions()); - else{ - list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item." + Variables.MODID + ".thievingGloves.info.1")); - list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item." + Variables.MODID + ".thievingGloves.info.2")); - list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item." + Variables.MODID + ".thievingGloves.info.3")); - } - } - - /** - * @return - */ - public static boolean shouldAddAdditionalInfo() - { - if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) return true; - return false; - } - - /** - * @return - */ - public static String additionalInfoInstructions() - { - String message = StatCollector.translateToLocal("item." + Variables.MODID + ".thievingGloves.info.extra"); - return message; - } -} +package darkknight.jewelrycraft.item;
+
+import java.util.Iterator;
+import java.util.List;
+import java.util.Random;
+import net.minecraft.creativetab.CreativeTabs;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.entity.passive.EntityVillager;
+import net.minecraft.entity.player.EntityPlayer;
+import net.minecraft.init.Items;
+import net.minecraft.item.Item;
+import net.minecraft.item.ItemStack;
+import net.minecraft.nbt.NBTTagCompound;
+import net.minecraft.potion.Potion;
+import net.minecraft.util.AxisAlignedBB;
+import net.minecraft.util.ChatComponentText;
+import net.minecraft.util.EnumChatFormatting;
+import net.minecraft.util.StatCollector;
+import net.minecraft.village.MerchantRecipe;
+import net.minecraft.village.MerchantRecipeList;
+import org.lwjgl.input.Keyboard;
+import cpw.mods.fml.common.FMLCommonHandler;
+import cpw.mods.fml.relauncher.ReflectionHelper;
+import cpw.mods.fml.relauncher.Side;
+import darkknight.jewelrycraft.util.JewelrycraftUtil;
+import darkknight.jewelrycraft.util.PlayerUtils;
+import darkknight.jewelrycraft.util.Variables;
+
+public class ItemThiefGloves extends Item
+{
+ public Random rand = new Random();
+
+ public ItemThiefGloves()
+ {
+ super();
+ setCreativeTab(CreativeTabs.tabTools);
+ setMaxStackSize(1);
+ setMaxDamage(10);
+ }
+
+ /**
+ * @param stack
+ * @param player
+ * @param entity
+ * @return
+ */
+ @Override
+ public boolean itemInteractionForEntity(ItemStack stack, EntityPlayer player, EntityLivingBase entity)
+ {
+ String villagerString = StatCollector.translateToLocal("info." + Variables.MODID + ".villager");
+ if (entity instanceof EntityVillager){
+ EntityVillager villager = (EntityVillager)entity;
+ int wealth = (Integer)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "wealth", "field_70956_bz");
+ MerchantRecipeList buyingList = (MerchantRecipeList)ReflectionHelper.getPrivateValue(EntityVillager.class, villager, "buyingList", "field_70963_i");
+ int chance = 5;
+ boolean areOtherVillagersAround = false, canTheySeeYou = false;
+ AxisAlignedBB axisalignedbb = villager.boundingBox.expand(4.0D, 4.0D, 4.0D);
+ List entities = villager.worldObj.getEntitiesWithinAABBExcludingEntity(villager, axisalignedbb);
+ for(Object s: entities)
+ if (s instanceof EntityVillager){
+ areOtherVillagersAround = true;
+ chance += rand.nextInt(2);
+ if (((EntityVillager)s).canEntityBeSeen(player)){
+ chance += 2;
+ canTheySeeYou = true;
+ }
+ }
+ if (villager.canEntityBeSeen(player)) chance += 5;
+ if (player.isPotionActive(Potion.invisibility)) chance -= 0.8 * chance;
+ if (player.capabilities.isCreativeMode) chance = 1;
+ int steal = rand.nextInt(chance);
+ if (steal == 0){
+ villager.dropItem(Items.emerald, wealth);
+ ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 0, "wealth", "field_70956_bz");
+ }
+ if (buyingList != null){
+ Iterator<?> iterator = buyingList.iterator();
+ if (steal == 0){
+ while (iterator.hasNext()){
+ MerchantRecipe recipe = (MerchantRecipe)iterator.next();
+ int toolUses = (Integer)ReflectionHelper.getPrivateValue(MerchantRecipe.class, recipe, "toolUses", "field_77400_d");
+ int quantity;
+ if (recipe.getItemToSell().isStackable()) quantity = recipe.getItemToSell().stackSize * (7 - toolUses);
+ else quantity = recipe.getItemToSell().stackSize;
+ ItemStack s = new ItemStack(recipe.getItemToSell().getItem(), quantity, recipe.getItemToSell().getItemDamage());
+ s.setTagCompound(recipe.getItemToSell().getTagCompound());
+ if (player.inventory.addItemStackToInventory(s)) ;
+ else villager.entityDropItem(s, 0);
+ if (!player.capabilities.isCreativeMode) JewelrycraftUtil.addCursePoints(player, 5);
+ player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + ": "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".villager.confusion") + " " + s.getDisplayName() + "!"));
+ stack.damageItem(1, player);
+ }
+ buyingList.clear();
+ ReflectionHelper.setPrivateValue(EntityVillager.class, villager, 300, "timeUntilReset", "field_70961_j");
+ ReflectionHelper.setPrivateValue(EntityVillager.class, villager, true, "needsInitilization", "field_70959_by");
+ player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".whisper")+": "));
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".stealSuccess1")));
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".stealSuccess2")));
+ player.addChatMessage(new ChatComponentText(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".stealSuccess3")));
+ }else{
+ stack.damageItem(1, player);
+ if (!player.capabilities.isCreativeMode) JewelrycraftUtil.addCursePoints(player, 25);
+ if (player.isPotionActive(Potion.invisibility)){
+ player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " " +StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal.fail")));
+ }
+ else{
+ if (areOtherVillagersAround){
+ if (!canTheySeeYou){
+ player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal.caught1")+" "+villagerString+" #" + villager.getProfession() + "."));
+ player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal2")));
+ return true;
+ }
+ else{
+ player.addChatMessage(new ChatComponentText(StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal.caught2")+" "+villagerString+" #" + villager.getProfession() + "."));
+ player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal2")));
+ return true;
+ }
+ }else{
+ player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal1")));
+ player.addChatMessage(new ChatComponentText(villagerString+" #" + villager.getProfession() + " "+StatCollector.translateToLocal("chatmessage." + Variables.MODID + ".steal2")));
+ return true;
+ }
+ }
+ }
+ }
+ return true;
+ }else return super.itemInteractionForEntity(stack, player, entity);
+ }
+
+ /**
+ * @param stack
+ * @param player
+ * @param list
+ * @param par4
+ */
+ @Override
+ @SuppressWarnings ("unchecked")
+ public void addInformation(ItemStack stack, EntityPlayer player, @SuppressWarnings ("rawtypes") List list, boolean par4)
+ {
+ if (!shouldAddAdditionalInfo()) list.add(EnumChatFormatting.GRAY + additionalInfoInstructions());
+ else{
+ list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item." + Variables.MODID + ".thievingGloves.info.1"));
+ list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item." + Variables.MODID + ".thievingGloves.info.2"));
+ list.add(EnumChatFormatting.GRAY + StatCollector.translateToLocal("item." + Variables.MODID + ".thievingGloves.info.3"));
+ }
+ }
+
+ /**
+ * @return
+ */
+ public static boolean shouldAddAdditionalInfo()
+ {
+ if (FMLCommonHandler.instance().getEffectiveSide() == Side.CLIENT) if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) return true;
+ return false;
+ }
+
+ /**
+ * @return
+ */
+ public static String additionalInfoInstructions()
+ {
+ String message = StatCollector.translateToLocal("item." + Variables.MODID + ".thievingGloves.info.extra");
+ return message;
+ }
+}
diff --git a/src/main/java/darkknight/jewelrycraft/util/Variables.java b/src/main/java/darkknight/jewelrycraft/util/Variables.java index 5a02332..f30d968 100644 --- a/src/main/java/darkknight/jewelrycraft/util/Variables.java +++ b/src/main/java/darkknight/jewelrycraft/util/Variables.java @@ -6,7 +6,7 @@ public class Variables {
public static final String MODID = "jewelrycraft2";
public static final String MODNAME = "Jewelrycraft 2";
- public static final String VERSION = "1.0.12.2";
+ public static final String VERSION = "1.0.12.3";
public static final String PACKET_CHANNEL = "jewelrycraft2";
public static final String CONFIG_GUI = "darkknight.jewelrycraft.config.ConfigGuiFactory";
|
