Class PacketEventsAdapter.PlayerVisualPreferences
java.lang.Object
io.artificial.enchantments.optional.packetevents.PacketEventsAdapter.PlayerVisualPreferences
- Enclosing class:
PacketEventsAdapter
Per-player visual customization preferences.
These settings control how enchanted items appear to a specific player without affecting the actual item state or how other players see the item.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionCreates default preferences (all customization enabled). -
Method Summary
Modifier and TypeMethodDescription@Nullable Consumer<PacketEventsAdapter.VisualContext> Gets the custom lore formatter.@Nullable StringGets the lore prefix string.booleanChecks if visual customization is enabled.booleanChecks if vanilla enchantments should be hidden.booleanChecks if lore modification is enabled.booleanChecks if enchantment glint should be shown.setCustomLoreFormatter(@Nullable Consumer<PacketEventsAdapter.VisualContext> customLoreFormatter) Sets a custom lore formatter for enchantment display.setEnabled(boolean enabled) Sets whether visual customization is enabled.setHideVanillaEnchantments(boolean hideVanillaEnchantments) Sets whether to hide vanilla enchantments from display.setLorePrefix(@Nullable String lorePrefix) Sets the lore prefix string.setModifyLore(boolean modifyLore) Sets whether to modify item lore.setShowEnchantmentGlint(boolean showEnchantmentGlint) Sets whether to show the enchantment glint effect.
-
Constructor Details
-
PlayerVisualPreferences
public PlayerVisualPreferences()Creates default preferences (all customization enabled).- Since:
- 0.1.0
-
-
Method Details
-
isEnabled
public boolean isEnabled()Checks if visual customization is enabled.- Returns:
- true if customization is enabled
- Since:
- 0.1.0
-
setEnabled
Sets whether visual customization is enabled.- Parameters:
enabled- true to enable, false to disable- Returns:
- this preferences object for chaining
- Since:
- 0.1.0
-
isModifyLore
public boolean isModifyLore()Checks if lore modification is enabled.- Returns:
- true if lore will be modified
- Since:
- 0.1.0
-
setModifyLore
Sets whether to modify item lore.- Parameters:
modifyLore- true to modify lore, false to leave unchanged- Returns:
- this preferences object for chaining
- Since:
- 0.1.0
-
isShowEnchantmentGlint
public boolean isShowEnchantmentGlint()Checks if enchantment glint should be shown.- Returns:
- true if glint is enabled
- Since:
- 0.1.0
-
setShowEnchantmentGlint
public PacketEventsAdapter.PlayerVisualPreferences setShowEnchantmentGlint(boolean showEnchantmentGlint) Sets whether to show the enchantment glint effect.- Parameters:
showEnchantmentGlint- true to show glint, false to hide- Returns:
- this preferences object for chaining
- Since:
- 0.1.0
-
isHideVanillaEnchantments
public boolean isHideVanillaEnchantments()Checks if vanilla enchantments should be hidden.- Returns:
- true if vanilla enchantments are hidden
- Since:
- 0.1.0
-
setHideVanillaEnchantments
public PacketEventsAdapter.PlayerVisualPreferences setHideVanillaEnchantments(boolean hideVanillaEnchantments) Sets whether to hide vanilla enchantments from display.- Parameters:
hideVanillaEnchantments- true to hide, false to show- Returns:
- this preferences object for chaining
- Since:
- 0.1.0
-
getLorePrefix
Gets the lore prefix string.- Returns:
- the prefix string, or null if not set
- Since:
- 0.1.0
-
setLorePrefix
public PacketEventsAdapter.PlayerVisualPreferences setLorePrefix(@Nullable @Nullable String lorePrefix) Sets the lore prefix string.- Parameters:
lorePrefix- the prefix string, or null for default- Returns:
- this preferences object for chaining
- Since:
- 0.1.0
-
getCustomLoreFormatter
Gets the custom lore formatter.- Returns:
- the custom formatter, or null if not set
- Since:
- 0.1.0
-
setCustomLoreFormatter
public PacketEventsAdapter.PlayerVisualPreferences setCustomLoreFormatter(@Nullable @Nullable Consumer<PacketEventsAdapter.VisualContext> customLoreFormatter) Sets a custom lore formatter for enchantment display.- Parameters:
customLoreFormatter- the custom formatter, or null for default- Returns:
- this preferences object for chaining
- Since:
- 0.1.0
-