You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As of writing, the only way to send a FancyMessage to multiple players is to to call send(player) over and over again with calls toJSONString() each time. This might produce an overhead that can easily be removed by providing a send-method that takes an Iterable of players that calls toJSONString() once and sends this result to everybody:
Incorporating this would definitely be a good idea. Just one tiny little nitpick – repeatedly calling toJSONString() on the same FancyMessage object doesn't actually yield much overhead as long as you don't modify the object in between calls, since the object internally caches the JSON string on the first such call. Subsequent calls then return the cached string, as long as the object hasn't been made "dirty" by modifications in the meantime.
Oddly enough, I developed the caching functionality to address the problem of performance when sending to multiple players – but never once thought to do the convenient thing and just include a method like the one you've described above :|
As of writing, the only way to send a FancyMessage to multiple players is to to call
send(player)
over and over again with callstoJSONString()
each time. This might produce an overhead that can easily be removed by providing a send-method that takes an Iterable of players that callstoJSONString()
once and sends this result to everybody:The text was updated successfully, but these errors were encountered: