run textcomponenttranslations through the ForgeI18N message format translator as well.

This commit is contained in:
cpw committed 2018-10-05 22:21:30 -04:00
1 parent e199e78a4f
commit 43ed744d46
2 files changed
+31

No files matched your search

@@ -0,0 +1,18 @@
package net.minecraftforge.fml;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextComponentTranslation;
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)));
return format.length();
} catch (IllegalArgumentException ex) {
return 0;
}
}
}