Keys look and function better.

This commit is contained in:
Brianna O'Keefe 2018-05-18 23:12:08 -04:00
parent 7ef51515c5
commit b8d575b9ed
2 changed files with 13 additions and 4 deletions

View File

@ -106,7 +106,7 @@ public enum Lang {
KEY_SUCCESS("key-success", "&9You have successfully redeemed a key for the kit &7{KIT}&9."),
KEY_DESC1("key-desc1", "&rRight-Click on a &c&l{KIT}&r kit"),
KEY_DESC1("key-desc1", "&rRight-Click on [a ]&c&l{KIT}&r kit"),
KEY_DESC2("key-desc2", "&rand receive its contents!"),

View File

@ -29,6 +29,7 @@ public class Key {
this.kitAmount = kitAmount;
}
public ItemStack getKeyItem(Kit kit, int amt) {
ItemStack is = null;
try {
@ -38,15 +39,23 @@ public class Key {
if (kit != null)
kitName = Arconix.pl().getApi().format().formatText(kit.getShowableName(), true);
else
kitName = "All";
kitName = "Any";
ItemMeta meta = is.getItemMeta();
meta.setDisplayName(Arconix.pl().getApi().format().formatText(Lang.KEY_TITLE.getConfigValue(kitName)));
meta.addEnchant(Enchantment.DURABILITY, 1, true);
List<String> lore = new ArrayList<>();
lore.add(Arconix.pl().getApi().format().formatText(name + " &fKey"));
lore.add(Arconix.pl().getApi().format().formatText(Lang.KEY_DESC1.getConfigValue(kitName)));
lore.add(Arconix.pl().getApi().format().formatText("&e" + name + " &fKey"));
String desc1 = Lang.KEY_DESC1.getConfigValue(kitName);
if (kitName.equals("Any"))
desc1 = desc1.replaceAll("\\[.*?\\]","");
else
desc1 = desc1.replace("[", "").replace("]", "");
lore.add(Arconix.pl().getApi().format().formatText(desc1));
if (this.amt == -1)
lore.add(Arconix.pl().getApi().format().formatText(Lang.KEY_DESC2.getConfigValue()));
else