Package dev.majek.chattools
Interface MiniMessageWrapper.Builder
-
- All Superinterfaces:
net.kyori.adventure.util.Buildable.Builder<MiniMessageWrapper>
- Enclosing interface:
- MiniMessageWrapper
public static interface MiniMessageWrapper.Builder extends net.kyori.adventure.util.Buildable.Builder<MiniMessageWrapper>
A builder forMiniMessageWrapper.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description @NotNull MiniMessageWrapper.BuilderadvancedTransformations(boolean parse)Whether to parse advancedTransformationTypes on the final string to be parsed.@NotNull MiniMessageWrapperbuild()Build theMiniMessageWrapperready to parse.@NotNull MiniMessageWrapper.Buildergradients(boolean parse)Whether gradients on the final string should be parsed.@NotNull MiniMessageWrapper.BuilderhexColors(boolean parse)Whether hex colors on the final string should be parsed.@NotNull MiniMessageWrapper.BuilderlegacyColors(boolean parse)Whether legacy color codes on the final string should be parsed.@NotNull MiniMessageWrapper.BuilderplaceholderResolver(@NotNull net.kyori.adventure.text.minimessage.placeholder.PlaceholderResolver placeholderResolver)Set thePlaceholderResolverfor theMiniMessageinstance.@NotNull MiniMessageWrapper.BuilderpreventLuminanceBelow(int threshold)Prevent hex colors that have a luminance below a certain threshold.@NotNull MiniMessageWrapper.BuilderremoveColors(boolean blockCloseHex, @NotNull net.kyori.adventure.text.format.NamedTextColor... colors)TheNamedTextColors that should not be parsed.@NotNull MiniMessageWrapper.BuilderremoveTextDecorations(@NotNull net.kyori.adventure.text.format.TextDecoration... decorations)TheTextDecorations that should not be parsed.@NotNull MiniMessageWrapper.BuilderstandardColors(boolean parse)Whether all standard color codes on the final string should be parsed.
-
-
-
Method Detail
-
gradients
@NotNull @NotNull MiniMessageWrapper.Builder gradients(boolean parse)
Whether gradients on the final string should be parsed.- Parameters:
parse- whether to parse- Returns:
- this builder
-
hexColors
@NotNull @NotNull MiniMessageWrapper.Builder hexColors(boolean parse)
Whether hex colors on the final string should be parsed.- Parameters:
parse- whether to parse- Returns:
- this builder
-
standardColors
@NotNull @NotNull MiniMessageWrapper.Builder standardColors(boolean parse)
Whether all standard color codes on the final string should be parsed.- Parameters:
parse- whether to parse- Returns:
- this builder
-
legacyColors
@NotNull @NotNull MiniMessageWrapper.Builder legacyColors(boolean parse)
Whether legacy color codes on the final string should be parsed.- Parameters:
parse- whether to parse- Returns:
- this builder
-
advancedTransformations
@NotNull @NotNull MiniMessageWrapper.Builder advancedTransformations(boolean parse)
Whether to parse advancedTransformationTypes on the final string to be parsed. This includes click events, hover events, fonts, etc.- Parameters:
parse- whether to parse- Returns:
- this builder
-
removeTextDecorations
@NotNull @NotNull MiniMessageWrapper.Builder removeTextDecorations(@NotNull @NotNull net.kyori.adventure.text.format.TextDecoration... decorations)
TheTextDecorations that should not be parsed.- Parameters:
decorations- the decorations- Returns:
- this builder
-
placeholderResolver
@NotNull @NotNull MiniMessageWrapper.Builder placeholderResolver(@NotNull @NotNull net.kyori.adventure.text.minimessage.placeholder.PlaceholderResolver placeholderResolver)
Set thePlaceholderResolverfor theMiniMessageinstance.- Parameters:
placeholderResolver- the placeholder resolver- Returns:
- this builder
-
removeColors
@NotNull @NotNull MiniMessageWrapper.Builder removeColors(boolean blockCloseHex, @NotNull @NotNull net.kyori.adventure.text.format.NamedTextColor... colors)
TheNamedTextColors that should not be parsed.- Parameters:
blockCloseHex- whether to block hex codes that are close to blocked colorscolors- the colors- Returns:
- this builder
-
preventLuminanceBelow
@NotNull @NotNull MiniMessageWrapper.Builder preventLuminanceBelow(int threshold)
Prevent hex colors that have a luminance below a certain threshold. Luminance is measure 0 - 255. There's a method in
MiniMessageWrapperImplthat is used to calculate it. This is typically used to prevent very dark colors.Note: If you want to block the normal black color, remember to add it to
removeColors(boolean, NamedTextColor...)- Parameters:
threshold- all colors with luminance below this will not be parsed- Returns:
- this builder
-
build
@NotNull @NotNull MiniMessageWrapper build()
Build theMiniMessageWrapperready to parse.- Specified by:
buildin interfacenet.kyori.adventure.util.Buildable.Builder<MiniMessageWrapper>- Returns:
- the wrapper
-
-