From 237525b518aaec2a8e30bc387062338f81d5b01a Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Wed, 13 Jun 2018 22:52:55 +0100 Subject: Add support for groups in triggers --- triggers.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'triggers.lua') diff --git a/triggers.lua b/triggers.lua index 1a7b311..32a0b85 100644 --- a/triggers.lua +++ b/triggers.lua @@ -64,7 +64,8 @@ awards.register_trigger("dig", { auto_description_total = { "Mine @1 block.", "Mine @1 blocks." }, get_key = function(self, def) return minetest.registered_aliases[def.trigger.node] or def.trigger.node - end + end, + key_is_item = true, }) minetest.register_on_dignode(function(pos, node, player) if not player or not pos or not node then @@ -84,7 +85,8 @@ awards.register_trigger("place", { auto_description_total = { "Place @1 block.", "Place @1 blocks." }, get_key = function(self, def) return minetest.registered_aliases[def.trigger.node] or def.trigger.node - end + end, + key_is_item = true, }) minetest.register_on_placenode(function(pos, node, player) if not player or not pos or not node then @@ -104,7 +106,8 @@ awards.register_trigger("craft", { auto_description_total = { "Craft @1 item", "Craft @1 items." }, get_key = function(self, def) return minetest.registered_aliases[def.trigger.item] or def.trigger.item - end + end, + key_is_item = true, }) minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv) if not player or itemstack:is_empty() then @@ -124,7 +127,8 @@ awards.register_trigger("eat", { auto_description_total = { "Eat @1 item", "Eat @1 items." }, get_key = function(self, def) return minetest.registered_aliases[def.trigger.item] or def.trigger.item - end + end, + key_is_item = true, }) minetest.register_on_item_eat(function(_, _, itemstack, player, _) if not player or itemstack:is_empty() then -- cgit v1.2.3