mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2025-01-09 16:49:35 +01:00
One firework entity to rule them all
This commit is contained in:
parent
9ef0738a2e
commit
1a98c9ad2e
1 changed files with 4 additions and 4 deletions
|
@ -105,9 +105,9 @@ local firework_entity = {
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
vl_projectile.register("vl_fireworks:rocket", firework_entity)
|
||||||
|
|
||||||
local function register_rocket(n, duration, force)
|
local function register_rocket(n, duration, force)
|
||||||
def = table.copy(firework_entity)
|
|
||||||
vl_projectile.register("vl_fireworks:rocket_" .. n, def) -- TODO one entity
|
|
||||||
minetest.register_craftitem("vl_fireworks:rocket_" .. n, { -- TODO one item, use metadata
|
minetest.register_craftitem("vl_fireworks:rocket_" .. n, { -- TODO one item, use metadata
|
||||||
description = description,
|
description = description,
|
||||||
_tt_help = tt_help .. " " .. duration,
|
_tt_help = tt_help .. " " .. duration,
|
||||||
|
@ -127,13 +127,13 @@ local function register_rocket(n, duration, force)
|
||||||
on_place = function(itemstack, user, pointed_thing)
|
on_place = function(itemstack, user, pointed_thing)
|
||||||
local pos = pointed_thing.above
|
local pos = pointed_thing.above
|
||||||
-- pos.y = pos.y + 1
|
-- pos.y = pos.y + 1
|
||||||
vl_projectile.create("vl_fireworks:rocket_" .. n, {
|
vl_projectile.create("vl_fireworks:rocket", {
|
||||||
pos=pos,
|
pos=pos,
|
||||||
velocity=vector.new(0,1,0)
|
velocity=vector.new(0,1,0)
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
_on_dispense = function(dropitem, pos, droppos, dropnode, dropdir)
|
_on_dispense = function(dropitem, pos, droppos, dropnode, dropdir)
|
||||||
vl_projectile.create("vl_fireworks:rocket_" .. n, {
|
vl_projectile.create("vl_fireworks:rocket", {
|
||||||
pos=pos,
|
pos=pos,
|
||||||
velocity=vector.new(0,1,0)
|
velocity=vector.new(0,1,0)
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue