Page 1 of 6

[Mod] Protector Redo [2.0] [protector]

PostPosted: Thu May 29, 2014 09:37
by TenPlus1
Zeg's Protector mod has been around for a while and works really well, although the odd block does get through it's protection and the screwdriver tool still rotates protected nodes, so I reworked the mod to use Minetest 0.4.9's is_protected function so that nothing can slip by this protection mod...

Image

Download: https://github.com/tenplus1/protector/archive/master.zip

Source: https://github.com/tenplus1/protector

License: MIT

Lucky Blocks: 6

Usage:
  • Placing a Protector protects a defined area around itself (set by protector.radius in init.lua)
  • Also protects signs from other people changing text and using screwdriver to rotate nodes
  • Punching a Protector shows protected area as a coloured field and disappears after 5 seconds
  • Using a Protector as a tool shows information on that area to see if someone already owns it
  • Right-clicking a Protector allows you to share the area with other users, enter nick (exactly) and hit enter
  • Users with 'delprotect' privelage can bypass protection which is handy for admin
  • This mod is a drop-in replacement for current Protector mod by Zeg9

Also available are:
  • Protection Logo's (can be placed around your build without looking out of place)
  • Protected Wood and Steel Doors (only players on list can open
  • Protected Chests (as above, only players on list can access chest)

Crafts:
+ Spoiler

Changelog:
+ Spoiler

Settings:
+ Spoiler

Re: Protector mod Redo

PostPosted: Thu May 29, 2014 11:23
by 4aiman
+1

Re: Protector mod Redo

PostPosted: Thu May 29, 2014 13:43
by Sokomine
Nice picture :-) And good to see that the protector mod's beeing modernized. I personally still prefer the areas mod, but for small buildings, protector is far less complicated and easier to use for players.

Re: Protector mod Redo

PostPosted: Thu May 29, 2014 15:52
by Bas080
This is great. Keeping the good mods good, even making them beter!

Re: Protector mod Redo

PostPosted: Thu May 29, 2014 23:38
by philipbenr
I like the mod TenPlus1. And the screenshot. ;)

Re: Protector mod Redo

PostPosted: Fri May 30, 2014 13:53
by Krock
Ah nice. I did the same a while again, just not that official.
Good to have a new version now.

Re: Protector mod Redo

PostPosted: Sun Jun 15, 2014 08:17
by TenPlus1
Thanks folks :) I've just added a new update to help hide the protection a little better...

Re: Protector mod Redo

PostPosted: Sun Jun 15, 2014 19:44
by Calinou
What's the license? I'm interested for inclusion in Carbone, I've been looking for a simple protection mod like that.

You'll need to put up some license in order for this mod to be moved to Mod Releases. If you don't care about what people can do with the mod, release it under CC0.

As for the privilege name, I'd appreciate if there was an universal privilege for accessing locked containers as well as protected nodes. How about “access”?

Re: Protector mod Redo

PostPosted: Mon Jun 16, 2014 19:56
by TenPlus1
This mod is released under WTFPL license...

As for the 'locked' privelage, all of the locked items involved would have to be changed in some way to make this happen... e.g. If user != owner then NO, else if privelage = locked then YES... sorta thing in each locked chest, door etc.

Re: [mod] Protector Redo (0.5)

PostPosted: Tue Sep 02, 2014 09:11
by TenPlus1
Protection radius can now be changed using protector.radius variable in init.lua, default is 5...

Re: [Mod] Protector Redo [0.5] [protector]

PostPosted: Mon Sep 22, 2014 19:17
by boo09
Ten how do until add it on kindle???

Re: [mod] Protector Redo (0.5)

PostPosted: Mon Sep 22, 2014 21:17
by Calinou
TenPlus1 wrote:Protection radius can now be changed using protector.radius variable in init.lua, default is 5...


I suggest increasing it, right now you need to spam it quite a bit to cover large buildings.

Carbone uses 12 radius, which translates to a 25³ box. This is what PreciousStones (a CraftBukkit plugin) used for gold blocks and it was a smart choice there.

