mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-26 22:33:43 +01:00
Fix not being able to place armor on anvil (#19)
* fix not being able to place armor on anvil * check for node on_rightclick on armor equip
This commit is contained in:
parent
7f63df230c
commit
3f1a952afb
@ -106,7 +106,14 @@ armor.register_armor = function(self, name, def)
|
|||||||
def.on_secondary_use = function(itemstack, player)
|
def.on_secondary_use = function(itemstack, player)
|
||||||
return armor:equip(player, itemstack)
|
return armor:equip(player, itemstack)
|
||||||
end
|
end
|
||||||
def.on_place = function(itemstack, player)
|
def.on_place = function(itemstack, player, pointed_thing)
|
||||||
|
if pointed_thing.type == "node" and player and not player:get_player_control().sneak then
|
||||||
|
local node = minetest.get_node(pointed_thing.under)
|
||||||
|
local ndef = minetest.registered_nodes[node.name]
|
||||||
|
if ndef and ndef.on_rightclick then
|
||||||
|
return ndef.on_rightclick(pointed_thing.under, node, player, itemstack, pointed_thing)
|
||||||
|
end
|
||||||
|
end
|
||||||
return armor:equip(player, itemstack)
|
return armor:equip(player, itemstack)
|
||||||
end
|
end
|
||||||
minetest.register_tool(name, def)
|
minetest.register_tool(name, def)
|
||||||
|
Loading…
Reference in New Issue
Block a user