New Luanti mod: privs_per_world
I wrote a novel mod for Luanti, specifically for Mineclonia. This mod is named privs_per_world (codeberg, ContentDB) and it is an engine for automatically granting and revoking privileges based on entering and leaving the various worlds (Overworld, Nether, End) of Mineclonia.
The default settings grant fast, fly, noclip to players entering the Nether, and revokes these privileges upon leaving.
The server admin can configure settings in minetest.conf. See settingtypes.txt, but it is easier to use settings.lua.
I know that the Mineclonia guys tend to adapt existing mods, so if there's some "worlds" mod that facilitates different "dimensions" and the transport to and from them, this might be useful elsewhere but I don't have any test environments for that.
Here is the default settings, which are useful for a Mineclonia survival server.
ppw.settings = {
nether = {
enter = {
give = core.settings:get("privs_per_world.nether_enter_give") or "fly,noclip,fast",
take = core.settings:get("privs_per_world.nether_enter_take") or "",
},
leave = {
give = core.settings:get("privs_per_world.nether_leave_give") or "",
take = core.settings:get("privs_per_world.nether_leave_take") or "fly,noclip,fast",
},
},
overworld = {
enter = {
give = core.settings:get("privs_per_world.overworld_enter_give") or "",
take = core.settings:get("privs_per_world.overworld_enter_take") or "",
},
leave = {
give = core.settings:get("privs_per_world.overworld_leave_give") or "",
take = core.settings:get("privs_per_world.overworld_leave_take") or "",
},
}
}
Future improvements
I might need to use mod storage to store privileges of user before entering/leaving the world, so we can restore them. But this would lose any privileges that change while the user is in the world. So register_on_grant_priv might be useful, if this mod's own set_privileges does not trigger those.
Comments