farming_plus/weed.lua

45 lines
985 B
Lua
Raw Normal View History

-- main `S` code in init.lua
local S
S = farming.S
2013-05-21 10:11:28 -07:00
minetest.register_node(":farming:weed", {
description = S("Weed"),
2013-05-21 10:11:28 -07:00
paramtype = "light",
sunlight_propagates = true,
walkable = false,
drawtype = "plantlike",
tiles = {"farming_weed.png"},
inventory_image = "farming_weed.png",
selection_box = {
type = "fixed",
fixed = {
{-0.5, -0.5, -0.5, 0.5, -0.5+4/16, 0.5}
},
},
2013-07-10 17:44:09 -07:00
groups = {snappy=3, flammable=2,plant=1},
2013-05-21 10:11:28 -07:00
sounds = default.node_sound_leaves_defaults()
})
minetest.register_abm({
nodenames = {"farming:soil_wet", "farming:soil"},
interval = 50,
chance = 10,
action = function(pos, node)
if minetest.find_node_near(pos, 4, {"farming:scarecrow", "farming:scarecrow_light"}) ~= nil then
2013-05-21 10:11:28 -07:00
return
end
pos.y = pos.y+1
if minetest.get_node(pos).name == "air" then
2013-05-21 10:11:28 -07:00
node.name = "farming:weed"
minetest.set_node(pos, node)
2013-05-21 10:11:28 -07:00
end
end
})
-- ========= FUEL =========
minetest.register_craft({
type = "fuel",
recipe = "farming:weed",
burntime = 1
})