Interface ComponentTransform
public interface ComponentTransform
-
Method Summary
Modifier and TypeMethodDescriptionstatic ComponentTransformnested(ComponentTransform transform) Creates a transform that applies the given transform on all child components and the component itself.static ComponentTransformstripClicks(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.ComponentApplies this transform on the given component and returns the result.
-
Method Details
-
nested
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.
- Since:
- 6.0.10
-
stripClicks
@SafeVarargs 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 usingnested(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.
- Since:
- 6.0.10
-
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.
- Since:
- 6.0.10
-