implement rudimentary builder experience (#60)

This commit is contained in:
pandaro 2017-04-23 13:11:25 +02:00 committed by cd2
parent e1b068bafe
commit d8880f5897
2 changed files with 11 additions and 0 deletions

View File

@ -513,6 +513,7 @@ minetest.register_node("default:glass", {
inventory_image = minetest.inventorycube("default_glass.png"),
paramtype = "light",
groups = {crumbly = 3},
builder_xp = 3,
})
-- wool

View File

@ -207,9 +207,19 @@ function xp.miner_xp()
end)
end
function xp.builder_xp()
minetest.register_on_placenode(function(pos, newnode, placer)
local builder_xp = minetest.registered_nodes[newnode.name].builder_xp
if builder_xp then
xp.add_xp(placer, builder_xp)
end
end)
end
xp.miner_xp()
xp.crafter_xp()
xp.explorer_xp()
xp.builder_xp()
xp.load_xp()
xp.load_levels()