mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2025-01-07 09:07:30 +01:00
Restore tipped arrow entity registration as near copy of mcl_bows:arrow_entity
This commit is contained in:
parent
c42b88ad09
commit
252684abed
@ -27,7 +27,8 @@ function mcl_potions.register_arrow(name, desc, color, def)
|
|||||||
local tt = def._tt or ""
|
local tt = def._tt or ""
|
||||||
local groups = {ammo=1, ammo_bow=1, brewitem=1, _mcl_potion=1}
|
local groups = {ammo=1, ammo_bow=1, brewitem=1, _mcl_potion=1}
|
||||||
if def.nocreative then groups.not_in_creative_inventory = 1 end
|
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,
|
description = desc,
|
||||||
_tt_help = arrow_tt .. "\n" .. tt,
|
_tt_help = arrow_tt .. "\n" .. tt,
|
||||||
_dynamic_tt = def._dynamic_tt,
|
_dynamic_tt = def._dynamic_tt,
|
||||||
@ -80,6 +81,14 @@ function mcl_potions.register_arrow(name, desc, color, def)
|
|||||||
end,
|
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
|
if minetest.get_modpath("mcl_bows") then
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "mcl_potions:"..name.."_arrow 8",
|
output = "mcl_potions:"..name.."_arrow 8",
|
||||||
|
Loading…
Reference in New Issue
Block a user