From b7e7274b9891c49ba688f15a99d9384d0a1f4358 Mon Sep 17 00:00:00 2001 From: BlackHole Date: Tue, 14 Jan 2020 19:30:07 +0100 Subject: [PATCH] #2750: Don't special case TextComponent constructor with a single extra --- .../md_5/bungee/api/chat/TextComponent.java | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java index dc5d5043c..2a3e77179 100644 --- a/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java +++ b/chat/src/main/java/net/md_5/bungee/api/chat/TextComponent.java @@ -173,26 +173,12 @@ public final class TextComponent extends BaseComponent */ public TextComponent(BaseComponent... extras) { + this(); if ( extras.length == 0 ) { return; } - if ( extras.length == 1 && extras[0] instanceof TextComponent ) - { - setText( ( (TextComponent) extras[0] ).getText() ); - List headExtra = extras[0].getExtra(); - if ( headExtra != null ) - { - for ( BaseComponent extra : headExtra ) - { - addExtra( extra.duplicate() ); - } - } - } else - { - setText( "" ); - setExtra( new ArrayList( Arrays.asList( extras ) ) ); - } + setExtra( new ArrayList( Arrays.asList( extras ) ) ); } /**