update to farming plus
|
@ -1,6 +1,8 @@
|
|||
===FARMING MOD for MINETEST-C55===
|
||||
by PilzAdam
|
||||
|
||||
Extended Version
|
||||
|
||||
Introduction:
|
||||
This mod adds farming to Minetest.
|
||||
|
||||
|
|
|
@ -0,0 +1,63 @@
|
|||
minetest.register_node("farming:banana_sapling", {
|
||||
description = "Banana Tree Sapling",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_banana_sapling.png"},
|
||||
inventory_image = "farming_banana_sapling.png",
|
||||
wield_image = "farming_banana_sapling.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = {dig_immediate=3,flammable=2},
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:banana_leaves", {
|
||||
drawtype = "allfaces_optional",
|
||||
tiles = {"farming_banana_leaves.png"},
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{
|
||||
items = {'farming:banana_sapling'},
|
||||
rarity = 20,
|
||||
},
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"farming:banana_sapling"},
|
||||
interval = 60,
|
||||
chance = 20,
|
||||
action = function(pos, node)
|
||||
farming:generate_tree(pos, "default:tree", "farming:banana_leaves", {"default:dirt", "default:dirt_with_grass"}, {["farming:banana"]=20})
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
if math.random(1, 100) > 5 then
|
||||
return
|
||||
end
|
||||
local tmp = {x=(maxp.x-minp.x)/2+minp.x, y=(maxp.y-minp.y)/2+minp.y, z=(maxp.z-minp.z)/2+minp.z}
|
||||
local pos = minetest.env:find_node_near(tmp, maxp.x-minp.x, {"default:dirt_with_grass"})
|
||||
if pos ~= nil then
|
||||
farming:generate_tree({x=pos.x, y=pos.y+1, z=pos.z}, "default:tree", "farming:banana_leaves", {"default:dirt", "default:dirt_with_grass"}, {["farming:banana"]=10})
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_node("farming:banana", {
|
||||
description = "Banana",
|
||||
tiles = {"farming_banana.png"},
|
||||
inventory_image = "farming_banana.png",
|
||||
wield_image = "farming_banana.png",
|
||||
drawtype = "torchlike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = {fleshy=3,dig_immediate=3,flammable=2},
|
||||
sounds = default.node_sound_defaults(),
|
||||
|
||||
on_use = minetest.item_eat(6),
|
||||
})
|
|
@ -0,0 +1,89 @@
|
|||
minetest.register_craftitem("farming:carrot_seed", {
|
||||
description = "Carrot Seeds",
|
||||
inventory_image = "farming_carrot_seed.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local above = minetest.env:get_node(pointed_thing.above)
|
||||
if above.name == "air" then
|
||||
above.name = "farming:carrot_1"
|
||||
minetest.env:set_node(pointed_thing.above, above)
|
||||
itemstack:take_item(1)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("farming:carrot_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_carrot_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+3/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:carrot_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_carrot_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+5/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:carrot_3", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_carrot_3.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+12/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:carrot", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_carrot_4.png"},
|
||||
drop = {
|
||||
max_items = 6,
|
||||
items = {
|
||||
{ items = {'farming:carrot_seed'} },
|
||||
{ items = {'farming:carrot_seed'}, rarity = 2},
|
||||
{ items = {'farming:carrot_seed'}, rarity = 5},
|
||||
{ items = {'farming:carrot_item'} },
|
||||
{ items = {'farming:carrot_item'}, rarity = 2 },
|
||||
{ items = {'farming:carrot_item'}, rarity = 5 }
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("farming:carrot_item", {
|
||||
description = "Carrot",
|
||||
inventory_image = "farming_carrot.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
})
|
||||
|
||||
farming:add_plant("farming:carrot", {"farming:carrot_1", "farming:carrot_2", "farming:carrot_3"}, 50, 20)
|
|
@ -0,0 +1,73 @@
|
|||
minetest.register_node("farming:cocoa_sapling", {
|
||||
description = "Cocoa Tree Sapling",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_cocoa_sapling.png"},
|
||||
inventory_image = "farming_cocoa_sapling.png",
|
||||
wield_image = "farming_cocoa_sapling.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = {dig_immediate=3,flammable=2},
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:cocoa_leaves", {
|
||||
drawtype = "allfaces_optional",
|
||||
tiles = {"farming_banana_leaves.png"},
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{
|
||||
items = {'farming:cocoa_sapling'},
|
||||
rarity = 20,
|
||||
},
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"farming:cocoa_sapling"},
|
||||
interval = 60,
|
||||
chance = 20,
|
||||
action = function(pos, node)
|
||||
farming:generate_tree(pos, "default:tree", "farming:cocoa_leaves", {"default:sand", "default:desert_sand"}, {["farming:cocoa"]=20})
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
if math.random(1, 100) > 5 then
|
||||
return
|
||||
end
|
||||
local tmp = {x=(maxp.x-minp.x)/2+minp.x, y=(maxp.y-minp.y)/2+minp.y, z=(maxp.z-minp.z)/2+minp.z}
|
||||
local pos = minetest.env:find_node_near(tmp, maxp.x-minp.x, {"default:desert_sand"})
|
||||
if pos ~= nil then
|
||||
farming:generate_tree(pos, "default:tree", "farming:cocoa_leaves", {"default:sand", "default:desert_sand"}, {["farming:cocoa"]=20})
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_node("farming:cocoa", {
|
||||
description = "Cocoa",
|
||||
tiles = {"farming_cocoa.png"},
|
||||
visual_scale = 0.5,
|
||||
inventory_image = "farming_cocoa.png",
|
||||
wield_image = "farming_cocoa.png",
|
||||
drawtype = "torchlike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
groups = {fleshy=3,dig_immediate=3,flammable=2},
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("farming:cocoa_bean", {
|
||||
description = "Cocoa Bean",
|
||||
inventory_image = "farming_cocoa_bean.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:cocoa_bean 10",
|
||||
type = "shapeless",
|
||||
recipe = {"farming:cocoa"},
|
||||
})
|
|
@ -175,6 +175,19 @@ for lvl = 1, 6, 1 do
|
|||
})
|
||||
end
|
||||
|
||||
-- potatoe -> potatoe
|
||||
minetest.register_alias("farming:potatoe_node", "farming:potatoe")
|
||||
--minetest.register_alias("farming:potatoe", "farming:potatoe_item") cant do this
|
||||
minetest.register_alias("farming:potatoe_straw", "farming:potatoe")
|
||||
minetest.register_alias("farming:seed_potatoe", "farming:potatoe_seed")
|
||||
for lvl = 1, 6, 1 do
|
||||
minetest.register_entity(":farming:potatoe_lvl"..lvl, {
|
||||
on_activate = function(self, staticdata)
|
||||
minetest.env:set_node(self.object:getpos(), {name="farming:potatoe_1"})
|
||||
end
|
||||
})
|
||||
end
|
||||
|
||||
-- corn -> wheat
|
||||
minetest.register_alias("farming:corn_node", "farming:wheat")
|
||||
minetest.register_alias("farming:corn", "farming:wheat_harvested")
|
||||
|
@ -201,15 +214,41 @@ dofile(minetest.get_modpath("farming").."/wheat.lua")
|
|||
-- ========= COTTON =========
|
||||
dofile(minetest.get_modpath("farming").."/cotton.lua")
|
||||
|
||||
-- ========= PUMPKINS =========
|
||||
dofile(minetest.get_modpath("farming").."/pumpkin.lua")
|
||||
|
||||
-- ========= RUBBER =========
|
||||
dofile(minetest.get_modpath("farming").."/rubber.lua")
|
||||
|
||||
-- ========= WEED =========
|
||||
dofile(minetest.get_modpath("farming").."/weed.lua")
|
||||
|
||||
-- ========= STRAWBERRIES =========
|
||||
dofile(minetest.get_modpath("farming").."/strawberries.lua")
|
||||
|
||||
-- ========= RHUBARB =========
|
||||
dofile(minetest.get_modpath("farming").."/rhubarb.lua")
|
||||
|
||||
-- ========= POTATOES =========
|
||||
dofile(minetest.get_modpath("farming").."/potatoes.lua")
|
||||
|
||||
-- ========= TOMATOES =========
|
||||
dofile(minetest.get_modpath("farming").."/tomatoes.lua")
|
||||
|
||||
-- ========= ORANGES =========
|
||||
dofile(minetest.get_modpath("farming").."/oranges.lua")
|
||||
|
||||
-- ========= BANANAS =========
|
||||
dofile(minetest.get_modpath("farming").."/bananas.lua")
|
||||
|
||||
-- ========= PAPYRUS =========
|
||||
dofile(minetest.get_modpath("farming").."/papyrus.lua")
|
||||
|
||||
-- ========= CACTUS =========
|
||||
dofile(minetest.get_modpath("farming").."/cactus.lua")
|
||||
|
||||
-- ========= PUMPKIN =========
|
||||
dofile(minetest.get_modpath("farming").."/pumpkin.lua")
|
||||
-- ========= CARROTS =========
|
||||
dofile(minetest.get_modpath("farming").."/carrots.lua")
|
||||
|
||||
-- ========= COCOA =========
|
||||
dofile(minetest.get_modpath("farming").."/cocoa.lua")
|
||||
|
|
|
@ -0,0 +1,89 @@
|
|||
minetest.register_craftitem("farming:orange_seed", {
|
||||
description = "Orange Seeds",
|
||||
inventory_image = "farming_orange_seed.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local above = minetest.env:get_node(pointed_thing.above)
|
||||
if above.name == "air" then
|
||||
above.name = "farming:orange_1"
|
||||
minetest.env:set_node(pointed_thing.above, above)
|
||||
itemstack:take_item(1)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("farming:orange_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_orange_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+3/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:orange_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_orange_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+8/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:orange_3", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_orange_3.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+14/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:orange", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_orange_4.png"},
|
||||
drop = {
|
||||
max_items = 6,
|
||||
items = {
|
||||
{ items = {'farming:orange_seed'} },
|
||||
{ items = {'farming:orange_seed'}, rarity = 2},
|
||||
{ items = {'farming:orange_seed'}, rarity = 5},
|
||||
{ items = {'farming:orange_item'} },
|
||||
{ items = {'farming:orange_item'}, rarity = 2 },
|
||||
{ items = {'farming:orange_item'}, rarity = 5 }
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("farming:orange_item", {
|
||||
description = "Orange",
|
||||
inventory_image = "farming_orange.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
})
|
||||
|
||||
farming:add_plant("farming:orange", {"farming:orange_1", "farming:orange_2", "farming:orange_3"}, 50, 20)
|
|
@ -0,0 +1,72 @@
|
|||
minetest.register_craftitem("farming:potatoe_seed", {
|
||||
description = "Potatoe Seeds",
|
||||
inventory_image = "farming_potatoe_seed.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local above = minetest.env:get_node(pointed_thing.above)
|
||||
if above.name == "air" then
|
||||
above.name = "farming:potatoe_1"
|
||||
minetest.env:set_node(pointed_thing.above, above)
|
||||
itemstack:take_item(1)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("farming:potatoe_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_potatoe_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+6/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:potatoe_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_potatoe_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+9/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:potatoe", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_potatoe_3.png"},
|
||||
drop = {
|
||||
max_items = 6,
|
||||
items = {
|
||||
{ items = {'farming:potatoe_seed'} },
|
||||
{ items = {'farming:potatoe_seed'}, rarity = 2},
|
||||
{ items = {'farming:potatoe_seed'}, rarity = 5},
|
||||
{ items = {'farming:potatoe_item'} },
|
||||
{ items = {'farming:potatoe_item'}, rarity = 2 },
|
||||
{ items = {'farming:potatoe_item'}, rarity = 5 }
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("farming:potatoe_item", {
|
||||
description = "Potatoe",
|
||||
inventory_image = "farming_potatoe.png",
|
||||
})
|
||||
|
||||
farming:add_plant("farming:potatoe", {"farming:potatoe_1", "farming:potatoe_2"}, 50, 20)
|
|
@ -0,0 +1,72 @@
|
|||
minetest.register_craftitem("farming:rhubarb_seed", {
|
||||
description = "Rhubarb Seeds",
|
||||
inventory_image = "farming_rhubarb_seed.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local above = minetest.env:get_node(pointed_thing.above)
|
||||
if above.name == "air" then
|
||||
above.name = "farming:rhubarb_1"
|
||||
minetest.env:set_node(pointed_thing.above, above)
|
||||
itemstack:take_item(1)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("farming:rhubarb_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_rhubarb_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+5/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:rhubarb_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_rhubarb_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+11/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:rhubarb", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_rhubarb_3.png"},
|
||||
drop = {
|
||||
max_items = 6,
|
||||
items = {
|
||||
{ items = {'farming:rhubarb_seed'} },
|
||||
{ items = {'farming:rhubarb_seed'}, rarity = 2},
|
||||
{ items = {'farming:rhubarb_seed'}, rarity = 5},
|
||||
{ items = {'farming:rhubarb_item'} },
|
||||
{ items = {'farming:rhubarb_item'}, rarity = 2 },
|
||||
{ items = {'farming:rhubarb_item'}, rarity = 5 }
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("farming:rhubarb_item", {
|
||||
description = "Rhubarb",
|
||||
inventory_image = "farming_rhubarb.png",
|
||||
})
|
||||
|
||||
farming:add_plant("farming:rhubarb", {"farming:rhubarb_1", "farming:rhubarb_2"}, 50, 20)
|
|
@ -0,0 +1,104 @@
|
|||
minetest.register_node("farming:rubber_sapling", {
|
||||
description = "Rubber Tree Sapling",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_rubber_sapling.png"},
|
||||
inventory_image = "farming_rubber_sapling.png",
|
||||
wield_image = "farming_rubber_sapling.png",
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
groups = {dig_immediate=3,flammable=2},
|
||||
sounds = default.node_sound_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:rubber_tree_full", {
|
||||
description = "Rubber Tree",
|
||||
tiles = {"default_tree_top.png", "default_tree_top.png", "farming_rubber_tree_full.png"},
|
||||
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2},
|
||||
drop = "default:tree",
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
|
||||
on_dig = function(pos, node, digger)
|
||||
minetest.node_dig(pos, node, digger)
|
||||
minetest.env:remove_node(pos)
|
||||
end,
|
||||
|
||||
after_destruct = function(pos, oldnode)
|
||||
oldnode.name = "farming:rubber_tree_empty"
|
||||
minetest.env:set_node(pos, oldnode)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
minetest.register_node("farming:rubber_tree_empty", {
|
||||
tiles = {"default_tree_top.png", "default_tree_top.png", "farming_rubber_tree_empty.png"},
|
||||
groups = {tree=1,snappy=1,choppy=2,oddly_breakable_by_hand=1,flammable=2, not_in_creative_inventory=1},
|
||||
drop = "default:tree",
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"farming:rubber_tree_empty"},
|
||||
interval = 60,
|
||||
chance = 15,
|
||||
action = function(pos, node)
|
||||
node.name = "farming:rubber_tree_full"
|
||||
minetest.env:set_node(pos, node)
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("farming:rubber_leaves", {
|
||||
drawtype = "allfaces_optional",
|
||||
visual_scale = 1.3,
|
||||
tiles = {"default_leaves.png"},
|
||||
paramtype = "light",
|
||||
groups = {snappy=3, leafdecay=3, flammable=2, not_in_creative_inventory=1},
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{
|
||||
items = {'farming:rubber_sapling'},
|
||||
rarity = 20,
|
||||
},
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"farming:rubber_sapling"},
|
||||
interval = 60,
|
||||
chance = 20,
|
||||
action = function(pos, node)
|
||||
farming:generate_tree(pos, "farming:rubber_tree_full", "farming:rubber_leaves", {"default:dirt", "default:dirt_with_grass"})
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_on_generated(function(minp, maxp, blockseed)
|
||||
if math.random(1, 100) > 5 then
|
||||
return
|
||||
end
|
||||
local tmp = {x=(maxp.x-minp.x)/2+minp.x, y=(maxp.y-minp.y)/2+minp.y, z=(maxp.z-minp.z)/2+minp.z}
|
||||
local pos = minetest.env:find_node_near(tmp, maxp.x-minp.x, {"default:dirt_with_grass"})
|
||||
if pos ~= nil then
|
||||
farming:generate_tree({x=pos.x, y=pos.y+1, z=pos.z}, "farming:rubber_tree_full", "farming:rubber_leaves", {"default:dirt", "default:dirt_with_grass"})
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_craftitem("farming:bucket_rubber", {
|
||||
description = "Bucket with Caoutchouc",
|
||||
inventory_image = "farming_bucket_rubber.png",
|
||||
stack_max = 1,
|
||||
})
|
||||
|
||||
local bucket_tmp = {
|
||||
source = "farming:rubber_tree_full",
|
||||
itemname = "farming:bucket_rubber"
|
||||
}
|
||||
bucket.liquids["farming:rubber_tree_full"] = bucket_tmp
|
||||
|
||||
-- ========= FUEL =========
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "farming:rubber_sapling",
|
||||
burntime = 10
|
||||
})
|
|
@ -0,0 +1,89 @@
|
|||
minetest.register_craftitem("farming:strawberry_seed", {
|
||||
description = "Strawberry Seeds",
|
||||
inventory_image = "farming_strawberry_seed.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local above = minetest.env:get_node(pointed_thing.above)
|
||||
if above.name == "air" then
|
||||
above.name = "farming:strawberry_1"
|
||||
minetest.env:set_node(pointed_thing.above, above)
|
||||
itemstack:take_item(1)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("farming:strawberry_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_strawberry_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+9/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:strawberry_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_strawberry_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+12/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:strawberry_3", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_strawberry_3.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+14/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:strawberry", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_strawberry_4.png"},
|
||||
drop = {
|
||||
max_items = 6,
|
||||
items = {
|
||||
{ items = {'farming:strawberry_seed'} },
|
||||
{ items = {'farming:strawberry_seed'}, rarity = 2},
|
||||
{ items = {'farming:strawberry_seed'}, rarity = 5},
|
||||
{ items = {'farming:strawberry_item'} },
|
||||
{ items = {'farming:strawberry_item'}, rarity = 2 },
|
||||
{ items = {'farming:strawberry_item'}, rarity = 5 }
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("farming:strawberry_item", {
|
||||
description = "Strawberry",
|
||||
inventory_image = "farming_strawberry.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
|
||||
farming:add_plant("farming:strawberry", {"farming:strawberry_1", "farming:strawberry_2", "farming:strawberry_3"}, 50, 20)
|
After Width: | Height: | Size: 515 B |
After Width: | Height: | Size: 621 B |
After Width: | Height: | Size: 647 B |
After Width: | Height: | Size: 575 B |
After Width: | Height: | Size: 438 B |
After Width: | Height: | Size: 453 B |
After Width: | Height: | Size: 507 B |
After Width: | Height: | Size: 550 B |
After Width: | Height: | Size: 476 B |
After Width: | Height: | Size: 535 B |
After Width: | Height: | Size: 184 B |
After Width: | Height: | Size: 644 B |
After Width: | Height: | Size: 504 B |
After Width: | Height: | Size: 430 B |
After Width: | Height: | Size: 468 B |
After Width: | Height: | Size: 544 B |
After Width: | Height: | Size: 540 B |
After Width: | Height: | Size: 281 B |
After Width: | Height: | Size: 525 B |
After Width: | Height: | Size: 473 B |
After Width: | Height: | Size: 502 B |
After Width: | Height: | Size: 292 B |
After Width: | Height: | Size: 221 B |
After Width: | Height: | Size: 502 B |
After Width: | Height: | Size: 530 B |
After Width: | Height: | Size: 365 B |
After Width: | Height: | Size: 301 B |
After Width: | Height: | Size: 219 B |
After Width: | Height: | Size: 333 B |
After Width: | Height: | Size: 835 B |
After Width: | Height: | Size: 808 B |
After Width: | Height: | Size: 250 B |
After Width: | Height: | Size: 356 B |
After Width: | Height: | Size: 342 B |
After Width: | Height: | Size: 357 B |
After Width: | Height: | Size: 400 B |
After Width: | Height: | Size: 212 B |
After Width: | Height: | Size: 581 B |
After Width: | Height: | Size: 482 B |
After Width: | Height: | Size: 506 B |
After Width: | Height: | Size: 578 B |
After Width: | Height: | Size: 591 B |
After Width: | Height: | Size: 221 B |
|
@ -0,0 +1,89 @@
|
|||
minetest.register_craftitem("farming:tomato_seed", {
|
||||
description = "Tomato Seeds",
|
||||
inventory_image = "farming_tomato_seed.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local above = minetest.env:get_node(pointed_thing.above)
|
||||
if above.name == "air" then
|
||||
above.name = "farming:tomato_1"
|
||||
minetest.env:set_node(pointed_thing.above, above)
|
||||
itemstack:take_item(1)
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_node("farming:tomato_1", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_tomato_1.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+5/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:tomato_2", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_tomato_2.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+8/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:tomato_3", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
drop = "",
|
||||
tiles = {"farming_tomato_3.png"},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.5+13/16, 0.5}
|
||||
},
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("farming:tomato", {
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_tomato_4.png"},
|
||||
drop = {
|
||||
max_items = 6,
|
||||
items = {
|
||||
{ items = {'farming:tomato_seed'} },
|
||||
{ items = {'farming:tomato_seed'}, rarity = 2},
|
||||
{ items = {'farming:tomato_seed'}, rarity = 5},
|
||||
{ items = {'farming:tomato_item'} },
|
||||
{ items = {'farming:tomato_item'}, rarity = 2 },
|
||||
{ items = {'farming:tomato_item'}, rarity = 5 }
|
||||
}
|
||||
},
|
||||
groups = {snappy=3, flammable=2, not_in_creative_inventory=1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("farming:tomato_item", {
|
||||
description = "Tomato",
|
||||
inventory_image = "farming_tomato.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
})
|
||||
|
||||
farming:add_plant("farming:tomato", {"farming:tomato_1", "farming:tomato_2", "farming:tomato_3"}, 50, 20)
|