mirror of
https://gitlab.com/phoenix-dvpmt/mmoitems.git
synced 2025-01-10 07:47:35 +01:00
Fixed display issues
This commit is contained in:
parent
096df90294
commit
d53e28e7f7
@ -127,7 +127,7 @@ public class Abilities extends ItemStat {
|
||||
@Override
|
||||
public void whenDisplayed(List<String> lore, Optional<RandomStatData> optional) {
|
||||
lore.add(ChatColor.GRAY + "Current Abilities: " + ChatColor.GOLD
|
||||
+ (optional.isPresent() ? "0" : ((RandomAbilityListData) optional.get()).getAbilities().size()));
|
||||
+ (optional.isPresent() ? ((RandomAbilityListData) optional.get()).getAbilities().size() : 0));
|
||||
lore.add("");
|
||||
lore.add(ChatColor.YELLOW + AltChar.listDash + " Click to edit the item abilities.");
|
||||
}
|
||||
|
@ -65,6 +65,7 @@ public class DyeColor extends ItemStat {
|
||||
@Override
|
||||
public void whenDisplayed(List<String> lore, Optional<RandomStatData> optional) {
|
||||
lore.add(ChatColor.GRAY + "Current Value: " + (optional.isPresent() ? ChatColor.GREEN + optional.get().toString() : ChatColor.RED + "None"));
|
||||
lore.add("");
|
||||
lore.add(ChatColor.YELLOW + AltChar.listDash + " Click to change this value.");
|
||||
lore.add(ChatColor.YELLOW + AltChar.listDash + " Right click to remove the dye color.");
|
||||
}
|
||||
|
@ -81,11 +81,11 @@ public class Elements extends ItemStat {
|
||||
|
||||
if (optional.isPresent()) {
|
||||
lore.add(ChatColor.GRAY + "Current Value:");
|
||||
ElementListData data = (ElementListData) optional.get();
|
||||
data.getDamageElements()
|
||||
.forEach(element -> lore.add(ChatColor.GRAY + "* " + element.getName() + " Damage: " + data.getDamage(element) + "%"));
|
||||
data.getDefenseElements()
|
||||
.forEach(element -> lore.add(ChatColor.GRAY + "* " + element.getName() + " Damage: " + data.getDefense(element) + "%"));
|
||||
RandomElementListData data = (RandomElementListData) optional.get();
|
||||
data.getDamageElements().forEach(
|
||||
element -> lore.add(ChatColor.GRAY + "* " + element.getName() + " Damage: " + ChatColor.RED + data.getDamage(element) + " (%)"));
|
||||
data.getDefenseElements().forEach(
|
||||
element -> lore.add(ChatColor.GRAY + "* " + element.getName() + " Damage: " + ChatColor.RED + data.getDefense(element) + " (%)"));
|
||||
|
||||
} else
|
||||
lore.add(ChatColor.GRAY + "Current Value: " + ChatColor.RED + "None");
|
||||
|
@ -103,10 +103,10 @@ public class PermanentEffects extends ItemStat {
|
||||
|
||||
if (optional.isPresent()) {
|
||||
lore.add(ChatColor.GRAY + "Current Value:");
|
||||
PotionEffectListData data = (PotionEffectListData) optional.get();
|
||||
for (PotionEffectData effect : data.getEffects())
|
||||
RandomPotionEffectListData data = (RandomPotionEffectListData) optional.get();
|
||||
for (RandomPotionEffectData effect : data.getEffects())
|
||||
lore.add(ChatColor.GRAY + "* " + ChatColor.GREEN + MMOUtils.caseOnWords(effect.getType().getName().replace("_", " ").toLowerCase())
|
||||
+ " " + MMOUtils.intToRoman(effect.getLevel()));
|
||||
+ " " + effect.getLevel().toString());
|
||||
|
||||
} else
|
||||
lore.add(ChatColor.GRAY + "Current Value: " + ChatColor.RED + "None");
|
||||
|
@ -62,10 +62,10 @@ public class Restore extends ItemStat {
|
||||
public void whenDisplayed(List<String> lore, Optional<RandomStatData> optional) {
|
||||
|
||||
if (optional.isPresent()) {
|
||||
RestoreData data = (RestoreData) optional.get();
|
||||
lore.add(ChatColor.GRAY + "* Restore Health: " + ChatColor.GREEN + data.getHealth());
|
||||
lore.add(ChatColor.GRAY + "* Restore Food: " + ChatColor.GREEN + data.getFood());
|
||||
lore.add(ChatColor.GRAY + "* Restore Saturation: " + ChatColor.GREEN + data.getSaturation());
|
||||
RandomRestoreData data = (RandomRestoreData) optional.get();
|
||||
lore.add(ChatColor.GRAY + "* Restore Health: " + ChatColor.RED + data.getHealth());
|
||||
lore.add(ChatColor.GRAY + "* Restore Food: " + ChatColor.RED + data.getFood());
|
||||
lore.add(ChatColor.GRAY + "* Restore Saturation: " + ChatColor.RED + data.getSaturation());
|
||||
|
||||
} else
|
||||
lore.add(ChatColor.GRAY + "Current Value: " + ChatColor.RED + "None");
|
||||
|
@ -86,7 +86,7 @@ public class BooleanStat extends ItemStat {
|
||||
if (optional.isPresent()) {
|
||||
double chance = ((RandomBooleanData) optional.get()).getChance();
|
||||
lore.add(ChatColor.GRAY + "Current Value: " + (chance >= 1 ? ChatColor.GREEN + "True"
|
||||
: chance <= 0 ? ChatColor.RED + "False" : ChatColor.GREEN + digit.format(chance * 100) + "%"));
|
||||
: chance <= 0 ? ChatColor.RED + "False" : ChatColor.GREEN + digit.format(chance * 100) + "% Chance"));
|
||||
|
||||
} else
|
||||
lore.add(ChatColor.GRAY + "Current Value: " + ChatColor.RED + "False");
|
||||
|
Loading…
Reference in New Issue
Block a user