fixed not working in version 0.4.10

This commit is contained in:
adrido 2014-07-20 08:22:02 +02:00
parent 7f84a95d1e
commit d252588de1

View File

@ -5,7 +5,7 @@
arrow_signs={}
arrow_signs.formspec = "field[text;Sign text:;${text}]";
function arrow_signs:savetext(pos, formname, fields, sender)
if not minetest.get_player_privs(sender:get_player_name())["interact"] then
@ -35,33 +35,9 @@ function arrow_signs:create_lines(text)
return text
end
local clone_registered = function(case,name)
local params = {}
local list
if case == "item" then list = minetest.registered_items end
if case == "node" then list = minetest.registered_nodes end
if case == "craftitem" then list = minetest.registered_craftitems end
if case == "tool" then list = minetest.registered_tools end
if case == "entity" then list = minetest.registered_entities end
if list then
for k,v in pairs(list[name]) do
params[k] = v
end
end
return params
end
-- usage
local node = clone_registered("node","default:sign_wall")
if node.legacy_wallmounted then
node.groups = {choppy=2,dig_immediate=2,attached_node=1,sign=1}
else
node.groups = {choppy=2,dig_immediate=2,sign=1}
end
minetest.register_node(":default:sign_wall", node)
minetest.override_item("default:sign_wall", {
groups = {choppy=2,dig_immediate=2,attached_node=1,sign=1},
})
@ -91,7 +67,7 @@ minetest.register_node("arrow_signs:wall_right", {
on_construct = function(pos)
--local n = minetest.get_node(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "hack:sign_text_input")
meta:set_string("formspec", arrow_signs.formspec)
meta:set_string("infotext", "\"\"")
end,
on_receive_fields = function(pos, formname, fields, sender)
@ -123,7 +99,7 @@ minetest.register_node("arrow_signs:wall_left", {
on_construct = function(pos)
--local n = minetest.get_node(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "hack:sign_text_input")
meta:set_string("formspec", arrow_signs.formspec)
meta:set_string("infotext", "\"\"")
end,
on_receive_fields = function(pos, formname, fields, sender)
@ -154,7 +130,7 @@ minetest.register_node("arrow_signs:wall_up", {
on_construct = function(pos)
--local n = minetest.get_node(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "hack:sign_text_input")
meta:set_string("formspec", arrow_signs.formspec)
meta:set_string("infotext", "\"\"")
end,
on_receive_fields = function(pos, formname, fields, sender)
@ -185,7 +161,7 @@ minetest.register_node("arrow_signs:wall_down", {
on_construct = function(pos)
--local n = minetest.get_node(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "hack:sign_text_input")
meta:set_string("formspec", arrow_signs.formspec)
meta:set_string("infotext", "\"\"")
end,
on_receive_fields = function(pos, formname, fields, sender)