From 40da88505529bb4ed9c24f6a71820e61c3f26353 Mon Sep 17 00:00:00 2001 From: Juraj Vajda Date: Mon, 10 Oct 2022 09:25:40 -0400 Subject: [PATCH] dont return arrow when in creative --- init.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index de09258..bd02ffe 100644 --- a/init.lua +++ b/init.lua @@ -45,7 +45,7 @@ local function reset_charged_bow(player, includeWielded) local arrow = item_meta:get_string('arrow') -- return arrow - if arrow ~= '' then + if arrow ~= '' and not x_bows.is_creative(player:get_player_name()) then if inv:room_for_item('main', {name=arrow}) then inv:add_item('main', arrow) else @@ -105,11 +105,10 @@ function x_bows.register_bow(name, def) local arrow = item_meta:get_string('arrow') -- return arrow - if arrow ~= '' then + if arrow ~= '' and not x_bows.is_creative(dropper:get_player_name()) then minetest.item_drop(ItemStack({name=arrow, count=1}), dropper, {x=pos.x + 0.5, y=pos.y + 0.5, z=pos.z + 0.5}) end - itemstack:set_name(def.name) -- returns leftover itemstack return minetest.item_drop(itemstack, dropper, pos)