diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantDisplay.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantDisplay.java index da128115..ce9ae6dd 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantDisplay.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/EnchantDisplay.java @@ -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)); } } diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DescriptionOptions.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DescriptionOptions.java index fb0ce69e..b6a4fc46 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DescriptionOptions.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/display/options/DescriptionOptions.java @@ -34,6 +34,12 @@ public class DescriptionOptions extends PluginDependent { @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 { 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"); } /** diff --git a/eco-core/core-plugin/src/main/resources/config.yml b/eco-core/core-plugin/src/main/resources/config.yml index b4e39faa..85d63fb5 100644 --- a/eco-core/core-plugin/src/main/resources/config.yml +++ b/eco-core/core-plugin/src/main/resources/config.yml @@ -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