diff --git a/registration.lua b/registration.lua index 346a9f7..c96cefe 100644 --- a/registration.lua +++ b/registration.lua @@ -156,3 +156,24 @@ if get_setting("build_arrow") then end }) end + +if get_setting("drop_arrow") then + throwing.register_arrow("arrow_drop", { + itemcraft = "default:copper_ingot", + craft_quantity = 16, + description = "Drop Arrow", + tiles = {"throwing_arrow_drop.png", "throwing_arrow_drop.png", "throwing_arrow_drop_back.png", "throwing_arrow_drop_front.png", "throwing_arrow_drop_2.png", "throwing_arrow_drop.png"}, + on_hit_sound = "throwing_build_arrow", + on_throw = function(_, thrower, next_index, data) + data.itemstack = thrower:get_inventory():get_stack("main", next_index) + data.index = next_index + thrower:get_inventory():set_stack("main", next_index, nil) + end, + on_hit = function(_, last_pos, _, _, hitter, data) + minetest.item_drop(ItemStack(data.itemstack), hitter, last_pos) + end, + on_hit_fails = function(_, thrower, data) + thrower:get_inventory():set_stack("main", data.index, data.itemstack) + end + }) +end diff --git a/textures/throwing_arrow_drop.png b/textures/throwing_arrow_drop.png new file mode 100644 index 0000000..b20c03b Binary files /dev/null and b/textures/throwing_arrow_drop.png differ diff --git a/textures/throwing_arrow_drop_2.png b/textures/throwing_arrow_drop_2.png new file mode 100644 index 0000000..3ebe136 Binary files /dev/null and b/textures/throwing_arrow_drop_2.png differ diff --git a/textures/throwing_arrow_drop_back.png b/textures/throwing_arrow_drop_back.png new file mode 100644 index 0000000..3657dc5 Binary files /dev/null and b/textures/throwing_arrow_drop_back.png differ diff --git a/textures/throwing_arrow_drop_front.png b/textures/throwing_arrow_drop_front.png new file mode 100644 index 0000000..0cba11d Binary files /dev/null and b/textures/throwing_arrow_drop_front.png differ