Fix #5365: Some chat messages lose their formatting (#5386)

This commit is contained in:
mariaum 2019-01-25 17:19:49 -02:00 committed by LexManos
parent 7b867d0069
commit 6643997304

View file

@ -28,7 +28,9 @@ import java.util.List;
public class TextComponentMessageFormatHandler {
public static int handle(final TextComponentTranslation parent, final List<ITextComponent> children, final Object[] formatArgs, final String format) {
try {
children.add(new TextComponentString(ForgeI18n.parseFormat(format, formatArgs)));
TextComponentString component = new TextComponentString(ForgeI18n.parseFormat(format, formatArgs));
component.getStyle().setParentStyle(parent.getStyle());
children.add(component);
return format.length();
} catch (IllegalArgumentException ex) {
return 0;