Add "maphack" privilege for placing villages
This priv can later be re-used for other advanced map-changing tools
This commit is contained in:
parent
33234e0f48
commit
d4d7f710fc
6
mods/privs/init.lua
Normal file
6
mods/privs/init.lua
Normal file
@ -0,0 +1,6 @@
|
||||
local S = minetest.get_translator("privs")
|
||||
minetest.register_privilege("maphack", {
|
||||
description = S("Can make advanced changes to the map, like placing villages"),
|
||||
give_to_singleplayer = false,
|
||||
give_to_admin = false,
|
||||
})
|
2
mods/privs/locale/privs.de.tr
Normal file
2
mods/privs/locale/privs.de.tr
Normal file
@ -0,0 +1,2 @@
|
||||
# textdomain:privs
|
||||
Can make advanced changes to the map, like placing villages=Kann erweitere Änderungen an der Karte vornehmen, z.B. Dörfer platzieren
|
2
mods/privs/locale/template.txt
Normal file
2
mods/privs/locale/template.txt
Normal file
@ -0,0 +1,2 @@
|
||||
# textdomain:privs
|
||||
Can make advanced changes to the map, like placing villages=
|
1
mods/privs/mod.conf
Normal file
1
mods/privs/mod.conf
Normal file
@ -0,0 +1 @@
|
||||
name=privs
|
@ -3,4 +3,5 @@ util
|
||||
mobs
|
||||
goodies
|
||||
nav
|
||||
privs
|
||||
locks?
|
||||
|
@ -3,4 +3,4 @@ Village Entity Spawner=
|
||||
Village Spawner=
|
||||
Mapgen Village Spawner=
|
||||
(Has chance of not spawning village)=
|
||||
You need the “server” privilege to use this.=
|
||||
You need the “maphack” privilege to use this.=
|
||||
|
@ -3,4 +3,4 @@ Village Entity Spawner=Dorf-Entity-Erzeuger
|
||||
Village Spawner=Dorf-Erzeuger
|
||||
Mapgen Village Spawner=Kartengenerator-Dorf-Erzeuger
|
||||
(Has chance of not spawning village)=(Könnte das Dorf evtl. nicht erzeugen)
|
||||
You need the “server” privilege to use this.=Sie brauchen das „server“-Privileg, um dies benutzen zu können.
|
||||
You need the “maphack” privilege to use this.=Sie brauchen das „maphack“-Privileg, um dies benutzen zu können.
|
||||
|
@ -22,8 +22,8 @@ local shortseed = bitwise_and(mapseed, 0xFFFFFF)
|
||||
-- Nodes
|
||||
|
||||
local place_priv = function(itemstack, placer, pointed_thing)
|
||||
if not minetest.get_player_privs(placer:get_player_name()).server then
|
||||
minetest.chat_send_player(placer:get_player_name(), minetest.colorize("#FF0000", S("You need the “server” privilege to use this.")))
|
||||
if not minetest.get_player_privs(placer:get_player_name()).maphack then
|
||||
minetest.chat_send_player(placer:get_player_name(), minetest.colorize("#FF0000", S("You need the “maphack” privilege to use this.")))
|
||||
return itemstack
|
||||
end
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
|
Loading…
Reference in New Issue
Block a user