mirror of
https://github.com/songoda/UltimateKits.git
synced 2025-02-18 20:31:46 +01:00
Fixed chances for commands and money.
This commit is contained in:
parent
8d56a71486
commit
18531addad
@ -219,10 +219,10 @@ public class Kit {
|
||||
for (String line : is.getItemMeta().getLore()) {
|
||||
command.append(line);
|
||||
}
|
||||
list.add(new KitItem(ChatColor.stripColor(command.toString())));
|
||||
list.add(new KitItem(is, ChatColor.stripColor(command.toString())));
|
||||
} else if (is.getType() == Material.PAPER && ChatColor.stripColor(is.getItemMeta().getDisplayName()).endsWith("Money")) {
|
||||
String money = is.getItemMeta().getLore().get(0);
|
||||
list.add(new KitItem(ChatColor.stripColor(money)));
|
||||
list.add(new KitItem(is, ChatColor.stripColor(money)));
|
||||
} else {
|
||||
list.add(new KitItem(is));
|
||||
}
|
||||
|
@ -36,6 +36,21 @@ public class KitItem {
|
||||
}
|
||||
}
|
||||
|
||||
public KitItem(ItemStack item, String line) {
|
||||
ItemStack itemStack = item.clone();
|
||||
ItemMeta meta = itemStack.getItemMeta();
|
||||
if (itemStack.hasItemMeta() && meta.hasDisplayName() && meta.getDisplayName().contains(";")) {
|
||||
translateLine(meta.getDisplayName());
|
||||
}
|
||||
if (line.startsWith(UltimateKits.getInstance().getConfig().getString("Main.Currency Symbol"))) {
|
||||
this.content = new KitContentEconomy(Double.parseDouble(line.substring(1).trim()));
|
||||
} else if (line.startsWith("/")) {
|
||||
this.content = new KitContentCommand(line.substring(1));
|
||||
} else {
|
||||
this.content = new KitContentItem(UltimateKits.getInstance().getItemSerializer().deserializeLegacyItemStack(line));
|
||||
}
|
||||
}
|
||||
|
||||
public KitItem(ItemStack item) {
|
||||
ItemStack itemStack = item.clone();
|
||||
ItemMeta meta = itemStack.getItemMeta();
|
||||
|
Loading…
Reference in New Issue
Block a user