mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2025-02-08 03:11:19 +01:00
Added only-on-books option for descriptions
This commit is contained in:
parent
994bffb39b
commit
84e90ca338
@ -138,6 +138,10 @@ public class EnchantDisplay extends DisplayModule {
|
||||
&& options.getDescriptionOptions().isEnabled()
|
||||
&& options.getDescriptionOptions().enabledForPlayer(player)
|
||||
) {
|
||||
if (options.getDescriptionOptions().isOnlyOnBooks() && !(meta instanceof EnchantmentStorageMeta)) {
|
||||
return;
|
||||
}
|
||||
|
||||
lore.addAll(EnchantmentCache.getEntry(enchantment).getDescription(level));
|
||||
}
|
||||
}
|
||||
|
@ -34,6 +34,12 @@ public class DescriptionOptions extends PluginDependent<EcoPlugin> {
|
||||
@Getter
|
||||
private boolean showingAtBottom;
|
||||
|
||||
/**
|
||||
* If descriptions should only be shown on books.
|
||||
*/
|
||||
@Getter
|
||||
private boolean onlyOnBooks;
|
||||
|
||||
/**
|
||||
* Create new description options.
|
||||
*
|
||||
@ -51,6 +57,7 @@ public class DescriptionOptions extends PluginDependent<EcoPlugin> {
|
||||
enabled = this.getPlugin().getConfigYml().getBool("lore.describe.enabled");
|
||||
color = this.getPlugin().getLangYml().getFormattedString("description-color");
|
||||
showingAtBottom = this.getPlugin().getConfigYml().getBool("lore.describe.at-bottom");
|
||||
onlyOnBooks = this.getPlugin().getConfigYml().getBool("lore.describe.only-on-books");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -35,7 +35,6 @@ lore:
|
||||
reformat: true
|
||||
numbers-only: true # If only the numbers should be reformatted
|
||||
|
||||
|
||||
sort-by-type: false # Sort enchantments by type
|
||||
sort-by-length: false # Sort enchantments by length
|
||||
sort-by-rarity: false # Sort enchantments by rarity.
|
||||
@ -64,6 +63,7 @@ lore:
|
||||
before-lines: 5 # Describe before or equal to number of enchantments
|
||||
wrap: 30 # Word wrap after number of characters
|
||||
at-bottom: false # If descriptions should be shown after all enchantments rather than under each one
|
||||
only-on-books: false # If descriptions should only be shown on books
|
||||
|
||||
# Ensure that describe and shrink have no overlap as this may cause errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user