forked from mtcontrib/signs_lib
Compare commits
3 Commits
b0808a376a
...
60d67afab3
Author | SHA1 | Date | |
---|---|---|---|
60d67afab3 | |||
4dbfbec96e | |||
14efa6eeb7 |
14
api.lua
14
api.lua
@ -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
|
||||
|
Reference in New Issue
Block a user