1
0
Fork 0

Add coarse dirt

objects
Wuzzy 2017-01-05 01:28:43 +01:00
parent 98a8df352b
commit 4ed8027099
4 changed files with 24 additions and 3 deletions

View File

@ -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',

View File

@ -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

View File

@ -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