From a63d97d6371f1c55d38e3383fe4ceb8f7e91f08d Mon Sep 17 00:00:00 2001 From: teknomunk Date: Sun, 24 Nov 2024 06:58:25 -0600 Subject: [PATCH] Use creative arrow collection behavior from master (except they make pickup noises in creative), make all creative arrows infinity --- mods/ITEMS/mcl_bows/bow.lua | 1 + mods/ITEMS/vl_projectile/init.lua | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mods/ITEMS/mcl_bows/bow.lua b/mods/ITEMS/mcl_bows/bow.lua index 0505c20b6..c0727944f 100644 --- a/mods/ITEMS/mcl_bows/bow.lua +++ b/mods/ITEMS/mcl_bows/bow.lua @@ -108,6 +108,7 @@ local function player_shoot_arrow(itemstack, player, power, damage, is_critical) else arrow_itemstring = "mcl_bows:arrow" end + infinity_used = true else if not arrow_stack then return false diff --git a/mods/ITEMS/vl_projectile/init.lua b/mods/ITEMS/vl_projectile/init.lua index b53aa9cc4..8d33b372a 100644 --- a/mods/ITEMS/vl_projectile/init.lua +++ b/mods/ITEMS/vl_projectile/init.lua @@ -298,14 +298,15 @@ local function stuck_on_step(self, dtime, entity_def, projectile_def) if self._in_player then return true end -- Pickup arrow if player is nearby (not in Creative Mode) - if not self._collectable or self._removed then return end + if self._removed then return end local objects = minetest.get_objects_inside_radius(pos, 1) for i = 1,#objects do local obj = objects[i] if obj:is_player() then local player_name = obj:get_player_name() - if not minetest.is_creative_enabled(player_name) then + local creative = minetest.is_creative_enabled(player_name) + if self._collectable and not creative then local arrow_item = self._itemstring or self._arrow_item if arrow_item and minetest.registered_items[arrow_item] and obj:get_inventory():room_for_item("main", arrow_item) then obj:get_inventory():add_item("main", arrow_item)