Compare commits

...

3 Commits

Author SHA1 Message Date
flux
60d67afab3 force all signs into the sign group 2022-05-11 20:41:09 +02:00
fluxionary
4dbfbec96e remove sign entity if sign is gone (due to voxelmanip or such) (#9) 2022-05-10 19:47:15 -04:00
Luke aka SwissalpS
14efa6eeb7 hotfix fake player action 2022-03-09 01:10:54 +01:00

14
api.lua
View File

@@ -22,11 +22,9 @@ signs_lib.standard_yoffs = 0
signs_lib.standard_cpl = 35
signs_lib.standard_wood_groups = table.copy(default and minetest.registered_items["default:sign_wall_wood"].groups or {})
signs_lib.standard_wood_groups.sign = 1
signs_lib.standard_wood_groups.attached_node = nil
signs_lib.standard_steel_groups = table.copy(default and minetest.registered_items["default:sign_wall_steel"].groups or {})
signs_lib.standard_steel_groups.sign = 1
signs_lib.standard_steel_groups.attached_node = nil
signs_lib.standard_wood_sign_sounds = table.copy(default and minetest.registered_items["default:sign_wall_wood"].sounds or {})
@@ -167,7 +165,13 @@ minetest.register_entity("signs_lib:text", {
mesh = "signs_lib_standard_sign_entity_wall.obj",
textures = {},
static_save = true,
backface_culling = false
backface_culling = false,
on_activate = function(self)
local node = minetest.get_node(self.object:get_pos())
if minetest.get_item_group(node.name, "sign") == 0 then
self.object:remove()
end
end,
})
function signs_lib.delete_objects(pos)
@@ -722,6 +726,7 @@ end
function signs_lib.rightclick_sign(pos, node, player, itemstack, pointed_thing)
if not player or not signs_lib.can_modify(pos, player) then return end
if not player.get_meta then return end
player:get_meta():set_string("signslib:pos", minetest.pos_to_string(pos))
minetest.show_formspec(player:get_player_name(), "signs_lib:sign", get_sign_formspec(pos, node.name))
@@ -1022,6 +1027,9 @@ function signs_lib.register_sign(name, raw_def)
def.groups = signs_lib.standard_wood_groups
end
-- force all signs into the sign group
def.groups.sign = def.groups.sign or 1
local cbox = signs_lib.make_selection_boxes(35, 25)
def.selection_box = raw_def.selection_box or cbox