Mines should block placing nodes (Especially protection)

Mines are designed to regenerate... right now someone could use areas or protector to "claim" the mine, thus only they could mine it.

We should figure out a way to block players from claiming any part of a mine, this way if you have access to the mine you can mine it, rather than being unable to mine it because someone else claimed it.

Protectors I think will be simple, prevent all placement of nodes within a mine.

For blocking placing nodes that's simple, use minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)) if we return true then the node is denied placement.

So blocking placement of nodes would simply be a register_on_placenode when we get something check the pos is within a mine if so then return true to block it. (Maybe include another check for protectors, if it is, it must be far enough away to not claim it, else we report you can't claim a mine, or something)

Preventing someone from claiming the mine with protectors should then be simply have the admin claim the nodes around the mine, since nodes won't be permitted to be placed within a mine it should prevent someone from claiming it (at least with protectors).

Areas on the other hand will be much more difficult to catch, unless it exposes a public API so we could register the mines area as a area that can't be claimed, or claim it and update who can mine there with those on the list that should be permitted teleport permission (which will be an issue if it's a public mine cause everyone could mine/teleport there).

Todo:

  • Setup a minetest.register_on_placenode to block placing nodes within a mine (you will only be permitted to mine a mine).
  • Setup further checks for protectors in register_on_placenode that takes into account protector's claiming distance so that the protector can't be placed to close to the mine that it would claim a part of it.
  • Release this mod, we should be ready for the world to start using it.
Edited by ApolloX939