mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-11-23 02:35:28 +01:00
fix display error for chance in item lores
This commit is contained in:
parent
883db72391
commit
eff33ecced
@ -350,6 +350,7 @@ public class KitEditorGui extends DoubleGui {
|
||||
switch (action) {
|
||||
case CHANCE_UP:
|
||||
case CHANCE_DOWN:
|
||||
System.out.println("chance");
|
||||
if (action == Action.CHANCE_UP)
|
||||
item.setChance(item.getChance() >= 100 ? 5 : (item.getChance() + 5));
|
||||
else
|
||||
@ -422,7 +423,8 @@ public class KitEditorGui extends DoubleGui {
|
||||
if (meta.hasLore()) itemLore = meta.getLore();
|
||||
else itemLore = new ArrayList<>();
|
||||
itemLore.add(TextUtils.convertToInvisibleLoreString("----"));
|
||||
itemLore.add(ChatColor.GRAY.toString() + plugin.getLocale().getMessage("general.type.chance") + ": " + ChatColor.GOLD.toString() + item.getChance() + "%");
|
||||
itemLore.add(ChatColor.GRAY.toString() + plugin.getLocale().getMessage("general.type.chance").getMessage().replaceFirst("^" + ChatColor.RESET.toString(), "")
|
||||
+ ": " + ChatColor.GOLD.toString() + item.getChance() + "%"); //TODO use a placeholder message in locales
|
||||
if (isInFunction) {
|
||||
itemLore.addAll(Arrays.asList(plugin.getLocale().getMessage("interface.kiteditor.itemfunctionlore")
|
||||
.processPlaceholder("item", item.getDisplayItem() == null ? "" : item.getDisplayItem().name())
|
||||
|
Loading…
Reference in New Issue
Block a user