Correct toLegacyText the same way toPlainText was previously

This commit is contained in:
Thinkofdeath 2014-08-17 18:50:28 +01:00
parent 664c66fb97
commit e573f7b89c

View File

@ -173,13 +173,9 @@ public class TranslatableComponent extends BaseComponent
@Override @Override
protected void toLegacyText(StringBuilder builder) protected void toLegacyText(StringBuilder builder)
{ {
String trans = locales.getString( translate ); try
if ( trans == null )
{
addFormat( builder );
builder.append( translate );
} else
{ {
String trans = locales.getString( translate );
Matcher matcher = format.matcher( trans ); Matcher matcher = format.matcher( trans );
int position = 0; int position = 0;
int i = 0; int i = 0;
@ -212,6 +208,10 @@ public class TranslatableComponent extends BaseComponent
addFormat( builder ); addFormat( builder );
builder.append( trans.substring( position, trans.length() ) ); builder.append( trans.substring( position, trans.length() ) );
} }
} catch ( MissingResourceException e )
{
addFormat( builder );
builder.append( translate );
} }
super.toLegacyText( builder ); super.toLegacyText( builder );
} }