public class ScoreComponent extends AbstractBuildableComponent<ScoreComponent,ScoreComponent.Builder>
| Modifier and Type | Class and Description |
|---|---|
static class |
ScoreComponent.Builder
A score component builder.
|
AbstractBuildableComponent.AbstractBuilder<C extends BuildableComponent<C,B>,B extends AbstractBuildableComponent.AbstractBuilder<C,B>>bold, children, clickEvent, color, hoverEvent, insertion, italic, obfuscated, strikethrough, underlinedEMPTY_COMPONENT_LIST| Modifier | Constructor and Description |
|---|---|
protected |
ScoreComponent(@NonNull java.util.List<Component> children,
@Nullable TextColor color,
TextDecoration.State obfuscated,
TextDecoration.State bold,
TextDecoration.State strikethrough,
TextDecoration.State underlined,
TextDecoration.State italic,
@Nullable ClickEvent clickEvent,
@Nullable HoverEvent hoverEvent,
@Nullable java.lang.String insertion,
@NonNull java.lang.String name,
@NonNull java.lang.String objective,
@Nullable java.lang.String value) |
protected |
ScoreComponent(@NonNull ScoreComponent.Builder builder) |
| Modifier and Type | Method and Description |
|---|---|
@NonNull ScoreComponent |
append(@NonNull Component component)
Appends a component to this component.
|
static ScoreComponent.Builder |
builder()
Creates a score component builder.
|
static ScoreComponent.Builder |
builder(@NonNull java.lang.String name,
@NonNull java.lang.String objective)
Creates a score component builder with a name and objective.
|
@NonNull ScoreComponent |
clickEvent(@Nullable ClickEvent event)
Sets the click event of this component.
|
@NonNull ScoreComponent |
color(@Nullable TextColor color)
Sets the color of this component.
|
@NonNull ScoreComponent |
content(@NonNull java.lang.String value)
Sets the value.
|
@NonNull ScoreComponent |
copy()
Creates a component.
|
@NonNull ScoreComponent |
decoration(@NonNull TextDecoration decoration,
boolean flag)
Sets the state of a decoration on this component.
|
@NonNull ScoreComponent |
decoration(@NonNull TextDecoration decoration,
TextDecoration.State state)
Sets the value of a decoration on this component.
|
boolean |
equals(@Nullable java.lang.Object other) |
int |
hashCode() |
@NonNull ScoreComponent |
hoverEvent(@Nullable HoverEvent event)
Sets the hover event of this component.
|
@NonNull ScoreComponent |
insertion(@Nullable java.lang.String insertion)
Sets the string to be inserted when this component is shift-clicked.
|
@NonNull ScoreComponent |
mergeColor(@NonNull Component that)
Merges the color from another component into this component.
|
@NonNull ScoreComponent |
mergeDecorations(@NonNull Component that)
Merges the decorations from another component into this component.
|
@NonNull ScoreComponent |
mergeEvents(@NonNull Component that)
Merges the events from another component into this component.
|
@NonNull ScoreComponent |
mergeStyle(@NonNull Component that)
Merges styling from another component into this component.
|
@NonNull java.lang.String |
name()
Gets the score name.
|
@NonNull ScoreComponent |
name(@NonNull java.lang.String name)
Sets the score name.
|
@NonNull java.lang.String |
objective()
Gets the objective name.
|
@NonNull ScoreComponent |
objective(@NonNull java.lang.String objective)
Sets the score objective.
|
static ScoreComponent |
of(@NonNull java.lang.String name,
@NonNull java.lang.String objective)
Creates a score component with a name and objective.
|
static ScoreComponent |
of(@NonNull java.lang.String name,
@NonNull java.lang.String objective,
@Nullable java.lang.String value)
Creates a score component with a name, objective, and optional value.
|
protected void |
populateToString(com.google.common.base.MoreObjects.ToStringHelper builder) |
@NonNull ScoreComponent |
resetStyle()
Resets all styling on this component.
|
@NonNull ScoreComponent.Builder |
toBuilder()
Create a builder from this component.
|
@Nullable java.lang.String |
value()
Gets the value.
|
children, clickEvent, color, decoration, equals, hasStyling, hoverEvent, insertion, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitchildren, clickEvent, color, contains, decoration, decorations, decorations, detectCycle, hasDecoration, hasStyling, hoverEvent, insertion, of, of, of, of, of, ofprotected ScoreComponent(@NonNull ScoreComponent.Builder builder)
protected ScoreComponent(@NonNull java.util.List<Component> children, @Nullable TextColor color, TextDecoration.State obfuscated, TextDecoration.State bold, TextDecoration.State strikethrough, TextDecoration.State underlined, TextDecoration.State italic, @Nullable ClickEvent clickEvent, @Nullable HoverEvent hoverEvent, @Nullable java.lang.String insertion, @NonNull java.lang.String name, @NonNull java.lang.String objective, @Nullable java.lang.String value)
public static ScoreComponent.Builder builder()
public static ScoreComponent.Builder builder(@NonNull java.lang.String name, @NonNull java.lang.String objective)
name - the score nameobjective - the score objectivepublic static ScoreComponent of(@NonNull java.lang.String name, @NonNull java.lang.String objective)
name - the score nameobjective - the score objectivepublic static ScoreComponent of(@NonNull java.lang.String name, @NonNull java.lang.String objective, @Nullable java.lang.String value)
name - the score nameobjective - the score objectivevalue - the valuepublic @NonNull java.lang.String name()
public @NonNull ScoreComponent name(@NonNull java.lang.String name)
name - the score namepublic @NonNull java.lang.String objective()
public @NonNull ScoreComponent objective(@NonNull java.lang.String objective)
objective - the score objectivepublic @Nullable java.lang.String value()
public @NonNull ScoreComponent content(@NonNull java.lang.String value)
value - the valuepublic @NonNull ScoreComponent append(@NonNull Component component)
Componentcomponent - the component to appendpublic @NonNull ScoreComponent color(@Nullable TextColor color)
Componentcolor - the colorpublic @NonNull ScoreComponent decoration(@NonNull TextDecoration decoration, boolean flag)
Componentdecoration - the decorationflag - true if this component should have the decoration, false if
this component should not have the decorationpublic @NonNull ScoreComponent decoration(@NonNull TextDecoration decoration, TextDecoration.State state)
Componentdecoration - the decorationstate - TextDecoration.State#TRUE if this component should have the
decoration, TextDecoration.State#FALSE if this component should not
have the decoration, and TextDecoration.State#NOT_SET if the decoration
should not have a set valuepublic @NonNull ScoreComponent clickEvent(@Nullable ClickEvent event)
Componentevent - the click eventpublic @NonNull ScoreComponent hoverEvent(@Nullable HoverEvent event)
Componentevent - the hover eventpublic @NonNull ScoreComponent insertion(@Nullable java.lang.String insertion)
Componentinsertion - the insertion stringpublic @NonNull ScoreComponent mergeStyle(@NonNull Component that)
Componentthat - the other componentpublic @NonNull ScoreComponent mergeColor(@NonNull Component that)
Componentthat - the other componentpublic @NonNull ScoreComponent mergeDecorations(@NonNull Component that)
Componentthat - the other componentpublic @NonNull ScoreComponent mergeEvents(@NonNull Component that)
Componentthat - the other componentpublic @NonNull ScoreComponent resetStyle()
Componentpublic @NonNull ScoreComponent copy()
Componentpublic boolean equals(@Nullable java.lang.Object other)
equals in class AbstractComponentpublic int hashCode()
hashCode in class AbstractComponentprotected void populateToString(com.google.common.base.MoreObjects.ToStringHelper builder)
populateToString in class AbstractComponentpublic @NonNull ScoreComponent.Builder toBuilder()
BuildableComponent