forked from mff/locked_sign
Remplissage du dépôt.
This commit is contained in:
commit
ebb9647f08
33
README.txt
Normal file
33
README.txt
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
Minetest 0.4 mod: locked_sign
|
||||||
|
=============================
|
||||||
|
|
||||||
|
This can be found in:
|
||||||
|
https://github.com/kotolegokot/minetest-mod-locked_sign
|
||||||
|
|
||||||
|
License of source code
|
||||||
|
----------------------
|
||||||
|
Copyright (C) 2012 kotolegokot, Oleg Matveev <gkotolegokot@gmail.com>
|
||||||
|
See README.txt in each mod directory for information about other authors.
|
||||||
|
|
||||||
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU General Public License as published by
|
||||||
|
the Free Software Foundation; either version 2 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public License along
|
||||||
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
License of media (textures and sounds)
|
||||||
|
--------------------------------------
|
||||||
|
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||||
|
http://creativecommons.org/licenses/by-sa/3.0/
|
||||||
|
|
||||||
|
Authors of media files
|
||||||
|
-----------------------
|
||||||
|
Copyright (C) 2012 kotolegokot, Oleg Matveev <gkotolegokot@gmail.com>
|
1
depends.txt
Normal file
1
depends.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
default
|
67
init.lua
Normal file
67
init.lua
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
--[[
|
||||||
|
Mod by kotolegokot
|
||||||
|
Version 2012.8.13.0
|
||||||
|
]]
|
||||||
|
minetest.register_privilege("sign_editor", "Can edit all locked signs")
|
||||||
|
minetest.register_node("locked_sign:sign_wall_locked", {
|
||||||
|
description = "Locked Sign",
|
||||||
|
drawtype = "signlike",
|
||||||
|
tiles = {"locked_sign_sign_wall_lock.png"},
|
||||||
|
inventory_image = "locked_sign_sign_wall_lock.png",
|
||||||
|
wield_image = "locked_sign_sign_wall_lock.png",
|
||||||
|
paramtype = "light",
|
||||||
|
paramtype2 = "wallmounted",
|
||||||
|
sunlight_propagates = true,
|
||||||
|
walkable = false,
|
||||||
|
metadata_name = "sign",
|
||||||
|
selection_box = {
|
||||||
|
type = "wallmounted",
|
||||||
|
},
|
||||||
|
groups = {choppy=2,dig_immediate=2},
|
||||||
|
legacy_wallmounted = true,
|
||||||
|
sounds = default.node_sound_defaults(),
|
||||||
|
after_place_node = function(pos, placer)
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
meta:set_string("owner", placer:get_player_name() or "")
|
||||||
|
meta:set_string("infotext", "\"\" (owned by " .. placer:get_player_name() .. ")")
|
||||||
|
end,
|
||||||
|
on_construct = function(pos)
|
||||||
|
--local n = minetest.env:get_node(pos)
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
meta:set_string("formspec", "field[text;;${text}]")
|
||||||
|
meta:set_string("infotext", "\"\"")
|
||||||
|
end,
|
||||||
|
can_dig = function(pos,player)
|
||||||
|
local meta = minetest.env:get_meta(pos);
|
||||||
|
local owner = meta:get_string("owner")
|
||||||
|
local pname = player:get_player_name()
|
||||||
|
return pname == owner or pname == minetest.setting_get("name")
|
||||||
|
or minetest.check_player_privs(pname, {sign_editor=true})
|
||||||
|
end,
|
||||||
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
local owner = meta:get_string("owner")
|
||||||
|
local pname = sender:get_player_name()
|
||||||
|
if pname ~= owner and pname ~= minetest.setting_get("name")
|
||||||
|
and not minetest.check_player_privs(pname, {sign_editor=true}) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local meta = minetest.env:get_meta(pos)
|
||||||
|
fields.text = fields.text or ""
|
||||||
|
print((sender:get_player_name() or "").." wrote \""..fields.text..
|
||||||
|
"\" to sign at "..minetest.pos_to_string(pos))
|
||||||
|
meta:set_string("text", fields.text)
|
||||||
|
meta:set_string("infotext", "\"" .. fields.text .. "\" (owned by " .. sender:get_player_name() .. ")")
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "locked_sign:sign_wall_locked",
|
||||||
|
recipe = {
|
||||||
|
{"default:wood", "default:wood", "default:wood"},
|
||||||
|
{"default:wood", "default:wood", "default:steel_ingot"},
|
||||||
|
{"", "default:stick", ""},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_alias("sign_wall_locked", "locked_sign:sign_wall_locked")
|
BIN
textures/MineToon/locked_sign_sign_wall_lock.png
Normal file
BIN
textures/MineToon/locked_sign_sign_wall_lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
BIN
textures/locked_sign_sign_wall_lock.png
Normal file
BIN
textures/locked_sign_sign_wall_lock.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 645 B |
Loading…
Reference in New Issue
Block a user