Hi!
I would like to contribute something to this game, but it's probably more of a personal interest of me, so before just sending a patch, I wanted to ask.
I'm working on various bridges from the minetest chat to other chat networks (mostly telegram at the moment). Bridging messages and events like server starting or stopping is easy; however now I want to announce deaths over the bridge as well (in Mineclone specifically, as that's what we're currently playing).
I've looked at the mcl_death_messages mod and it pretty much does all of what I want, except I can't use it because it doesn't expose a public API to build these death messages.
Now I'd like to send in a small patch which adds such an API; option one is a simple
Code: Select all
mcl_death_messages.format(player, reason)
(function name up for debate) so anyone can call it from any on_dieplayer observer. This function would of course also be used internally to generate the message. I have a patch of this approach ready, the downside is that it would be called once for each mod that uses it in on_dieplayer.
Option two would be less simple, but possibly more efficient: adding a custom event emitter to mcl_death_messages where other mods can register a callback. That way the internal logic can stay in the event handler and obversers only get notified when there's actually a valid death message.
Of course these options are not mutually exclusive, exposing both would be a possibility as well.
Now the question is: Is such a feature (which is mostly for mod devs) welcome in Mineclone? And which approach would be preferred?