Page 1 of 1

[0.4.8] Protection support

PostPosted: Sat Nov 02, 2013 18:28
by ShadowNinja
Support for protection mods has recently been added to the Minetest API.
You can see an example of how protection mods should use this here.

Any mods that want to check if a position is protected should use minetest.is_protected(pos, playername). This is an improvement over having to use hacks like this.

This also allows you to do special things on protection violations, for example damaging or banning the player.

Protection mods that do not update will still work, mostly. Any mod that checks protection at a position will believe that the position is unprotected, whether or not it is.

You can get more details in lua_api.txt.

PostPosted: Sat Nov 02, 2013 18:54
by Inocudom
This is truly wonderful news.

PostPosted: Sat Nov 02, 2013 19:00
by rubenwardy
This is quite a vague topic.

  • Is it in cpp api, built in, or minetest_game?
  • Will protection mods automatically support it, or do they need to be updated?
  • Link to lua_api
  • [0.4.8]?

That's not really a hack.

PostPosted: Sat Nov 02, 2013 19:27
by Menche
It appears to be in builtin/*.lua.

PostPosted: Sat Nov 02, 2013 20:30
by Temperest
rubenwardy wrote:This is quite a vague topic.

  • Is it in cpp api, built in, or minetest_game?
  • Will protection mods automatically support it, or do they need to be updated?
  • Link to lua_api
  • [0.4.8]?

That's not really a hack.


To answer the questions: