mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-12-26 18:47:42 +01:00
#2750: Don't special case TextComponent constructor with a single extra
This commit is contained in:
parent
b70cb01413
commit
b7e7274b98
@ -173,26 +173,12 @@ 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 )
|
setExtra( new ArrayList<BaseComponent>( Arrays.asList( extras ) ) );
|
||||||
{
|
|
||||||
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 ) ) );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user