mirror of
https://github.com/pyrollo/display_modpack.git
synced 2024-08-20 04:34:05 +02: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 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")
|
||||
|
||||
for i, material in ipairs(steles.materials) do
|
||||
@ -65,7 +54,10 @@ for i, material in ipairs(steles.materials) do
|
||||
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)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("formspec", "size[6,4]"
|
||||
@ -87,7 +79,8 @@ for i, material in ipairs(steles.materials) do
|
||||
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user