commit ebb9647f087bc49458e69a9d181f172594c54c16 Author: sys4-fr Date: Sat Sep 8 00:01:01 2018 +0200 Remplissage du dépôt. diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..6afbf45 --- /dev/null +++ b/README.txt @@ -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 +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 \ No newline at end of file diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..4ad96d5 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +default diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..3394e1a --- /dev/null +++ b/init.lua @@ -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") diff --git a/textures/MineToon/locked_sign_sign_wall_lock.png b/textures/MineToon/locked_sign_sign_wall_lock.png new file mode 100644 index 0000000..9318b82 Binary files /dev/null and b/textures/MineToon/locked_sign_sign_wall_lock.png differ diff --git a/textures/locked_sign_sign_wall_lock.png b/textures/locked_sign_sign_wall_lock.png new file mode 100644 index 0000000..6199a43 Binary files /dev/null and b/textures/locked_sign_sign_wall_lock.png differ