diff --git a/ontime_clocks/nodes.lua b/ontime_clocks/nodes.lua index 7b15369..9ae474c 100644 --- a/ontime_clocks/nodes.lua +++ b/ontime_clocks/nodes.lua @@ -47,6 +47,7 @@ minetest.register_node("ontime_clocks:green_digital", { }, tiles = {"ontime_clocks_digital.png"}, groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1}, + is_ground_content = false, display_entities = { ["ontime_clocks:display"] = { depth = 13/32 - 0.01, @@ -81,6 +82,7 @@ minetest.register_node("ontime_clocks:red_digital", { }, tiles = {"ontime_clocks_digital.png"}, groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1}, + is_ground_content = false, display_entities = { ["ontime_clocks:display"] = { depth = 13/32 - 0.01, @@ -114,6 +116,7 @@ minetest.register_node("ontime_clocks:white", { }, tiles = {"ontime_clocks_white.png"}, groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1}, + is_ground_content = false, display_entities = { ["ontime_clocks:display"] = { depth = 6/16 - 0.01, @@ -148,6 +151,7 @@ minetest.register_node("ontime_clocks:frameless_black", { }, tiles = {"ontime_clocks_frameless.png"}, groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1}, + is_ground_content = false, display_entities = { ["ontime_clocks:display"] = { depth = 7/16, @@ -182,6 +186,7 @@ minetest.register_node("ontime_clocks:frameless_gold", { }, tiles = {"ontime_clocks_frameless.png^[colorize:#FF0"}, groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1}, + is_ground_content = false, display_entities = { ["ontime_clocks:display"] = { depth = 7/16, @@ -216,6 +221,7 @@ minetest.register_node("ontime_clocks:frameless_white", { }, tiles = {"ontime_clocks_frameless.png^[colorize:#FFF"}, groups = {oddly_breakable_by_hand=1, not_blocking_trains=1, display_api=1}, + is_ground_content = false, display_entities = { ["ontime_clocks:display"] = { depth = 7/16, diff --git a/signs_api/init.lua b/signs_api/init.lua index 121c947..4b02f4e 100644 --- a/signs_api/init.lua +++ b/signs_api/init.lua @@ -170,6 +170,7 @@ function signs_api.register_sign(mod, name, model) model.width/2, model.height/2, 0.5 - model.depth}, }, groups = {choppy=2, dig_immediate=2, not_blocking_trains=1, display_api=1,signs_api_formspec_lbm=1}, + is_ground_content = false, sounds = default.node_sound_defaults(), display_entities = { ["signs:display_text"] = { @@ -183,21 +184,21 @@ function signs_api.register_sign(mod, name, model) }, on_place = display_api.on_place, on_construct = function(pos) - local ndef = minetest.registered_nodes[minetest.get_node(pos).name] - local meta = minetest.get_meta(pos) - meta:set_string("font", ndef and ndef.display_entities.font_name or - font_api.get_default_font_name()) - signs_api.set_formspec(pos) - display_api.on_construct(pos) - end, + local ndef = minetest.registered_nodes[minetest.get_node(pos).name] + local meta = minetest.get_meta(pos) + meta:set_string("font", ndef and ndef.display_entities.font_name or + font_api.get_default_font_name()) + signs_api.set_formspec(pos) + display_api.on_construct(pos) + end, on_destruct = display_api.on_destruct, on_blast = display_api.on_blast, on_rotate = signs_api.on_rotate, on_receive_fields = signs_api.on_receive_fields, on_punch = function(pos, node, player, pointed_thing) - signs_api.set_formspec(pos) - display_api.update_entities(pos) - end, + signs_api.set_formspec(pos) + display_api.update_entities(pos) + end, } -- Node fields override diff --git a/steles/nodes.lua b/steles/nodes.lua index d805adf..05cc71d 100644 --- a/steles/nodes.lua +++ b/steles/nodes.lua @@ -61,6 +61,7 @@ for i, material in ipairs(steles.materials) do }, }, groups = groups, + is_ground_content = false, display_entities = { ["steles:text"] = { on_display_update = font_api.on_display_update, @@ -72,32 +73,32 @@ for i, material in ipairs(steles.materials) do }, }, on_place = function(itemstack, placer, pointed_thing) - minetest.rotate_node(itemstack, placer, pointed_thing) - return display_api.on_place(itemstack, placer, pointed_thing) - end, + minetest.rotate_node(itemstack, placer, pointed_thing) + return display_api.on_place(itemstack, placer, pointed_thing) + end, on_construct = function(pos) - set_formspec(pos) - display_api.on_construct(pos) - end, + set_formspec(pos) + display_api.on_construct(pos) + end, on_rightclick = function(pos) - set_formspec(pos) - end, + set_formspec(pos) + end, on_destruct = display_api.on_destruct, on_blast = display_api.on_blast, on_rotate = display_api.on_rotate, on_receive_fields = function(pos, formname, fields, player) - if not minetest.is_protected(pos, player:get_player_name()) then - local meta = minetest.get_meta(pos) - if fields.ok or fields.font then - meta:set_string("display_text", fields.display_text) - meta:set_string("infotext", "\""..fields.display_text.."\"") - display_api.update_entities(pos) - end - if fields.font then - font_api.show_font_list(player, pos) - end + if not minetest.is_protected(pos, player:get_player_name()) then + local meta = minetest.get_meta(pos) + if fields.ok or fields.font then + meta:set_string("display_text", fields.display_text) + meta:set_string("infotext", "\""..fields.display_text.."\"") + display_api.update_entities(pos) end - end, + if fields.font then + font_api.show_font_list(player, pos) + end + end + end, on_punch = display_api.update_entities, }) end