[Mod] Protector Redo [3.4] [protector]

Post Reply
User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

[Mod] Protector Redo [3.4] [protector]

by TenPlus1 » Post

Zeg's Protector mod has been around for a while and works really well, although the odd block did get through it's protection and the screwdriver managed to rotate 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... Player Factions and MineClone2 support added also :)
screenshot.jpg
screenshot.jpg (82.31 KiB) Viewed 2191 times
ContentDB: https://content.minetest.net/packages/T ... /protector

License: Code: MIT, Media: CC0 / CC-BY-SA 3.0

Lucky Blocks: 10

Usage:
  • Placing a Protector protects a defined area around itself (set by protector.radius)
  • Also protects signs from other people changing text and screwdriver from rotating nodes
  • Punching a Protector shows protected area as a coloured field which disappears after 10 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 'protection_bypass' 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

Code: Select all

S = Stone,  W = Wood,  I = Steel Ingot, C = Copper Ingot, G = Gold Ingot, B = Protector

Protection      Protected       Protected       Protected       Protector
Block	        Wood Door       Steel Door      Chest           Tool
+-+-+-+         +-+-+-+         +-+-+-+         +-+-+-+         +-+-+-+
|s|s|s|         | |w|w|         | |i|i|         |w|w|w|         |i|i|i|
+-+-+-+         +-+-+-+         +-+-+-+         +-+-+-+         +-+-+-+
|s|g|s|         | |w|c|         | |i|c|         |w|c|w|         |i|B|i|
+-+-+-+         +-+-+-+         +-+-+-+         +-+-+-+         +-+-+-+
|s|s|s|         | |w|w|         | |i|i|         |w|w|w|         |i|i|i|
+-+-+-+         +-+-+-+         +-+-+-+         +-+-+-+         +-+-+-+

Note: Place protector block into crafting to return protector logo and vice versa.
Settings:
Spoiler
The following lines can be added to your minetest.conf file to configure specific features of the mod:

protector_radius = 5
- Sets the area around each protection node so that other players cannot dig, place or enter through protected doors or chests.

protector_pvp = true
- true or false this setting disabled pvp inside of protected areas for all players apart from those listed on the protector node.

protector_night_pvp = true
- true or false this setting enables pvp in all areas at night time only except for spawn protection.

protector_spawn = 10
- Protect an area 10 nodes around static spawnpoint.

protector_hurt = 2
- When set to above 0, players digging in protected areas will be hurt by 2 health points (or whichever number it's set to)

protector_flip = true
- When true players who dig inside a protected area will flipped around to stop them using lag to grief into someone else's build
Last edited by TenPlus1 on Mon Oct 09, 2023 17:40, edited 99 times in total.

4aiman
Member
Posts: 1208
Joined: Mon Jul 30, 2012 05:47

Re: Protector mod Redo

by 4aiman » Post

+1

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

Re: Protector mod Redo

by Sokomine » Post

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.

User avatar
Bas080
Member
Posts: 398
Joined: Mon May 21, 2012 15:54
GitHub: bas080
IRC: bas080
In-game: bas080
Location: Netherlands

Re: Protector mod Redo

by Bas080 » Post

This is great. Keeping the good mods good, even making them beter!

User avatar
philipbenr
Member
Posts: 1897
Joined: Fri Jun 14, 2013 01:56
GitHub: philipbenr
IRC: philipbenr
In-game: robinspi
Location: United States

Re: Protector mod Redo

by philipbenr » Post

I like the mod TenPlus1. And the screenshot. ;)

User avatar
Krock
Developer
Posts: 4648
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: Protector mod Redo

by Krock » Post

Ah nice. I did the same a while again, just not that official.
Good to have a new version now.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Protector mod Redo

by TenPlus1 » Post

Thanks folks :) I've just added a new update to help hide the protection a little better...

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: Protector mod Redo

by Calinou » Post

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”?

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: Protector mod Redo

by TenPlus1 » Post

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.

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [mod] Protector Redo (0.5)

by TenPlus1 » Post

Protection radius can now be changed using protector.radius variable in init.lua, default is 5...

boo09
New member
Posts: 1
Joined: Mon Sep 22, 2014 19:09

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

by boo09 » Post

Ten how do until add it on kindle???

User avatar
Calinou
Moderator
Posts: 3169
Joined: Mon Aug 01, 2011 14:26
GitHub: Calinou
IRC: Calinou
In-game: Calinou
Location: Troyes, France
Contact:

Re: [mod] Protector Redo (0.5)

by Calinou » Post

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.

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

ADDED: Protected Doors (steel and wood) and Protected Chests that only players listed on Protection Nodes can open...

User avatar
digitalmouse
Member
Posts: 25
Joined: Sat Sep 20, 2014 18:26
GitHub: digitalmouse
IRC: digitalmouse
In-game: digitalmouse
Location: Kvistgård, Denmark
Contact:

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

by digitalmouse » Post

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!
Minetest experimental server running on 900Mhz Raspberry Pi: pi.god.jp:30000

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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)...

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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:
Attachments
itemframes(protector).zip
(3.33 KiB) Downloaded 269 times

Rochambeau
Member
Posts: 119
Joined: Tue Sep 23, 2014 11:37

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

by Rochambeau » Post

Could you add the function, that no hostile mobs spawn in protected areas?

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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

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...

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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

Miner59
Member
Posts: 46
Joined: Mon Sep 22, 2014 19:14

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

by Miner59 » Post

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:

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.

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

Miner59: feature added... thanks for suggestion...

User avatar
Kilarin
Member
Posts: 894
Joined: Mon Mar 10, 2014 00:36
GitHub: Kilarin

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

by Kilarin » Post

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!

User avatar
fireglow
Member
Posts: 93
Joined: Fri Mar 28, 2014 11:36
IRC: fireglow
In-game: fireglow
Location: Germany

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

by fireglow » Post

Big thanks for this updated mod!

freakedenough
Member
Posts: 12
Joined: Mon Mar 23, 2015 19:59

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

by freakedenough » Post

Stairs can't be placed upside-down when this mod is enabled..why?

Is there another one that works?

User avatar
TenPlus1
Member
Posts: 3700
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

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

by TenPlus1 » Post

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 :)
Attachments
stairs_min.zip
(1.13 KiB) Downloaded 242 times
Last edited by TenPlus1 on Tue Mar 31, 2015 21:26, edited 1 time in total.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 12 guests