mirror of
https://github.com/minetest-mods/throwing.git
synced 2025-01-09 17:50:25 +01:00
Add a drop arrow
This commit is contained in:
parent
307b2d60e6
commit
19f5864d67
@ -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
|
||||
|
BIN
textures/throwing_arrow_drop.png
Normal file
BIN
textures/throwing_arrow_drop.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 210 B |
BIN
textures/throwing_arrow_drop_2.png
Normal file
BIN
textures/throwing_arrow_drop_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 207 B |
BIN
textures/throwing_arrow_drop_back.png
Normal file
BIN
textures/throwing_arrow_drop_back.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 216 B |
BIN
textures/throwing_arrow_drop_front.png
Normal file
BIN
textures/throwing_arrow_drop_front.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 178 B |
Loading…
Reference in New Issue
Block a user