/** * Merges the events from another component into this component. * * @param that the other component * @return this builder */ default @NonNull B mergeEvents(final @NonNull Component that) { if(that.clickEvent() != null) this.clickEvent(that.clickEvent()); if(that.hoverEvent() != null) this.hoverEvent(that.hoverEvent().copy()); // hard copy, hover events have a component return (B) this; }
/** * Merges the events from another component into this component. * * @param that the other component * @return this builder */ @SuppressWarnings("unchecked") default @NonNull B mergeEvents(final @NonNull Component that) { if(that.clickEvent() != null) this.clickEvent(that.clickEvent()); if(that.hoverEvent() != null) this.hoverEvent(that.hoverEvent().copy()); // hard copy, hover events have a component return (B) this; }
/** * Merges the events from another component into this component. * * @param that the other component * @return this builder */ @SuppressWarnings("unchecked") default @NonNull B mergeEvents(final @NonNull Component that) { if(that.clickEvent() != null) this.clickEvent(that.clickEvent()); if(that.hoverEvent() != null) this.hoverEvent(that.hoverEvent().copy()); // hard copy, hover events have a component return (B) this; }
@Override public @NonNull TranslatableComponent mergeEvents(final @NonNull Component that) { return new TranslatableComponent(this.children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, that.clickEvent(), that.hoverEvent(), this.insertion, this.key, this.args); }
@Override public @NonNull SelectorComponent mergeEvents(final @NonNull Component that) { return new SelectorComponent(this.children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, that.clickEvent(), that.hoverEvent(), this.insertion, this.pattern); }
@Override public @NonNull KeybindComponent mergeEvents(final @NonNull Component that) { return new KeybindComponent(this.children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, that.clickEvent(), that.hoverEvent(), this.insertion, this.keybind); }
@Override public @NonNull ScoreComponent mergeEvents(final @NonNull Component that) { return new ScoreComponent(this.children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, that.clickEvent(), that.hoverEvent(), this.insertion, this.name, this.objective, this.value); }
@Override public @NonNull KeybindComponent mergeEvents(final @NonNull Component that) { return new KeybindComponent(this.children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, that.clickEvent(), that.hoverEvent(), this.insertion, this.keybind); }
@Override public @NonNull KeybindComponent mergeEvents(final @NonNull Component that) { return new KeybindComponent(this.children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, that.clickEvent(), that.hoverEvent(), this.insertion, this.keybind); }
@Override public @NonNull TranslatableComponent mergeEvents(final @NonNull Component that) { return new TranslatableComponent(this.children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, that.clickEvent(), that.hoverEvent(), this.insertion, this.key, this.args); }
@Override public @NonNull TextComponent mergeEvents(final @NonNull Component that) { return new TextComponent(this.children, this.color, this.obfuscated, this.bold, this.strikethrough, this.underlined, this.italic, that.clickEvent(), that.hoverEvent(), this.insertion, this.content); }
private <B extends BuildableComponent.Builder<?, ?>> void mergeStyle(final Component component, final B builder, final C context) { builder.mergeColor(component); builder.mergeDecorations(component); builder.clickEvent(component.clickEvent()); Optional.ofNullable(component.hoverEvent()).ifPresent(hoverEvent -> { builder.hoverEvent(new HoverEvent( hoverEvent.action(), this.render(hoverEvent.value(), context) )); }); }
private <B extends BuildableComponent.Builder<?, ?>> void mergeStyle(final Component component, final B builder, final C context) { builder.mergeColor(component); builder.mergeDecorations(component); builder.clickEvent(component.clickEvent()); Optional.ofNullable(component.hoverEvent()).ifPresent(hoverEvent -> { builder.hoverEvent(new HoverEvent( hoverEvent.action(), this.render(hoverEvent.value(), context) )); }); }
private <B extends BuildableComponent.Builder<?, ?>> void mergeStyle(final Component component, final B builder, final C context) { builder.mergeColor(component); builder.mergeDecorations(component); builder.clickEvent(component.clickEvent()); Optional.ofNullable(component.hoverEvent()).ifPresent(hoverEvent -> { builder.hoverEvent(new HoverEvent( hoverEvent.action(), this.render(hoverEvent.value(), context) )); }); }
@Override public @NonNull SelectorComponent mergeStyle(final @NonNull Component that) { return new SelectorComponent(this.children, that.color(), that.decoration(TextDecoration.OBFUSCATED), that.decoration(TextDecoration.BOLD), that.decoration(TextDecoration.STRIKETHROUGH), that.decoration(TextDecoration.UNDERLINED), that.decoration(TextDecoration.ITALIC), that.clickEvent(), that.hoverEvent(), that.insertion(), this.pattern); }
@Override public @NonNull TextComponent mergeStyle(final @NonNull Component that) { return new TextComponent(this.children, that.color(), that.decoration(TextDecoration.OBFUSCATED), that.decoration(TextDecoration.BOLD), that.decoration(TextDecoration.STRIKETHROUGH), that.decoration(TextDecoration.UNDERLINE), that.decoration(TextDecoration.ITALIC), that.clickEvent(), that.hoverEvent(), that.insertion(), this.content); }
@Override public @NonNull ScoreComponent mergeStyle(final @NonNull Component that) { return new ScoreComponent(this.children, that.color(), that.decoration(TextDecoration.OBFUSCATED), that.decoration(TextDecoration.BOLD), that.decoration(TextDecoration.STRIKETHROUGH), that.decoration(TextDecoration.UNDERLINED), that.decoration(TextDecoration.ITALIC), that.clickEvent(), that.hoverEvent(), that.insertion(), this.name, this.objective, this.value); }
@Override public @NonNull KeybindComponent mergeStyle(final @NonNull Component that) { return new KeybindComponent(this.children, that.color(), that.decoration(TextDecoration.OBFUSCATED), that.decoration(TextDecoration.BOLD), that.decoration(TextDecoration.STRIKETHROUGH), that.decoration(TextDecoration.UNDERLINE), that.decoration(TextDecoration.ITALIC), that.clickEvent(), that.hoverEvent(), that.insertion(), this.keybind); }
@Override public @NonNull SelectorComponent mergeStyle(final @NonNull Component that) { return new SelectorComponent(this.children, that.color(), that.decoration(TextDecoration.OBFUSCATED), that.decoration(TextDecoration.BOLD), that.decoration(TextDecoration.STRIKETHROUGH), that.decoration(TextDecoration.UNDERLINE), that.decoration(TextDecoration.ITALIC), that.clickEvent(), that.hoverEvent(), that.insertion(), this.pattern); }
@Override public @NonNull KeybindComponent mergeStyle(final @NonNull Component that) { return new KeybindComponent(this.children, that.color(), that.decoration(TextDecoration.OBFUSCATED), that.decoration(TextDecoration.BOLD), that.decoration(TextDecoration.STRIKETHROUGH), that.decoration(TextDecoration.UNDERLINED), that.decoration(TextDecoration.ITALIC), that.clickEvent(), that.hoverEvent(), that.insertion(), this.keybind); }