mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-27 04:35:11 +01:00
Keys look and function better.
This commit is contained in:
parent
7ef51515c5
commit
b8d575b9ed
@ -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!"),
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user