forked from LizzyFleckenstein03/Memeclone
Add coarse dirt
This commit is contained in:
parent
98a8df352b
commit
4ed8027099
|
@ -48,6 +48,13 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:coarse_dirt 4',
|
||||
recipe = {
|
||||
{'default:dirt', 'default:gravel'},
|
||||
{'default:gravel', 'default:dirt'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'default:stick 4',
|
||||
|
|
|
@ -235,6 +235,14 @@ minetest.register_node("default:dirt", {
|
|||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("default:coarse_dirt", {
|
||||
description = "Coarse Dirt",
|
||||
tiles = {"default_coarse_dirt.png"},
|
||||
is_ground_content = true,
|
||||
stack_max = 64,
|
||||
groups = {crumbly=3, soil=1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("default:gravel", {
|
||||
description = "Gravel",
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 20 KiB |
|
@ -2,13 +2,19 @@ local function create_soil(pos, inv)
|
|||
if pos == nil then
|
||||
return false
|
||||
end
|
||||
local node = minetest.env:get_node(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
local name = node.name
|
||||
local above = minetest.env:get_node({x=pos.x, y=pos.y+1, z=pos.z})
|
||||
local above = minetest.get_node({x=pos.x, y=pos.y+1, z=pos.z})
|
||||
if name == "default:dirt" or name == "default:dirt_with_grass" then
|
||||
if above.name == "air" then
|
||||
node.name = "farming:soil"
|
||||
minetest.env:set_node(pos, node)
|
||||
minetest.set_node(pos, node)
|
||||
return true
|
||||
end
|
||||
elseif name == "default:coarse_dirt" then
|
||||
if above.name == "air" then
|
||||
node.name = "default:dirt"
|
||||
minetest.set_node(pos, node)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue