1
0
Fork 0
MineClone2/mods/farming/soil.lua

46 lines
1.2 KiB
Lua
Raw Normal View History

2015-06-29 17:55:56 +00:00
minetest.register_node("farming:soil", {
tiles = {"farming_soil.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png"},
2017-01-08 02:05:41 +00:00
description = "Farmland",
2015-06-29 17:55:56 +00:00
drop = "default:dirt",
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
2017-01-08 02:12:36 +00:00
-- 15/16 of the normal height
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
2015-06-29 17:55:56 +00:00
}
},
groups = {crumbly=3, not_in_creative_inventory=1,soil=2},
2017-01-04 21:59:18 +00:00
sounds = default.node_sound_dirt_defaults(),
2015-06-29 17:55:56 +00:00
})
minetest.register_node("farming:soil_wet", {
tiles = {"farming_soil_wet.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png", "default_dirt.png"},
2017-01-08 02:05:41 +00:00
description = "Hydrated Farmland",
2015-06-29 17:55:56 +00:00
drop = "default:dirt",
drawtype = "nodebox",
paramtype = "light",
node_box = {
type = "fixed",
fixed = {
2017-01-08 02:12:36 +00:00
{-0.5, -0.5, -0.5, 0.5, 0.4375, 0.5},
2015-06-29 17:55:56 +00:00
}
},
groups = {crumbly=3, not_in_creative_inventory=1,soil=3},
2017-01-04 21:59:18 +00:00
sounds = default.node_sound_dirt_defaults(),
2015-06-29 17:55:56 +00:00
})
minetest.register_abm({
nodenames = {"farming:soil"},
interval = 15,
chance = 3,
action = function(pos, node)
if minetest.find_node_near(pos, 3, {"default:water_source", "default:water_flowing"}) then
2015-06-29 17:55:56 +00:00
node.name = "farming:soil_wet"
minetest.set_node(pos, node)
2015-06-29 17:55:56 +00:00
end
end,
})