Class ItemVisualProcessor.VisualContext

java.lang.Object
io.artificial.enchantments.optional.packetevents.ItemVisualProcessor.VisualContext
Enclosing class:
ItemVisualProcessor

public static final class ItemVisualProcessor.VisualContext extends Object
Context object passed to lore formatters.

Contains information about an enchantment being formatted, allowing custom formatters to modify the display output.

Since:
0.1.0
  • Constructor Details

    • VisualContext

      public VisualContext(@NotNull @NotNull String enchantmentName, int level, boolean isArtificial)
      Creates a new visual context.
      Parameters:
      enchantmentName - the display name of the enchantment
      level - the enchantment level
      isArtificial - whether this is an artificial enchantment
      Throws:
      NullPointerException - if enchantmentName is null
      Since:
      0.1.0
  • Method Details

    • getEnchantmentName

      @NotNull public @NotNull String getEnchantmentName()
      Gets the enchantment display name.
      Returns:
      the enchantment name
      Since:
      0.1.0
    • getLevel

      public int getLevel()
      Gets the enchantment level.
      Returns:
      the enchantment level
      Since:
      0.1.0
    • isArtificial

      public boolean isArtificial()
      Checks if this is an artificial enchantment.
      Returns:
      true if artificial, false if vanilla
      Since:
      0.1.0
    • setOverrideComponent

      public void setOverrideComponent(@Nullable @Nullable net.kyori.adventure.text.Component component)
      Sets an override component to replace the default formatted line.
      Parameters:
      component - the override component, or null to clear
      Since:
      0.1.0
    • getOverrideComponent

      @Nullable public @Nullable net.kyori.adventure.text.Component getOverrideComponent()
      Gets the override component if set.
      Returns:
      the override component, or null if not set
      Since:
      0.1.0