From 66f90a6101bd6c2402aa43397fc29435c72de2a1 Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Sat, 3 Dec 2011 20:25:21 +0200 Subject: Make global names in default mod use good naming convention and move backwards-compatibility definitions to mods/legacy --- data/builtin.lua | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) (limited to 'data/builtin.lua') diff --git a/data/builtin.lua b/data/builtin.lua index 5d6936d61..2f167acfa 100644 --- a/data/builtin.lua +++ b/data/builtin.lua @@ -340,6 +340,77 @@ minetest.craftitem_eat = function(hp_change) end end +-- +-- Default material types +-- + +function minetest.digprop_constanttime(time) + return { + diggability = "constant", + constant_time = time, + } +end + +function minetest.digprop_stonelike(toughness) + return { + diggablity = "normal", + weight = toughness * 5, + crackiness = 1, + crumbliness = -0.1, + cuttability = -0.2, + } +end + +function minetest.digprop_dirtlike(toughness) + return { + diggablity = "normal", + weight = toughness * 1.2, + crackiness = 0, + crumbliness = 1.2, + cuttability = -0.4, + } +end + +function minetest.digprop_gravellike(toughness) + return { + diggablity = "normal", + weight = toughness * 2, + crackiness = 0.2, + crumbliness = 1.5, + cuttability = -1.0, + } +end + +function minetest.digprop_woodlike(toughness) + return { + diggablity = "normal", + weight = toughness * 1.0, + crackiness = 0.75, + crumbliness = -1.0, + cuttability = 1.5, + } +end + +function minetest.digprop_leaveslike(toughness) + return { + diggablity = "normal", + weight = toughness * (-0.5), + crackiness = 0, + crumbliness = 0, + cuttability = 2.0, + } +end + +function minetest.digprop_glasslike(toughness) + return { + diggablity = "normal", + weight = toughness * 0.1, + crackiness = 2.0, + crumbliness = -1.0, + cuttability = -1.0, + } +end + -- -- Creative inventory -- -- cgit v1.2.3