Interface ComponentTransform


public interface ComponentTransform
  • Method Summary

    Modifier and Type
    Method
    Description
    nested​(ComponentTransform transform)
    Creates a transform that applies the given transform on all child components and the component itself.
    stripClicks​(net.kyori.adventure.text.event.ClickEvent.Action... actionsToRemove)
    Creates a transform that removes click events of the given actions from a component.
    @NonNull net.kyori.adventure.text.Component
    transform​(@NonNull net.kyori.adventure.text.Component original)
    Applies this transform on the given component and returns the result.
  • Method Details

    • nested

      static ComponentTransform nested(ComponentTransform transform)
      Creates a transform that applies the given transform on all child components and the component itself. The children are transformed before the component itself is transformed.
      Parameters:
      transform - the transform to apply.
      Returns:
      a new transform which is applied on all child components and the component itself.
    • stripClicks

      static ComponentTransform stripClicks(net.kyori.adventure.text.event.ClickEvent.Action... actionsToRemove)
      Creates a transform that removes click events of the given actions from a component. Note: To remove click events from children too, the returned transform must be wrapped using nested(ComponentTransform).
      Parameters:
      actionsToRemove - the actions used to filter which click events should be removed.
      Returns:
      a new transform that removes click events from a component.
    • transform

      @NonNull net.kyori.adventure.text.Component transform(@NonNull net.kyori.adventure.text.Component original)
      Applies this transform on the given component and returns the result.
      Parameters:
      original - the component to transform.
      Returns:
      the transformed component.