From f467e43940d261ecb23cc5b293ff05485c4837d8 Mon Sep 17 00:00:00 2001 From: teknomunk Date: Tue, 10 Sep 2024 07:43:24 -0500 Subject: [PATCH] Restore tipped arrow entity registration as near copy of mcl_bows:arrow_entity --- mods/ITEMS/mcl_potions/tipped_arrow.lua | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_potions/tipped_arrow.lua b/mods/ITEMS/mcl_potions/tipped_arrow.lua index f053557fc..356dab45c 100644 --- a/mods/ITEMS/mcl_potions/tipped_arrow.lua +++ b/mods/ITEMS/mcl_potions/tipped_arrow.lua @@ -27,7 +27,8 @@ function mcl_potions.register_arrow(name, desc, color, def) local tt = def._tt or "" local groups = {ammo=1, ammo_bow=1, brewitem=1, _mcl_potion=1} if def.nocreative then groups.not_in_creative_inventory = 1 end - minetest.register_craftitem("mcl_potions:"..name.."_arrow", { + local arrow_item = "mcl_potions:"..name.."_arrow" + minetest.register_craftitem(arrow_item, { description = desc, _tt_help = arrow_tt .. "\n" .. tt, _dynamic_tt = def._dynamic_tt, @@ -80,6 +81,14 @@ function mcl_potions.register_arrow(name, desc, color, def) end, }) + -- Entity for older-style arrows + local arrow_entity = table.copy(mcl_bows.arrow_entity) + arrow_entity.on_activate = function(self, staticdata, dtime_s) + mcl_bows.arrow_entity.on_activate(self, staticdata, dtime_s) + self._arrow_item = arrow_item + end + minetest.register_entity("mcl_potions:"..name.."_arrow_entity", arrow_entity) + if minetest.get_modpath("mcl_bows") then minetest.register_craft({ output = "mcl_potions:"..name.."_arrow 8",