mirror of
https://github.com/minetest/minetest.git
synced 2024-12-23 22:52:25 +01:00
Make global names in default mod use good naming convention and move backwards-compatibility definitions to mods/legacy
This commit is contained in:
parent
1fe5c58d56
commit
66f90a6101
@ -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
|
||||
--
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,7 @@ minetest.register_node("experimental:luafurnace", {
|
||||
inventory_image = minetest.inventorycube("furnace_front.png"),
|
||||
paramtype = "facedir_simple",
|
||||
metadata_name = "generic",
|
||||
material = digprop_stonelike(3.0),
|
||||
material = minetest.digprop_stonelike(3.0),
|
||||
})
|
||||
|
||||
minetest.register_on_placenode(function(pos, newnode, placer)
|
||||
|
2
data/mods/legacy/depends.txt
Normal file
2
data/mods/legacy/depends.txt
Normal file
@ -0,0 +1,2 @@
|
||||
default
|
||||
|
1029
data/mods/legacy/init.lua
Normal file
1029
data/mods/legacy/init.lua
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user