This would improve cases where a Message is first constructed and then sent to a set of players. Currently the Message class will parse and generate the message again for each sendTo() call (variable replacement also does another run, but will find nothing to replace anymore).
Implementation:
- After parsing, save the result in the Message instance (currently a static result cache does not seem useful).
- After generating console or JSON output, save the result.
- When modified (appending, setting replacements), delete saved results.
- When sending only parse/generate when there is no saved result.
- Since Message instances are normally short-lived, reloading the message files would not cause problems.
This would improve cases where a Message is first constructed and then sent to a set of players. Currently the Message class will parse and generate the message again for each sendTo() call (variable replacement also does another run, but will find nothing to replace anymore).
Implementation: