mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-27 11:07:39 +01:00
#2750: Don't special case TextComponent constructor with a single extra
This commit is contained in:
parent
b70cb01413
commit
b7e7274b98
@ -173,27 +173,13 @@ public final class TextComponent extends BaseComponent
|
|||||||
*/
|
*/
|
||||||
public TextComponent(BaseComponent... extras)
|
public TextComponent(BaseComponent... extras)
|
||||||
{
|
{
|
||||||
|
this();
|
||||||
if ( extras.length == 0 )
|
if ( extras.length == 0 )
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ( extras.length == 1 && extras[0] instanceof TextComponent )
|
|
||||||
{
|
|
||||||
setText( ( (TextComponent) extras[0] ).getText() );
|
|
||||||
List<BaseComponent> headExtra = extras[0].getExtra();
|
|
||||||
if ( headExtra != null )
|
|
||||||
{
|
|
||||||
for ( BaseComponent extra : headExtra )
|
|
||||||
{
|
|
||||||
addExtra( extra.duplicate() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
{
|
|
||||||
setText( "" );
|
|
||||||
setExtra( new ArrayList<BaseComponent>( Arrays.asList( extras ) ) );
|
setExtra( new ArrayList<BaseComponent>( Arrays.asList( extras ) ) );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a duplicate of this TextComponent.
|
* Creates a duplicate of this TextComponent.
|
||||||
|
Loading…
Reference in New Issue
Block a user