mirror of
https://github.com/minetest-mods/throwing.git
synced 2025-01-10 02:00:27 +01:00
parent
05365af715
commit
ba249807f1
8
init.lua
8
init.lua
@ -225,12 +225,12 @@ function throwing.register_arrow(name, def)
|
|||||||
if minetest.setting_getbool("throwing.allow_arrow_placing") and pointed_thing.above then
|
if minetest.setting_getbool("throwing.allow_arrow_placing") and pointed_thing.above then
|
||||||
local playername = placer:get_player_name()
|
local playername = placer:get_player_name()
|
||||||
if not minetest.is_protected(pointed_thing.above, playername) then
|
if not minetest.is_protected(pointed_thing.above, playername) then
|
||||||
minetest.log("action", "Player "..playername.." placed arrow "..throwing.modname..":"..name.." at ("..pointed_thing.above.x..","..pointed_thing.above.y..","..pointed_thing.above.z..")")
|
minetest.log("action", "Player "..playername.." placed arrow "..name.." at ("..pointed_thing.above.x..","..pointed_thing.above.y..","..pointed_thing.above.z..")")
|
||||||
minetest.set_node(pointed_thing.above, {name = throwing.modname..":"..name})
|
minetest.set_node(pointed_thing.above, {name = name})
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
return itemstack
|
return itemstack
|
||||||
else
|
else
|
||||||
minetest.log("warning", "Player "..playername.." tried to place arrow "..throwing.modname..":"..name.." into a protected area at ("..pointed_thing.above.x..","..pointed_thing.above.y..","..pointed_thing.above.z..")")
|
minetest.log("warning", "Player "..playername.." tried to place arrow "..name.." into a protected area at ("..pointed_thing.above.x..","..pointed_thing.above.y..","..pointed_thing.above.z..")")
|
||||||
minetest.record_protection_violation(pointed_thing.above, playername)
|
minetest.record_protection_violation(pointed_thing.above, playername)
|
||||||
return itemstack
|
return itemstack
|
||||||
end
|
end
|
||||||
@ -266,7 +266,7 @@ function throwing.register_arrow(name, def)
|
|||||||
physical = false,
|
physical = false,
|
||||||
visual = "wielditem",
|
visual = "wielditem",
|
||||||
visual_size = {x = 0.125, y = 0.125},
|
visual_size = {x = 0.125, y = 0.125},
|
||||||
textures = {throwing.modname..":"..name},
|
textures = {name},
|
||||||
collisionbox = {0, 0, 0, 0, 0, 0},
|
collisionbox = {0, 0, 0, 0, 0, 0},
|
||||||
on_hit = def.on_hit,
|
on_hit = def.on_hit,
|
||||||
on_hit_sound = def.on_hit_sound,
|
on_hit_sound = def.on_hit_sound,
|
||||||
|
Loading…
Reference in New Issue
Block a user