diff options
author | rubenwardy <rw@rubenwardy.com> | 2018-04-04 18:30:47 +0100 |
---|---|---|
committer | rubenwardy <rw@rubenwardy.com> | 2018-04-04 18:30:47 +0100 |
commit | 28c59340eae2fa64a42e0c063343b9966b13a737 (patch) | |
tree | ee02607849b906a983662ddf5f090f1c4a72bf6f /triggers.lua | |
parent | d82972b44890611e6eb9dca506f4c2ead0b0ffa7 (diff) |
Implement conted_key trigger type
Diffstat (limited to 'triggers.lua')
-rw-r--r-- | triggers.lua | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/triggers.lua b/triggers.lua index f3fe708..e564bec 100644 --- a/triggers.lua +++ b/triggers.lua @@ -42,26 +42,26 @@ awards.register_trigger("join", { }) minetest.register_on_joinplayer(awards.notify_join) --- --- awards.register_trigger("dig", { --- type = "counted_key", --- progress = "@1/@2 dug", --- auto_description = { "Mine: @2", "Mine: @1×@2" }, --- 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 --- }) --- --- minetest.register_on_dignode(function(pos, oldnode, player) --- if not player or not pos or not oldnode then --- return --- end --- --- local node_name = oldnode.name --- node_name = minetest.registered_aliases[node_name] or node_name --- awards.notify_dig(player, node_name) --- end) + +awards.register_trigger("dig", { + type = "counted_key", + progress = "@1/@2 dug", + auto_description = { "Mine: @2", "Mine: @1×@2" }, + 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 +}) + +minetest.register_on_dignode(function(pos, oldnode, player) + if not player or not pos or not oldnode then + return + end + + local node_name = oldnode.name + node_name = minetest.registered_aliases[node_name] or node_name + awards.notify_dig(player, node_name) +end) -- -- awards.register_trigger("place", { -- type = "counted_key", |