forked from mtcontrib/arrow_signs
Fix for 0.4.10 (thx adrido)
This commit is contained in:
parent
129efd98d8
commit
bbbe7b2192
@ -1,3 +1,2 @@
|
|||||||
default
|
default
|
||||||
locks?
|
locks?
|
||||||
homedecor?
|
|
32
init.lua
32
init.lua
@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
arrow_signs={}
|
arrow_signs={}
|
||||||
|
|
||||||
|
arrow_signs.formspec = "field[text;Sign text:;${text}]";
|
||||||
|
|
||||||
arrow_signs_on_place = function(itemstack, placer, pointed_thing)
|
arrow_signs_on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
|
||||||
local posabove = pointed_thing.above
|
local posabove = pointed_thing.above
|
||||||
@ -127,31 +129,9 @@ function arrow_signs:create_lines(text)
|
|||||||
return text
|
return text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.override_item("default:sign_wall", {
|
||||||
local clone_registered = function(case,name)
|
groups = {choppy=2,dig_immediate=2,attached_node=1,sign=1},
|
||||||
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)
|
|
||||||
|
|
||||||
--Sign arrow
|
--Sign arrow
|
||||||
minetest.register_node("arrow_signs:wall", {
|
minetest.register_node("arrow_signs:wall", {
|
||||||
@ -187,7 +167,7 @@ minetest.register_node("arrow_signs:wall", {
|
|||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
--local n = minetest.get_node(pos)
|
--local n = minetest.get_node(pos)
|
||||||
local meta = minetest.get_meta(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", "\"\"")
|
meta:set_string("infotext", "\"\"")
|
||||||
end,
|
end,
|
||||||
on_receive_fields = function(pos, formname, fields, sender)
|
on_receive_fields = function(pos, formname, fields, sender)
|
||||||
|
Loading…
Reference in New Issue
Block a user