Merge pull request 'Fix a few on start warnings in torches' (#2775) from fix_torch_texture_warnings into master

Reviewed-on: MineClone2/MineClone2#2775
This commit is contained in:
cora 2022-10-14 10:12:19 +00:00
commit 1efaec526c
1 changed files with 16 additions and 6 deletions

View File

@ -171,6 +171,7 @@ function mcl_torches.register_torch(def)
light_source = def.light, light_source = def.light,
groups = groups, groups = groups,
drop = def.drop or itemstring, drop = def.drop or itemstring,
use_texture_alpha = "clip",
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
wall_bottom = {-2/16, -0.5, -2/16, 2/16, 1/16, 2/16}, wall_bottom = {-2/16, -0.5, -2/16, 2/16, 1/16, 2/16},
@ -226,7 +227,11 @@ function mcl_torches.register_torch(def)
return itemstack return itemstack
end, end,
on_rotate = false, on_rotate = false,
on_construct = def.particles and set_flames(pos, def.flame_type, "floor"), on_construct = function(pos)
if def.particles then
set_flames(pos, def.flame_type, "floor")
end
end,
on_destruct = def.particles and remove_flames, on_destruct = def.particles and remove_flames,
} }
minetest.register_node(itemstring, floordef) minetest.register_node(itemstring, floordef)
@ -246,13 +251,18 @@ function mcl_torches.register_torch(def)
light_source = def.light, light_source = def.light,
groups = groups_wall, groups = groups_wall,
drop = def.drop or itemstring, drop = def.drop or itemstring,
use_texture_alpha = "clip",
selection_box = { selection_box = {
type = "wallmounted", type = "wallmounted",
wall_side = {-0.5, -0.3, -0.1, -0.2, 0.325, 0.1}, wall_side = {-0.5, -0.3, -0.1, -0.2, 0.325, 0.1},
}, },
sounds = def.sounds, sounds = def.sounds,
on_rotate = false, on_rotate = false,
on_construct = def.particles and set_flames(pos, def.flame_type, "wall"), on_construct = function(pos)
if def.particles then
set_flames(pos, def.flame_type, "wall")
end
end,
on_destruct = def.particles and remove_flames, on_destruct = def.particles and remove_flames,
} }
minetest.register_node(itemstring_wall, walldef) minetest.register_node(itemstring_wall, walldef)