Merge pull request #13 from mung3r/master

added banner colors
This commit is contained in:
Nick Minkler 2015-08-15 10:49:28 -07:00
commit af482c564a

View File

@ -702,7 +702,22 @@ public class Items {
items.add(new ItemInfo("Armor Stand", new String[][]{{"armo", "stan"}}, Material.ARMOR_STAND));
items.add(new ItemInfo("Raw Mutton", new String[][]{{"mutt"}, {"raw", "mutt"}}, Material.MUTTON));
items.add(new ItemInfo("Cooked Mutton", new String[][]{{"cook", "mutt"}}, Material.COOKED_MUTTON));
items.add(new ItemInfo("Banner", new String[][]{{"banner"}}, Material.BANNER));
items.add(new ItemInfo("White Banner", new String[][]{{"banner", "whit"}, {"banner"}}, Material.BANNER));
items.add(new ItemInfo("Orange Banner", new String[][]{{"banner", "ora"}}, Material.BANNER, (short) 1));
items.add(new ItemInfo("Magenta Banner", new String[][]{{"banner", "mag"}}, Material.BANNER, (short) 2));
items.add(new ItemInfo("Light Blue Banner", new String[][]{{"banner", "lig", "blue"}}, Material.BANNER, (short) 3));
items.add(new ItemInfo("Yellow Banner", new String[][]{{"banner", "yell"}}, Material.BANNER, (short) 4));
items.add(new ItemInfo("Lime Banner", new String[][]{{"banner", "lime"}, {"banner", "lime"}}, Material.BANNER, (short) 5));
items.add(new ItemInfo("Pink Banner", new String[][]{{"banner", "pink"}}, Material.BANNER, (short) 6));
items.add(new ItemInfo("Gray Banner", new String[][]{{"banner", "gray"}, {"banner", "grey"}}, Material.BANNER, (short) 7));
items.add(new ItemInfo("Light Gray Banner", new String[][]{{"lig", "banner", "gra"}, {"lig", "banner", "gre"}}, Material.BANNER, (short) 8));
items.add(new ItemInfo("Cyan Banner", new String[][]{{"banner", "cya"}}, Material.BANNER, (short) 9));
items.add(new ItemInfo("Purple Banner", new String[][]{{"banner", "pur"}}, Material.BANNER, (short) 10));
items.add(new ItemInfo("Blue Banner", new String[][]{{"banner", "blue"}}, Material.BANNER, (short) 11));
items.add(new ItemInfo("Brown Banner", new String[][]{{"banner", "brow"}}, Material.BANNER, (short) 12));
items.add(new ItemInfo("Green Banner", new String[][]{{"banner", "gree"}, {"banner", "gree"}}, Material.BANNER, (short) 13));
items.add(new ItemInfo("Red Banner", new String[][]{{"banner", "red"}}, Material.BANNER, (short) 14));
items.add(new ItemInfo("Black Banner", new String[][]{{"banner", "bla"}}, Material.BANNER, (short) 15));
items.add(new ItemInfo("Potion of Leaping", new String[][] {{"poti", "leap"}}, Material.POTION, (short) 8203));
items.add(new ItemInfo("Potion of Leaping (Extended)", new String[][] {{"poti", "leap", "ext"}}, Material.POTION, (short) 8267));
items.add(new ItemInfo("Potion of Leaping II", new String[][] {{"poti", "leap", "ii"}, {"poti", "leap", "2"}}, Material.POTION, (short) 8235));
@ -947,6 +962,25 @@ public class Items {
break;
}
}
} else if (searchString.matches("\\w+:\\d+")) {
// Match on string:short to get typeId and subTypeId
// Retrieve/parse data
String[] params = searchString.split(":");
short subTypeId = Short.parseShort(params[1]);
ItemInfo namedItem = itemByName(params[0]);
if (namedItem != null) {
int typeId = namedItem.getId();
// Iterate through items
for (ItemInfo item : items) {
// Test for match
if (item.getId() == typeId && item.getSubTypeId() == subTypeId) {
matchedItem = item;
break;
}
}
}
} else {
// Else this must be a string that we need to identify