[Mod] Protector [protector]

User avatar
CraigyDavi
Member
 
Posts: 565
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio or CraigyDavi
In-game: davisonio or CraigyDavi

by CraigyDavi » Thu Apr 10, 2014 08:41

4aiman wrote:
CraigyDavi wrote:This mod should be updated and use the minetest.is_protected feature.

Would it be faster then?

Probably. And it would mean that people cannot place water, doors and use screwdrivers ect. inside protected areas.
 

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

by 4aiman » Thu Apr 10, 2014 09:35

CraigyDavi wrote:cannot place water

Is it "cannot place" or "the water placed by someone wouldn't flow inside the protected area"?

As for the speed - needs testing.
If there's more than just convenience then all protective mods should consider updating.
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

by TenPlus1 » Thu Apr 10, 2014 13:19

Xanadu server has been changed so that water buckets cannot be placed around protector nodes and that includes the players nodes... A quick fix for now but it would be handy of Zeg would update this mod to use minetest's minetest.is_protected feature and cut the userlist down to 1 page for the protector blocks (we dont need that many ppl added)...
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Thu Apr 10, 2014 15:44

I had some free time and made a merge/pull request.
Tested the new codes with git-minetest_game, works.
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

by TenPlus1 » Thu Apr 10, 2014 16:25

Thanks for the changes Krock, worked fine although I did keep my formspec layout (easier to use with a back button)... Now we just gotta sort the rotatable objects and water buckets getting through protection... hrm...
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

by Krock » Thu Apr 10, 2014 16:38

TenPlus1 wrote:Thanks for the changes Krock, worked fine although I did keep my formspec layout (easier to use with a back button)... Now we just gotta sort the rotatable objects and water buckets getting through protection... hrm...

https://github.com/minetest/minetest_game/blob/master/mods/bucket/init.lua
Override with your bucket/init.lua and you get empty buckets back after a failed placing-try.
Rotateable objects is moreblocks? Somewhere else? just add
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
if minetest.is_protected(node_pos, player_name)
   return
end

and update builtin:
https://github.com/minetest/minetest/blob/master/builtin/misc_helpers.lua#L285
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

by TenPlus1 » Fri Apr 11, 2014 09:50

I just noticed that the new minetest bucket mod already has this included (and it still allows liquids to be placed in protected aread):

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
local function check_protection(pos, name, text)
    if minetest.is_protected(pos, name) then
        minetest.log("action", (name ~= "" and name or "A mod")
            .. " tried to " .. text
            .. " at protected position "
            .. minetest.pos_to_string(pos)
            .. " with a bucket")
        minetest.record_protection_violation(pos, name)
        return true
    end
    return false
end
 

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

by 4aiman » Fri Apr 11, 2014 12:17

TenPlus1 wrote:I just noticed that the new minetest bucket mod already has this included (and it still allows liquids to be placed in protected aread):


Maybe there's a bug in the protection mod?
'Cause misc.lua contains only this:
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
function minetest.is_protected(pos, name)
    return false
end

so we can't blame it...
Last edited by 4aiman on Fri Apr 11, 2014 12:17, edited 1 time in total.
 

Nubelite
Member
 
Posts: 161
Joined: Mon Jul 16, 2012 23:10

Re: [Mod] Protector [protector]

by Nubelite » Wed May 21, 2014 20:26

Here is an idea.

Instead of doing a search for a block in an area why not check one spot. There are two ways this can be done.

Dynamic Y
For dynamic y values, where they can be anything, At -90000 have new blocks be made. Lets call these blocks Protect_Stone. These Protect_Stone blocks would fill the -90000 area equal to that of the area the player places the block in. Say the area is 5x5x5. Using some code from world edit a 5x5x5 area placed at the (players y value)-90000. So now when a player tries to dig up a block the check is just Y-90000 instead of check almost every block in a 5x5x5 area.

Finite Y values
Another way to do is is to have a y value range say -100 to +100 be protected. If the player places a block at a y value of 50 then they get a y value protected area of -100 to +100. I do not mean -150 and +150, the y value of the placement of the block only determines what y value chunk they get. Then using a mod function or so the system just needs to check a -90000 + number block. ranges -100 to +100 get -90000, and then -300 to -101 get -90001. Instead of filling up a large space it is just a row of blocks in the x,z range that are filled.

Thought this might help performance wise.
 

User avatar
Krock
Member
 
Posts: 3598
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker

Re: [Mod] Protector [protector]

by Krock » Thu May 22, 2014 09:20

