mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-26 15:45:12 +01:00
Added option to display enchantments below item lore
This commit is contained in:
parent
63bd87ff66
commit
1e0002484e
@ -158,7 +158,11 @@ public class EnchantDisplay extends DisplayModule {
|
||||
}
|
||||
|
||||
meta.addItemFlags(ItemFlag.HIDE_ENCHANTS);
|
||||
lore.addAll(itemLore);
|
||||
if (this.getOptions().isAboveLore()) {
|
||||
lore.addAll(itemLore);
|
||||
} else {
|
||||
lore.addAll(0, itemLore);
|
||||
}
|
||||
itemStack.setItemMeta(meta);
|
||||
fastItemStack.setLore(lore);
|
||||
}
|
||||
|
@ -61,6 +61,12 @@ public class DisplayOptions extends PluginDependent<EcoPlugin> {
|
||||
@Getter
|
||||
private boolean requireTarget = true;
|
||||
|
||||
/**
|
||||
* If enchants should be displayed above lore.
|
||||
*/
|
||||
@Getter
|
||||
private boolean aboveLore = true;
|
||||
|
||||
/**
|
||||
* Instantiate new display options.
|
||||
*
|
||||
@ -96,6 +102,7 @@ public class DisplayOptions extends PluginDependent<EcoPlugin> {
|
||||
sortedRarities.addAll(EnchantmentRarity.values().stream().filter(enchantmentRarity -> !sortedRarities.contains(enchantmentRarity)).collect(Collectors.toList()));
|
||||
|
||||
requireTarget = this.getPlugin().getConfigYml().getBool("lore.require-target");
|
||||
aboveLore = this.getPlugin().getConfigYml().getBool("lore.above-other-lore");
|
||||
|
||||
boolean byType = this.getPlugin().getConfigYml().getBool("lore.sort-by-type");
|
||||
boolean byLength = this.getPlugin().getConfigYml().getBool("lore.sort-by-length");
|
||||
|
@ -27,6 +27,8 @@ lore:
|
||||
use-numerals: true
|
||||
use-numbers-above-threshold: 10 # After level 10, enchantments will display as Name Number, eg: Sharpness 25 instead of Sharpness XXV
|
||||
|
||||
above-other-lore: true # If enchantments should be displayed above other lore
|
||||
|
||||
# If above max level enchantments should be formatted differently
|
||||
# Format is available in lang.yml
|
||||
above-max-level:
|
||||
|
Loading…
Reference in New Issue
Block a user