From 9e55cfed6594e8790da54fc9d4af7647782b1fd7 Mon Sep 17 00:00:00 2001 From: the-real-herowl Date: Tue, 31 Dec 2024 03:04:36 +0100 Subject: [PATCH] Added a conversion for legacy fireworks --- mods/ITEMS/vl_fireworks/mod.conf | 2 +- mods/ITEMS/vl_fireworks/rockets.lua | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/vl_fireworks/mod.conf b/mods/ITEMS/vl_fireworks/mod.conf index efb925363..c3c8fb9d4 100644 --- a/mods/ITEMS/vl_fireworks/mod.conf +++ b/mods/ITEMS/vl_fireworks/mod.conf @@ -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 diff --git a/mods/ITEMS/vl_fireworks/rockets.lua b/mods/ITEMS/vl_fireworks/rockets.lua index f0e6c897d..c5bd9f579 100644 --- a/mods/ITEMS/vl_fireworks/rockets.lua +++ b/mods/ITEMS/vl_fireworks/rockets.lua @@ -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 +