diff --git a/mods/default/craft.lua b/mods/default/craft.lua index edefdae..f6a88f2 100644 --- a/mods/default/craft.lua +++ b/mods/default/craft.lua @@ -4,6 +4,7 @@ minetest.register_node("default:workbench", { description = "Workbench", tiles = {"default_workbench_top.png", "default_wooden_planks.png"}, groups = {choppy = 3}, + craft_xp = 10, on_construct = function(pos) local meta = minetest.get_meta(pos) meta:set_string("formspec", default.craft_form) diff --git a/mods/xp/init.lua b/mods/xp/init.lua index aed9d6d..34f9436 100644 --- a/mods/xp/init.lua +++ b/mods/xp/init.lua @@ -172,6 +172,17 @@ function xp.explorer_xp() end) end + +function xp.crafter_xp() + minetest.register_on_craft(function(itemstack, player) + local craft_xp = itemstack:get_definition().craft_xp + if craft_xp then + xp.add_xp(player, craft_xp) + end + end) +end + +xp.crafter_xp() xp.explorer_xp() xp.load_xp() xp.load_levels()