/** * Sets the insertion text for the current part. * * @param insertion the insertion text * @return this ComponentBuilder for chaining */ public ComponentBuilder insertion(String insertion) { current.setInsertion( insertion ); return this; }
component.setInsertion( object.get( "insertion" ).getAsString() );
/** * Retains only the specified formatting. * * @param retention the formatting to retain */ public void retain(FormatRetention retention) { if ( retention == FormatRetention.FORMATTING || retention == FormatRetention.NONE ) { setClickEvent( null ); setHoverEvent( null ); } if ( retention == FormatRetention.EVENTS || retention == FormatRetention.NONE ) { setColor( null ); setBold( null ); setItalic( null ); setUnderlined( null ); setStrikethrough( null ); setObfuscated( null ); setInsertion( null ); } }
setInsertion( component.getInsertion() );
component.setInsertion( object.get( "insertion" ).getAsString() );
BaseComponent(BaseComponent old) { setColor( old.getColorRaw() ); setBold( old.isBoldRaw() ); setItalic( old.isItalicRaw() ); setUnderlined( old.isUnderlinedRaw() ); setStrikethrough( old.isStrikethroughRaw() ); setObfuscated( old.isObfuscatedRaw() ); setInsertion( old.getInsertion() ); setClickEvent( old.getClickEvent() ); setHoverEvent( old.getHoverEvent() ); if ( old.getExtra() != null ) { for ( BaseComponent component : old.getExtra() ) { addExtra( component.duplicate() ); } } }