@@ -9,6 +9,28 @@ if not builtin_item or type(builtin_item.set_item) ~= "function" or type(builtin
99 return
1010end
1111
12+ local smoke_particles = {
13+ amount = 3 ,
14+ time = 0.1 ,
15+ minpos = vector .new (- 0.1 , - 0.1 , - 0.1 ),
16+ maxpos = vector .new (0.1 , 0.1 , 0.1 ),
17+ minvel = vector .new (0 , 2.5 , 0 ),
18+ maxvel = vector .new (0 , 2.5 , 0 ),
19+ minacc = vector .new (- 0.15 , - 0.02 , - 0.15 ),
20+ maxacc = vector .new (0.15 , - 0.01 , 0.15 ),
21+ minexptime = 4 ,
22+ maxexptime = 6 ,
23+ minsize = 5 ,
24+ maxsize = 5 ,
25+ collisiondetection = true ,
26+ texture = {
27+ name = " default_item_smoke.png"
28+ }
29+ }
30+ if minetest .features .particle_blend_clip then
31+ smoke_particles .texture .blend = " clip"
32+ end
33+
1234local item = {
1335 set_item = function (self , itemstring , ...)
1436 builtin_item .set_item (self , itemstring , ... )
@@ -29,22 +51,10 @@ local item = {
2951 gain = 1.0 ,
3052 max_hear_distance = 8 ,
3153 }, true )
32- minetest .add_particlespawner ({
33- amount = 3 ,
34- time = 0.1 ,
35- minpos = {x = p .x - 0.1 , y = p .y + 0.1 , z = p .z - 0.1 },
36- maxpos = {x = p .x + 0.1 , y = p .y + 0.2 , z = p .z + 0.1 },
37- minvel = {x = 0 , y = 2.5 , z = 0 },
38- maxvel = {x = 0 , y = 2.5 , z = 0 },
39- minacc = {x = - 0.15 , y = - 0.02 , z = - 0.15 },
40- maxacc = {x = 0.15 , y = - 0.01 , z = 0.15 },
41- minexptime = 4 ,
42- maxexptime = 6 ,
43- minsize = 5 ,
44- maxsize = 5 ,
45- collisiondetection = true ,
46- texture = " default_item_smoke.png"
47- })
54+ local ps = table .copy (smoke_particles )
55+ ps .minpos = vector .add (ps .minpos , p )
56+ ps .maxpos = vector .add (ps .maxpos , p )
57+ minetest .add_particlespawner (ps )
4858 end ,
4959
5060 on_step = function (self , dtime , ...)
0 commit comments