use of org.spongepowered.api.text.TextTemplate in project Nucleus by NucleusPowered.
the class MessageProvider method getTextMessageWithTextFormat.
private Text getTextMessageWithTextFormat(String key, List<Text> textList) {
TextTemplate template = this.textTemplateMap.computeIfAbsent(key, k -> templateCreator(getMessageWithFormat(k)));
if (textList.isEmpty()) {
return template.toText();
}
Map<String, Text> objs = Maps.newHashMap();
for (int i = 0; i < textList.size(); i++) {
objs.put(String.valueOf(i), textList.get(i));
}
return template.apply(objs).build();
}
Aggregations