[Mod] Protector [protector]

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

by TenPlus1 » Post

It seems that cactus, tree blocks and doors can be placed in a protected areas without any problems, any idea why ??
Last edited by TenPlus1 on Sun Feb 16, 2014 09:57, edited 1 time in total.

RavonTUS
Member
Posts: 11
Joined: Mon Nov 11, 2013 18:02

by RavonTUS » Post

Greetings,

I like this mod, but the menu doesn't want to go away some times. Any one know a quick fix or how to add a "close menu" button?

-Ravon

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

by TenPlus1 » Post

Their seems to be a bug when adding a name to the protector block, once you add the name you cannot exit the interface properly, it keeps reappearing even after spamming the ESC key... Could you add a BACK button like your other mods please ?

NOTE: I've managed to fix the above problem by adding my own BACK button to the init.lua file, please find it attached...
Attachments

[The extension lua has been deactivated and can no longer be displayed.]

Last edited by TenPlus1 on Sun Feb 16, 2014 14:20, edited 1 time in total.

User avatar
Achilles
Member
Posts: 247
Joined: Sun Dec 15, 2013 11:55
In-game: Achilles
Location: Excuse Me???? -_-

by Achilles » Post

Nice mod...

Would be good if you could add other protection blocks that would protect a larger area and have a more expensive recipe.
The Ironic Thing About Common Sense Is That It Isn't Very Common

User avatar
Achilles
Member
Posts: 247
Joined: Sun Dec 15, 2013 11:55
In-game: Achilles
Location: Excuse Me???? -_-

by Achilles » Post

Erm... When i kept placing a normal cobblestone block on someones protected area in order get to the top of their house, The cobblestone block i kept placing at the start stayed in there protected area. When i tried to remove the cobble block it just said 'This are is owned by .....'. I don't know if this is a bug or what.
The Ironic Thing About Common Sense Is That It Isn't Very Common

User avatar
CraigyDavi
Member
Posts: 582
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio
In-game: CraigyDavi
Location: Hampshire, UK
Contact:

by CraigyDavi » Post

Achilles wrote:Erm... When i kept placing a normal cobblestone block on someones protected area in order get to the top of their house, The cobblestone block i kept placing at the start stayed in there protected area. When i tried to remove the cobble block it just said 'This are is owned by .....'. I don't know if this is a bug or what.
Was the cobblestone a stair/slab?

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

by TenPlus1 » Post

is their a way to stop users from placing rotatable blocks in this mod as things like doors, tree and stairs get through the protection... Water especially because griefers tend to water bomb protected areas for a laugh...

This is the current init.lua for the mod that I'm testing with if it helps anyone...
Attachments

[The extension lua has been deactivated and can no longer be displayed.]

Last edited by TenPlus1 on Wed Apr 09, 2014 19:11, edited 1 time in total.

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

by Krock » Post

TenPlus1 wrote:is their a way to stop users from placing rotatable blocks in this mod as things like doors, tree and stairs get through the protection... Water especially because griefers tend to water bomb protected areas for a laugh...

This is the current init.lua for the mod that I'm testing with if it helps anyone...
How about fixing the bucket? There were serval fixes in minetest_game about those things.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
CraigyDavi
Member
Posts: 582
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio
In-game: CraigyDavi
Location: Hampshire, UK
Contact:

by CraigyDavi » Post

This mod should be updated and use the minetest.is_protected feature.

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

by 4aiman » Post

CraigyDavi wrote:This mod should be updated and use the minetest.is_protected feature.
Would it be faster then?

User avatar
CraigyDavi
Member
Posts: 582
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio
In-game: CraigyDavi
Location: Hampshire, UK
Contact:

by CraigyDavi » Post

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 » Post

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: 3722
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

by TenPlus1 » Post

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
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

I had some free time and made a merge/pull request.
Tested the new codes with git-minetest_game, works.
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: 3722
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

by TenPlus1 » Post

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
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

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_ga ... t/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

Code: Select all

if minetest.is_protected(node_pos, player_name)
   return
end
and update builtin:
https://github.com/minetest/minetest/bl ... s.lua#L285
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: 3722
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

by TenPlus1 » Post

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

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 » Post

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:

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 » Post

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
Developer
Posts: 4650
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

Re: [Mod] Protector [protector]

by Krock » Post

@Nubelite, it's a nice idea but how to place blocks at Y -90000? The Y limit is at -31800 or somewhat
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

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

Re: [Mod] Protector [protector]

by Nubelite » Post

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 » Post

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 » Post

what does this mode do

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

Re: [Mod] Protector [protector]

by Topywo » Post

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: 3722
Joined: Mon Jul 29, 2013 13:38
In-game: TenPlus1
Contact:

Re: [Mod] Protector [protector]

by TenPlus1 » Post

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 108 times

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests