Page 1 of 4

[Mod] Protector [protector]

PostPosted: Wed Dec 26, 2012 15:49
by Zeg9
Image

This is another fork of glomie's protector mod (here).
As glomie's mod, it protects 5 blocks in all 6 directions.
It is also compatible with this mod: you can safely replace glomie's by this one, and this one by glomie's.

Changes are:
  • Multiple members per area (members can build within the area, but they can't remove or modify the protection block).
  • Admins can override protections with the "delprotect" privilege and by pressing shift while digging.
  • When you try to dig or build in a protected area, it says who the area belongs to.
  • A tool that allows to know who has protected the area, and who are the members.
  • A new recipe: doesn't require moreores.
  • A new texture.
  • Removed the Y -1000 limit

License is WTFPL

Crafting
Image

Download
As a .zip archive
Or browse code on github

Screenshots (click for full size)
Image Image Image Image

PostPosted: Wed Dec 26, 2012 15:50
by LorenzoVulcan
Nice mod :) +1.

PostPosted: Wed Dec 26, 2012 16:17
by InfinityProject
+1

PostPosted: Wed Dec 26, 2012 19:11
by 0gb.us
Zeg9 wrote:
  • Multiple members per area (members can build within the area, but they can't remove or modify the protection block).
  • When you try to dig or build in a protected area, it says who the area belongs to.
  • A tool that allows to know who has protected the area, and who are the members.
  • A new recipe: doesn't require moreores.
  • Removed the Y -1000 limit


Nice. All features I wanted.

Quick question: One of my servers currently used protector, with your modification to allow the sharing of areas. Can that be safely aliased to your new blocks, or is there some sort of incompatibility?

EDIT: I just realized the plugin name is the same, so an alias is not needed. But can the two be safely swapped?

PostPosted: Wed Dec 26, 2012 19:29
by Zeg9
0gb.us wrote:Can the two be safely swapped?

Yes, they can.

PostPosted: Wed Dec 26, 2012 21:42
by foxinsky
Is your protector also covering area in 5 blocks in each of six direction as a original glomie's mod ?

PostPosted: Thu Dec 27, 2012 04:37
by 0gb.us
According to the source code, yes.

PostPosted: Fri Dec 28, 2012 19:26
by 0gb.us
I added bucket/door/fire protection to protector:protect.

http://0gb.us/minetest/download.php?plugin=protector_0gb_us-0.0

I built it as a separate plugin so I wouldn't be dumping more code on you to maintain. As a separate plugin, I can update it myself as necessary. However, if you actually want to maintain this code, you are more than welcome to integrate it with your main protector plugin. Just let me know, and I'll take down my download link.

EDIT: Oh, since your original plugin is under the WTFPL, this one is too.

PostPosted: Fri Dec 28, 2012 19:42
by Zeg9
I think I'll add this in the main mod, soon or tomorrow. Thanks!
EDIT: Please keep the download link until it is added.

PostPosted: Fri Dec 28, 2012 20:17
by 0gb.us
If you already downloaded it, please re-download it. I found and fixed a flaw.

Also, both default and PilzAdam's signs are now supported.

EDIT: Similar support will be added to the Land Claims in the next update.

PostPosted: Tue Jan 08, 2013 08:31
by Oblivion1500
hey buddy, i think you forgot the little bit of code to add the craft item protector.node.... you have the stick but not the block, you may have it in your zip, not to sure but when i looked in gethub its not there... if you could fix that i would be grateful

PostPosted: Tue Jan 08, 2013 16:34
by Zeg9
Oblivion1500 wrote:hey buddy, i think you forgot the little bit of code to add the craft item protector.node.... you have the stick but not the block, you may have it in your zip, not to sure but when i looked in gethub its not there... if you could fix that i would be grateful


Thanks for reporting.
I really thought I had it, weird.
It is now fixed.

PostPosted: Tue Jan 08, 2013 22:32
by Oblivion1500
lol well, i was about to fix it myself but you were too quick lol you almost didnt have to do any work. not like it was a big hassle anyway.

PostPosted: Wed Jan 09, 2013 04:50
by Oblivion1500
sorry to have to let you know of another bug similar to the prev one, you need to make it so it makes 16 blocks, you only have it set to make 1.

PostPosted: Wed Jan 09, 2013 06:39
by 0gb.us
Oblivion1500 wrote:sorry to have to let you know of another bug similar to the prev one, you need to make it so it makes 16 blocks, you only have it set to make 1.


I don't think that's a bug, but the intended recipe.

Glomie's protector is overly generous, and gives you sixteen, but Zeg9 probably fixed that.

EDIT: Sorry, typo.

PostPosted: Wed Jan 09, 2013 09:07
by Oblivion1500
well i think 16 is a bit much anyway, you can make it so it gives say 8, and yea my mistake not a bug. The mod is great, i like the protection tool.. (i can run around and bang on my stuff and make sure its completely secure)

PostPosted: Wed Jan 09, 2013 11:20
by Zeg9
About the recipe, yeah, I forgot to make it give more blocks. I think it will yield 4 blocks or so.

Oblivion1500 wrote:i can run around and bang on my stuff and make sure its completely secure

I made it exactly for that :D

PostPosted: Sat Jan 12, 2013 05:03
by Oblivion1500
Sent you a gitpull request for that.

PostPosted: Sat Jan 12, 2013 09:57
by Zeg9
Updated; Added recipe screenies to first post.

PostPosted: Thu Mar 21, 2013 01:51
by Bas080
Really like this mod! Too bad it has such a small protection range. Can you make one that has 5x5x5 an other that is 25x25x25 and another that is 100x100x100. 100^3 uses mese block for recipe, 25^3 uses a mese crystal and 5^3 craft is good as is.

Also, can the admin or someone with adequate privs remove the protector node?

PostPosted: Thu Mar 21, 2013 03:23
by Sokomine
Someone did a mod that had a higher protection range. In my eyes, a larger range is questionable from the technical point of view - cubic is...cubic, so while searching 5^3/2 = 62.5 blocks at every dig/place seems to work fine, 100^3/2= 500000 is a diffrent number.....Considering how MT works, the chunk with your protection block might not even be loaded anymore when you fry your CPU after placing/digging a block.
If you want larger protections, use node_ownership. That works quite well and is far more efficient for such large areas. There are also other protection mods that might work and that function on mechanisms more suitable for large areas.

PostPosted: Sun Mar 31, 2013 22:59
by Luke123
This is a great mod for servers! Just one thing I would suggest, you should make it possible to change the distance it protects. Let's say about 50 blocks max of protection. Other than that, great mod!

- Luke

PostPosted: Mon Apr 01, 2013 01:58
by kaeza
Luke123 wrote:This is a great mod for servers! Just one thing I would suggest, you should make it possible to change the distance it protects. Let's say about 50 blocks max of protection. Other than that, great mod!

- Luke

Increasing the protection range can be bad for performance (imagine checking a 5³ cube vs a 50³ cube; it would be 100 times slower).
Anyway, this is not a bad idea.

PostPosted: Mon Apr 01, 2013 09:30
by Zeg9
It would be a lot better with more protection range. But it is just not possible/reasonable.
Or it could store all protected areas in a file, but I am not sure it's a good idea...

PostPosted: Mon Apr 01, 2013 12:14
by rarkenin
Zeg9 wrote:It would be a lot better with more protection range. But it is just not possible/reasonable.
Or it could store all protected areas in a file, but I am not sure it's a good idea...


That's the basis of landclaim_0gb_us. It works on chunks however. A per-node lookup would be almost as bad as having Minetest look it up by checking nodes.