mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-12-26 11:17:30 +01:00
Campfires make big smoke
Smells like carcenogens, yum
This commit is contained in:
parent
8b0097df71
commit
d489c954f5
@ -190,3 +190,38 @@ minetest.register_globalstep(function(dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
function mcl_campfires.generate_smoke(pos, haybale)
|
||||||
|
local smoke_timer
|
||||||
|
|
||||||
|
if haybale then
|
||||||
|
smoke_timer = 8
|
||||||
|
else
|
||||||
|
smoke_timer = 4.75
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.add_particle({
|
||||||
|
pos = pos,
|
||||||
|
velocity = vector.new(0, 1, 0),
|
||||||
|
texture = "mcl_particles_smoke.png",
|
||||||
|
size = 10,
|
||||||
|
acceleration = vector.new(0, 0.5, 0),
|
||||||
|
collisiondetection = true,
|
||||||
|
expirationtime = smoke_timer,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
label = "Campfire Smoke",
|
||||||
|
nodenames = {"group:lit_campfire"},
|
||||||
|
interval = 2,
|
||||||
|
chance = 2,
|
||||||
|
action = function(pos, node)
|
||||||
|
local node_below = vector.offset(pos, 0, -1, 0)
|
||||||
|
local haybale = false
|
||||||
|
if minetest.get_node(node_below).name == "mcl_farming:hay_block" then
|
||||||
|
haybale = true
|
||||||
|
end
|
||||||
|
mcl_campfires.generate_smoke(pos, haybale)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user