{player} will now be preserved when a kit is claimed.

This commit is contained in:
Brianna 2019-06-17 23:30:22 -04:00
parent d8996023aa
commit 34c1b06765
2 changed files with 13 additions and 1 deletions

View File

@ -4,7 +4,7 @@ stages:
variables:
name: "UltimateKits"
path: "/builds/$CI_PROJECT_PATH"
version: "2.3.10"
version: "2.3.11"
build:
stage: build

View File

@ -309,6 +309,18 @@ public class Kit {
}
ItemStack parseStack = ((KitContentItem) item.getContent()).getItemStack();
if (parseStack.hasItemMeta() && parseStack.getItemMeta().hasLore()) {
ItemMeta meta = parseStack.getItemMeta();
List<String> newLore = new ArrayList<>();
for (String str : parseStack.getItemMeta().getLore()) {
str = str.replace("{PLAYER}", player.getName()).replace("<PLAYER>", player.getName());
newLore.add(str);
}
meta.setLore(newLore);
parseStack.setItemMeta(meta);
}
if (parseStack.getType() == Material.AIR) continue;
amtToGive--;