summaryrefslogtreecommitdiff
path: root/common/darkknight/jewelrycraft/util/JewelrycraftUtil.java
blob: 08215655fbde8143fa765783276dc43871bccabb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package darkknight.jewelrycraft.util;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import darkknight.jewelrycraft.item.ItemList;

public class JewelrycraftUtil
{
    public static ArrayList<ItemStack> modifiers = new ArrayList<ItemStack>();
    public static ArrayList<ItemStack> jewel = new ArrayList<ItemStack>();
    public static ArrayList<ItemStack> jewelry = new ArrayList<ItemStack>();
    public static ArrayList<String> jamcraftPlayers = new ArrayList<String>();
    public static HashMap<ItemStack, ItemStack> combinations = new HashMap<ItemStack, ItemStack>();

    public static void addStuff()
    {
        //Modifiers
        modifiers.add(new ItemStack(Item.blazePowder));
        modifiers.add(new ItemStack(Item.sugar));
        modifiers.add(new ItemStack(Block.chest));
        modifiers.add(new ItemStack(Item.pickaxeIron));
        modifiers.add(new ItemStack(Item.bed));
        modifiers.add(new ItemStack(Item.eyeOfEnder));
        modifiers.add(new ItemStack(Item.feather));
        modifiers.add(new ItemStack(Item.potion, 1, 8270));

        //Jewels
        jewel.add(new ItemStack(Item.enderPearl));
        jewel.add(new ItemStack(Item.diamond));
        jewel.add(new ItemStack(Item.emerald));
        jewel.add(new ItemStack(Block.obsidian));
        jewel.add(new ItemStack(Item.netherStar));

        //Jewelry
        jewelry.add(new ItemStack(ItemList.ring));
    }
    
    public static void addSpecialCombinations()
    {
        combinations.put(new ItemStack(Item.enderPearl), new ItemStack(Block.chest));
        combinations.put(new ItemStack(Item.enderPearl), new ItemStack(Item.bed));
        combinations.put(new ItemStack(Block.obsidian), new ItemStack(Item.eyeOfEnder));
        combinations.put(new ItemStack(Item.netherStar), new ItemStack(Block.chest));
        //An ender pearl with any modifier that is not a chest or bed
        combinations.put(new ItemStack(Item.enderPearl), new ItemStack(Item.itemsList.length, 0, 0));
    }
    
    public static void jamcrafters()
    {
        jamcraftPlayers.add("allout58");
        jamcraftPlayers.add("ChewBaker");
        jamcraftPlayers.add("domi1819");
        jamcraftPlayers.add("founderio");
        jamcraftPlayers.add("Ironhammer354");
        jamcraftPlayers.add("isomgirls6");
        jamcraftPlayers.add("jmjmjm439");
        jamcraftPlayers.add("Joban");
        jamcraftPlayers.add("KJ4IPS");
        jamcraftPlayers.add("Mitchellbrine");
        jamcraftPlayers.add("MrComputerGhost");
        jamcraftPlayers.add("MrKol999");
        jamcraftPlayers.add("Resinresin");
        jamcraftPlayers.add("sci4me");
        jamcraftPlayers.add("sor1n");
        jamcraftPlayers.add("theminecoder");
        jamcraftPlayers.add("YSPilot");
        jamcraftPlayers.add("direwolf20");
    }

    public static boolean isModifier(ItemStack item)
    {
        Iterator<ItemStack> i = modifiers.iterator();

        while (i.hasNext())
        {
            ItemStack temp = i.next();
            if (temp.itemID == item.itemID && temp.getItemDamage() == item.getItemDamage())
                return true;
        }
        return false;
    }

    public static boolean isJewel(ItemStack item)
    {
        Iterator<ItemStack> i = jewel.iterator();

        while (i.hasNext())
        {
            ItemStack temp = i.next();
            if (temp.itemID == item.itemID && temp.getItemDamage() == item.getItemDamage())
                return true;
        }
        return false;
    }

    public static boolean isJewelry(ItemStack item)
    {
        Iterator<ItemStack> i = jewelry.iterator();

        while (i.hasNext())
        {
            ItemStack temp = i.next();
            if (temp.itemID == item.itemID && temp.getItemDamage() == item.getItemDamage())
                return true;
        }
        return false;
    }
}