Fix out of bounds exception when a token is at the end of a message.
@@ -58,7 +58,9 @@ public abstract class MessageProvider {
objects.add(TextSerializers.FORMATTING_CODE.deserialize(s[0]));
map.forEach(x -> {
objects.add(TextTemplate.arg(x.toString()));
+ if (objects.size() > x + 1) {
objects.add(TextSerializers.FORMATTING_CODE.deserialize(s[x + 1]));
+ }
});
return TextTemplate.of((Object[])objects.toArray(new Object[objects.size()]));