Re: [Mod] Protector Redo [0.6] [protector]

PostPosted: Fri Oct 03, 2014 17:17
by TenPlus1
ADDED: Protected Doors (steel and wood) and Protected Chests that only players listed on Protection Nodes can open...

Re: [Mod] Protector Redo [0.6] [protector]

PostPosted: Sun Oct 26, 2014 11:57
by digitalmouse
Looks cool, and trying it out now on my little Pi server. You don't say it explicitly, but are the areas protected only flat planes? or (like in WorldEdit) can I specify a cuboid/3-dimensional space to protect?

And lastly, do the markers remain visible for everyone? (unless there is a hide marker option i missed seeing in the old Zeg docs). Would look kinda weird of the land was filled with a bunch of little protector markers. :D

Otherwise, good job!

Re: [Mod] Protector Redo [0.6] [protector]

PostPosted: Sun Oct 26, 2014 16:40
by TenPlus1
If area protection is set to 5 (default) then 5 blocks all around the protection node (up/down, left/right, back/forward) is protected... You can punch the protector to see the purple field of the area protected also...

Protection blocks are simple to use and easy to see but the protection logo is a lot smaller and blends in a little better with it's background (copper ingot surrounded by stone)...

Re: [Mod] Protector Redo [0.6] [protector]

PostPosted: Sun Oct 26, 2014 16:48
by TenPlus1
On popular request I've remade the Item Frame mod so that it works with Protector Redo... Instead of frames and pedestals having owners, anyone can remove or place an item within but if inside a protected area then only the players listed in the protector node can access them...

Download below:

Re: [Mod] Protector Redo [0.6] [protector]

PostPosted: Tue Dec 09, 2014 20:06
by Rochambeau
Could you add the function, that no hostile mobs spawn in protected areas?

Re: [Mod] Protector Redo [0.6] [protector]

PostPosted: Wed Dec 10, 2014 09:09
by TenPlus1
This isn't a function for protector mod, it has to be placed inside the mobs mod you are using, e.g. for Mobs Redo, edit the api.lua file and add the following after line:794
Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
-- Check if protected area using bogus name so mobs will not spawn
if minetest.is_protected(pos, "-") then
   return
end


Update: this feature has been added to latest Mobs Redo...

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Fri Feb 13, 2015 19:20
by TenPlus1
Added new "To Inventory" and "To Chest" buttons so players can quickly copy everything across in 1-click... Also chests can now be named so you know what's inside just by hovering over it...

Image

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Sun Mar 01, 2015 22:32
by Miner59
Hi,
what can be really annoying is, when you hided your protection blocks somewhere and you need to find it again.
And it's extremely annoying when you set protector.radius too something like 15. :-)
Can you maybe add another line, where the location of the protection block is printed in the chat, when you punch an area with a protection block. I think this would be very useful sometimes. Here's my suggestion:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
               minetest.chat_send_player(whois,"This area is owned by "..meta:get_string("owner")..".")
               if meta:get_string("members") ~= "" then
                  minetest.chat_send_player(whois,"Members: "..meta:get_string("members")..".")
               end

--my suggestion is to add following line. It occurs 2 times, second time with position[1] instead of pos.
               minetest.chat_send_player(whois,"Protection block is located at: "..minetest.pos_to_string(pos))


Maybe only print it if you're the owner of the protection block or for admins, but I would print it everytime.

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Mon Mar 02, 2015 09:04
by TenPlus1
Miner59: feature added... thanks for suggestion...

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Tue Mar 03, 2015 23:31
by Kilarin
TenPlus1 wrote:
Miner59 wrote:Maybe only print it if you're the owner of the protection block or for admins, but I would print it everytime.
Miner59: feature added... thanks for suggestion...

Oh YES! Just tested this in Xanadu, and this is GREAT!

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Sun Mar 08, 2015 12:05
by fireglow
Big thanks for this updated mod!

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Sun Mar 29, 2015 20:04
by freakedenough
Stairs can't be placed upside-down when this mod is enabled..why?