@Nubelite, it's a nice idea but how to place blocks at Y -90000? The Y limit is at -31800 or somewhat
Newest Win32 builds - Find a mod - All my mods
ALL YOUR DONATION ARE BELONG TO PARAMAT (Please support him and Minetest)
New DuckDuckGo !bang: !mtmod <keyword here>
 

Nubelite
Member
 
Posts: 161
Joined: Mon Jul 16, 2012 23:10

Re: [Mod] Protector [protector]

by Nubelite » Thu May 22, 2014 21:49

thought that was just the map size. didn't realize block placement was disabled for past it.
 

Thedarksoldier
New member
 
Posts: 8
Joined: Mon May 26, 2014 11:12
In-game: subham

Re: [Mod] Protector [protector]

by Thedarksoldier » Mon May 26, 2014 11:29

wht does this mode do pls tell me
 

Thedarksoldier
New member
 
Posts: 8
Joined: Mon May 26, 2014 11:12
In-game: subham

Re: [Mod] Protector [protector]

by Thedarksoldier » Mon May 26, 2014 11:30

what does this mode do
 

User avatar
Topywo
Member
 
Posts: 1718
Joined: Fri May 18, 2012 20:27

Re: [Mod] Protector [protector]

by Topywo » Mon May 26, 2014 11:41

Thedarksoldier wrote:what does this mode do


See the 1st post. The 1st post of mod releases describes what a mod does, most of the times there are also screenshots and crafting recipes in it.

"As glomie's mod, it protects 5 blocks in all 6 directions."

So you place a protector block. Then other players cannot dig or place 5 nodes (blocks), under, above, in front, at the back, to the left or to the right of it and the diagonals.


Edit: Removed double pasting.

Edit2: Diagonals
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Protector [protector]

by TenPlus1 » Wed May 28, 2014 21:51

Please find attached a reworked version of Protector mod re-written to work with Minetest 0.4.9...

Changes:

  • Now protects against tree, cactus, doors, liquid buckets and rotatable objects
  • Protector Stick removed, hold a Protector block and left-click for area information
  • Right-clicking Protector block allows shared name entry for an area, now has BACK button
  • Punching Protector block shows protection field in pink, disappears after 10 seconds
  • Users with 'delprotect' privs no longer have to hold down sneak in order to change protected blocks.
Attachments
protector(jkredo).zip
(4.83 KiB) Downloaded 114 times
 

User avatar
Achilles
Member
 
Posts: 246
Joined: Sun Dec 15, 2013 11:55
In-game: Achilles

Re: [Mod] Protector [protector]

by Achilles » Thu Jul 10, 2014 22:29

Any chance that when sand or gravel is dropped into a protected zone it will disappear?

Also water buckets seem to still get through the protection blocks...
 

User avatar
TenPlus1
Member
 
Posts: 1874
Joined: Mon Jul 29, 2013 13:38
GitHub: tenplus1

Re: [Mod] Protector [protector]

by TenPlus1 » Fri Jul 11, 2014 06:59

If you are using the latest Protector Redo mod and have updated to 0.4.10 then water and rotatable blocks shouldn't be an issue anymore... also... furnaces are protected from other players taking stuff from inside as well...

https://forum.minetest.net/viewtopic.php?f=9&t=9376&hilit=protector+redo

As for sand and gravel falling into a protected area, that cannot be stopped and all I can say is put a roof over your protected area...
 

User avatar
Achilles
Member
 
Posts: 246
Joined: Sun Dec 15, 2013 11:55
In-game: Achilles

Re: [Mod] Protector [protector]

by Achilles » Sat Jul 12, 2014 11:10

OK, have done already...
 

Soudon
Member
 
Posts: 167
Joined: Wed Apr 08, 2015 17:14
In-game: Soudon

Re: [Mod] Protector [protector]

by Soudon » Sat Jun 13, 2015 02:15

Ok in the screenshots it shows a purple square that shows the protection area how do you see that I cannot see a purple area and it would be really helpful
 

Soudon
Member
 
Posts: 167
Joined: Wed Apr 08, 2015 17:14
In-game: Soudon

Re: [Mod] Protector [protector]

by Soudon » Sat Jun 13, 2015 03:52

Was wondering where in the int.lua would I be able to change the area it protects say from the default 5 in all 6 to 10 in all 6?
 

Soudon
Member
 
Posts: 167
Joined: Wed Apr 08, 2015 17:14
In-game: Soudon

Re: [Mod] Protector [protector]

by Soudon » Sat Jun 13, 2015 05:19

Image

I downloaded the redo now I can change the radius and see the area also added my own texture to the protector box see what you think.
 

Previous

Return to Mod Releases

Who is online

Users browsing this forum: No registered users and 14 guests

cron