Include stack index it armor item callbacks

This commit is contained in:
stujones11
2017-04-15 17:54:39 +01:00
parent 16b0ee2d9e
commit 065815eec1
4 changed files with 38 additions and 38 deletions

View File

@ -107,7 +107,7 @@ armor:register_armor("mod_name:speed_boots", {
armor_groups = {fleshy=10, radiation=10},
damage_groups = {cracky=3, snappy=3, choppy=3, crumbly=3, level=1},
reciprocate_damage = true,
on_destroy = function(player, stack)
on_destroy = function(player, stack, index)
local pos = player:getpos()
if pos then
minetest.sound_play({
@ -140,10 +140,10 @@ Reciprocal tool damage will be done only by the first armor inventory item
Item Callbacks:
on_equip = func(player, stack)
on_unequip = func(player, stack)
on_destroy = func(player, stack)
on_damage = func(player, stack)
on_equip = func(player, stack, index)
on_unequip = func(player, stack, index)
on_destroy = func(player, stack, index)
on_damage = func(player, stack, index)
on_punch = func(player, hitter, time_from_last_punch, tool_capabilities)
Notes:
@ -157,9 +157,9 @@ When armor is destroyed `stack` will contain a copy of the previous stack.
Global Callbacks:
armor:register_on_update(func(player))
armor:register_on_equip(func(player, stack))
armor:register_on_unequip(func(player, stack))
armor:register_on_destroy(func(player, stack))
armor:register_on_equip(func(player, stack, index))
armor:register_on_unequip(func(player, stack, index))
armor:register_on_destroy(func(player, stack, index))
Global Callback Example: