fix facedir detection on coffee steam, increase ABM interval, fix indentation

This commit is contained in:
Vanessa Ezekowitz 2014-10-29 18:06:01 -04:00
parent 689f9a8b43
commit 71fb6f9e91

View File

@ -1182,28 +1182,40 @@ minetest.register_node("homedecor:coffee_maker", {
} }
}) })
local fdir_to_steampos = {
x = { 0.15, 0.275, -0.15, -0.275 },
z = { 0.275, -0.15, -0.275, 0.15 }
}
minetest.register_abm({ minetest.register_abm({
nodenames = "homedecor:coffee_maker", nodenames = "homedecor:coffee_maker",
interval = 1, interval = 2,
chance = 1, chance = 1,
action = function(pos, node) action = function(pos, node)
minetest.add_particlespawner({ local fdir = node.param2
amount = 1, if fdir and fdir < 4 then
time = 1,
minpos = {x=pos.x-0.15, y=pos.y-0.35, z=pos.z-0.275}, local steamx = fdir_to_steampos.x[fdir + 1]
maxpos = {x=pos.x-0.15, y=pos.y-0.35, z=pos.z-0.275}, local steamz = fdir_to_steampos.z[fdir + 1]
minvel = {x=-0.003, y=0.01, z=-0.003},
maxvel = {x=0.003, y=0.01, z=-0.003}, minetest.add_particlespawner({
minacc = {x=0.0,y=-0.0,z=-0.0}, amount = 1,
maxacc = {x=0.0,y=0.003,z=-0.0}, time = 1,
minexptime = 2, minpos = {x=pos.x - steamx, y=pos.y - 0.35, z=pos.z - steamz},
maxexptime = 5, maxpos = {x=pos.x - steamx, y=pos.y - 0.35, z=pos.z - steamz},
minsize = 1, minvel = {x=-0.003, y=0.01, z=-0.003},
maxsize = 1.2, maxvel = {x=0.003, y=0.01, z=-0.003},
collisiondetection = false, minacc = {x=0.0,y=-0.0,z=-0.0},
texture = "homedecor_steam.png", maxacc = {x=0.0,y=0.003,z=-0.0},
minexptime = 2,
maxexptime = 5,
minsize = 1,
maxsize = 1.2,
collisiondetection = false,
texture = "homedecor_steam.png",
}) })
end end
end
}) })
minetest.register_node("homedecor:dartboard", { minetest.register_node("homedecor:dartboard", {