mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-04 07:37:31 +01:00
Added a conversion for legacy fireworks
This commit is contained in:
parent
cd9cc8b492
commit
9e55cfed65
@ -1,3 +1,3 @@
|
||||
name = vl_fireworks
|
||||
description = Adds fun fireworks to the game which players can use.
|
||||
depends = vl_projectile
|
||||
depends = vl_projectile, vl_legacy
|
||||
|
@ -199,3 +199,16 @@ local firework_def = {
|
||||
vl_fireworks.firework_def = table.copy(firework_def)
|
||||
|
||||
core.register_craftitem("vl_fireworks:rocket", firework_def)
|
||||
|
||||
-- legacy
|
||||
for i=1, 3 do
|
||||
vl_legacy.register_item_conversion("mcl_fireworks:rocket_"..i, nil, function(itemstack)
|
||||
itemstack:set_name("vl_fireworks:rocket")
|
||||
local meta = itemstack:get_meta()
|
||||
local tbl = vl_fireworks.firework_def._vl_fireworks_std_durs_forces[i]
|
||||
meta:set_float("vl_fireworks:duration", tbl[1])
|
||||
meta:set_int("vl_fireworks:force", tbl[2])
|
||||
tt.reload_itemstack_description(itemstack)
|
||||
end)
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user