Class ItemVisualProcessor.VisualContext
java.lang.Object
io.artificial.enchantments.optional.packetevents.ItemVisualProcessor.VisualContext
- Enclosing class:
ItemVisualProcessor
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 Summary
ConstructorsConstructorDescriptionVisualContext(@NotNull String enchantmentName, int level, boolean isArtificial) Creates a new visual context. -
Method Summary
Modifier and TypeMethodDescription@NotNull StringGets the enchantment display name.intgetLevel()Gets the enchantment level.@Nullable net.kyori.adventure.text.ComponentGets the override component if set.booleanChecks if this is an artificial enchantment.voidsetOverrideComponent(@Nullable net.kyori.adventure.text.Component component) Sets an override component to replace the default formatted line.
-
Constructor Details
-
VisualContext
Creates a new visual context.- Parameters:
enchantmentName- the display name of the enchantmentlevel- the enchantment levelisArtificial- whether this is an artificial enchantment- Throws:
NullPointerException- if enchantmentName is null- Since:
- 0.1.0
-
-
Method Details
-
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
-