From 4ef15ae7642dc53945675e1f68e47db930f8144d Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sun, 8 Dec 2013 00:30:21 +0000 Subject: [PATCH] Fixed TranslatableComponents missing the end of the translated text --- .../md_5/bungee/api/chat/TranslatableComponent.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/api/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java b/api/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java index 9f96b010..f24d252d 100644 --- a/api/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java +++ b/api/src/main/java/net/md_5/bungee/api/chat/TranslatableComponent.java @@ -132,7 +132,10 @@ public class TranslatableComponent extends BaseComponent break; } } - + if ( trans.length() != position ) + { + builder.append( trans.substring( position, trans.length() ) ); + } } super.toPlainText( builder ); } @@ -143,6 +146,7 @@ public class TranslatableComponent extends BaseComponent String trans = locales.getString( translate ); if ( trans == null ) { + addFormat( builder ); builder.append( translate ); } else { @@ -173,7 +177,11 @@ public class TranslatableComponent extends BaseComponent break; } } - + if ( trans.length() != position ) + { + addFormat( builder ); + builder.append( trans.substring( position, trans.length() ) ); + } } super.toLegacyText( builder ); }