mirror of
https://github.com/pyrollo/display_modpack.git
synced 2024-11-24 07:13:44 +01:00
Rotation after placement of steles and code style
This commit is contained in:
parent
ea36ed50d8
commit
78e3b85274
@ -21,17 +21,6 @@
|
|||||||
local S = steles.intllib
|
local S = steles.intllib
|
||||||
local F = function(...) return minetest.formspec_escape(S(...)) end
|
local F = function(...) return minetest.formspec_escape(S(...)) end
|
||||||
|
|
||||||
function steles.on_receive_fields(pos, formname, fields, player)
|
|
||||||
if not minetest.is_protected(pos, player:get_player_name()) then
|
|
||||||
local meta = minetest.get_meta(pos)
|
|
||||||
if fields and fields.ok then
|
|
||||||
meta:set_string("display_text", fields.display_text)
|
|
||||||
meta:set_string("infotext", "\""..fields.display_text.."\"")
|
|
||||||
display_lib.update_entities(pos)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
display_lib.register_display_entity("steles:text")
|
display_lib.register_display_entity("steles:text")
|
||||||
|
|
||||||
for i, material in ipairs(steles.materials) do
|
for i, material in ipairs(steles.materials) do
|
||||||
@ -65,7 +54,10 @@ for i, material in ipairs(steles.materials) do
|
|||||||
maxlines = 3,
|
maxlines = 3,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
on_place = display_lib.on_place,
|
on_place = function(itemstack, placer, pointed_thing)
|
||||||
|
minetest.rotate_node(itemstack, placer, pointed_thing)
|
||||||
|
display_lib.on_place(itemstack, placer, pointed_thing)
|
||||||
|
end,
|
||||||
on_construct = function(pos)
|
on_construct = function(pos)
|
||||||
local meta = minetest.get_meta(pos)
|
local meta = minetest.get_meta(pos)
|
||||||
meta:set_string("formspec", "size[6,4]"
|
meta:set_string("formspec", "size[6,4]"
|
||||||
@ -87,7 +79,8 @@ for i, material in ipairs(steles.materials) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_punch = function(pos, node, player, pointed_thing) display_lib.update_entities(pos) end,
|
on_punch = display_lib.update_entities,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user