Is there another one that works?

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Mon Mar 30, 2015 19:24
by TenPlus1
freakedenough: very strange indeed, stairs work fine with my own stairs mod but the build-in stairs wont rotate the stair upside-down... will look into it... thanks for letting me know...

Update: Minetest's built in stairs mod uses abm's to rotate stairs and slabs, but using this minimal version with rotate on place in effect it works fine with protector mod...

Unzip inside mods directory and enable 'stairs' for your world to replace built-in stairs mod and all should run fine :)

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Tue Mar 31, 2015 06:54
by freakedenough
Ive tried it. But it wont work with bakedclay mod
viewtopic.php?id=8890

error:
[code][/-------------
Separator
-------------

Irrlicht log: Irrlicht Engine version 1.8.1
Irrlicht log: (Build 9200)
Irrlicht log: Using renderer: OpenGL 4.0.0
Irrlicht log: Intel(R) HD Graphics 4000: Intel
Irrlicht log: OpenGL driver version is 1.2 or better.
Irrlicht log: GLSL version: 4.0
Irrlicht log: Resizing window (800 600)
08:52:55: ERROR[main]: ========== ERROR FROM LUA ===========
08:52:56: ERROR[main]: Failed to load and run script from
08:52:56: ERROR[main]: C:\Users\Admin\Desktop\minetest-0.4.12\bin\..\games\minetest_game\mods\bakedclay\init.lua:
08:52:56: ERROR[main]: ...Desktop\minetest-0.4.12\bin\..\builtin\game\register.lua:60: Name stairs:stair_bakedclay_white does not follow naming conventions: "modname:" or ":" prefix required
08:52:56: ERROR[main]: stack traceback:
08:52:56: ERROR[main]: [C]: in function 'error'
08:52:56: ERROR[main]: ...Desktop\minetest-0.4.12\bin\..\builtin\game\register.lua:60: in function 'check_modname_prefix'
08:52:56: ERROR[main]: ...Desktop\minetest-0.4.12\bin\..\builtin\game\register.lua:96: in function 'register_item'
08:52:56: ERROR[main]: ...Desktop\minetest-0.4.12\bin\..\builtin\game\register.lua:161: in function 'register_node'
08:52:56: ERROR[main]: ...t-0.4.12\bin\..\games\minetest_game\mods\stairs\init.lua:5: in function 'register_stair'
08:52:56: ERROR[main]: ...t-0.4.12\bin\..\games\minetest_game\mods\stairs\init.lua:63: in function 'register_stair_and_slab'
08:52:56: ERROR[main]: ....4.12\bin\..\games\minetest_game\mods\bakedclay\init.lua:49: in main chunk
08:52:56: ERROR[main]: ======= END OF ERROR FROM LUA ========
08:52:56: ERROR[main]: Server: Failed to load and run C:\Users\Admin\Desktop\minetest-0.4.12\bin\..\games\minetest_game\mods\bakedclay\init.lua
08:52:56: ERROR[main]: ModError: ModError: Failed to load and run C:\Users\Admin\Desktop\minetest-0.4.12\bin\..\games\minetest_game\mods\bakedclay\init.luacode]

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Tue Mar 31, 2015 19:11
by Evergreen
This error doesn't have anything to do with the protector mod, it appears the error is coming from a 'bakedclay' mod.

Re: [Mod] Protector Redo [0.7] [protector]

PostPosted: Tue Mar 31, 2015 20:59
by TenPlus1
Re-download the stairs_min.zip file and unpack stairs into mod folder, it should work fine this time around...

Re: [Mod] Protector Redo [0.8] [protector]

PostPosted: Wed Apr 01, 2015 10:17
by TenPlus1
Update: Protector Redo 0.8 released which now works with Minetest 0.4.12, will leave a download link below for 0.7 to run on previous minetest versions...

Re: [Mod] Protector Redo [0.9] [protector]

PostPosted: Mon Apr 27, 2015 07:18
by TenPlus1
Quick notice: An overlap bug was fixed in the latest Protector Redo and I would advise anyone using this mod to install the latest version from the front page...