Code tidy and tweak

This commit is contained in:
TenPlus1 2015-07-05 10:54:18 +01:00
parent 6e4fa56475
commit 16cc62a1d4
23 changed files with 622 additions and 352 deletions

View File

@ -47,13 +47,22 @@ minetest.register_node("farming:beanpole", {
{items = {'farming:beanpole'}, rarity = 1},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
on_place = function(itemstack, placer, pointed_thing)
local nod = minetest.get_node_or_nil(pointed_thing.under)
if nod and minetest.get_item_group(nod.name, "soil") < 2 then return end
local top = {x=pointed_thing.above.x, y=pointed_thing.above.y+1, z=pointed_thing.above.z}
if nod and minetest.get_item_group(nod.name, "soil") < 2 then
return
end
local top = {
x = pointed_thing.above.x,
y = pointed_thing.above.y + 1,
z = pointed_thing.above.z
}
nod = minetest.get_node_or_nil(top)
if nod and nod.name ~= "air" then return end
minetest.set_node(pointed_thing.above, {name = "farming:beanpole"})
@ -88,8 +97,11 @@ minetest.register_node("farming:beanpole_1", {
{items = {'farming:beanpole'}, rarity = 1},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=3,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 3, not_in_creative_inventory = 1,
attached_node = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -106,8 +118,11 @@ minetest.register_node("farming:beanpole_2", {
{items = {'farming:beanpole'}, rarity = 1},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -124,8 +139,11 @@ minetest.register_node("farming:beanpole_3", {
{items = {'farming:beanpole'}, rarity = 1},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -143,19 +161,21 @@ minetest.register_node("farming:beanpole_4", {
{items = {'farming:beanpole'}, rarity = 1},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Green Bean growth does not have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:beanpole_5", {
drawtype = "plantlike",
tiles = {"farming_beanpole_5.png"},
visual_scale = 1.45,
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
sunlight_propagates = true,
@ -167,8 +187,11 @@ minetest.register_node("farming:beanpole_5", {
{items = {'farming:beans 2'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -189,7 +212,10 @@ minetest.register_node("farming:beanbush", {
{items = {'farming:beans 1'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory=1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -32,12 +32,14 @@ minetest.register_node("farming:blueberry_1", {
tiles = {"farming_blueberry_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -50,8 +52,11 @@ minetest.register_node("farming:blueberry_2", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -64,12 +69,15 @@ minetest.register_node("farming:blueberry_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Blueberry growth does not have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:blueberry_4", {
drawtype = "plantlike",
@ -79,7 +87,6 @@ minetest.register_node("farming:blueberry_4", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:blueberries 2'}, rarity = 1},
@ -87,7 +94,10 @@ minetest.register_node("farming:blueberry_4", {
{items = {'farming:blueberries'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory=1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -88,8 +88,14 @@ minetest.register_node("farming:cocoa_1", {
{items = {'farming:cocoa_beans 1'}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,growing=1},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
},
groups = {
snappy = 3, flammable = 2, plant = 1, growing = 1,
not_in_creative_inventory=1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -103,8 +109,14 @@ minetest.register_node("farming:cocoa_2", {
{items = {'farming:cocoa_beans 1'}, rarity = 1},
}
},
selection_box = {type = "fixed",fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,growing=1},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
},
groups = {
snappy = 3, flammable = 2, plant = 1, growing = 1,
not_in_creative_inventory=1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -121,8 +133,14 @@ minetest.register_node("farming:cocoa_3", {
{items = {'farming:cocoa_beans 1'}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}
},
groups = {
snappy = 3, flammable = 2, plant = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -144,10 +162,15 @@ minetest.register_abm({
else return
end
if minetest.get_node(pos).name == "air" and minetest.get_node_light(pos) > 12 then
-- print ("COCOA", pos.x, pos.y, pos.z)
minetest.set_node(pos,{name="farming:cocoa_"..tostring(math.random(1,3))})
end
local nod = minetest.get_node_or_nil(pos)
if nod then nod = nod.name else return end
if nod == "air"
and minetest.get_node_light(pos) > 12 then
-- print ("COCOA", pos.x, pos.y, pos.z)
minetest.set_node(pos, {
name = "farming:cocoa_"..tostring(math.random(1, 3))
})
end
end,
})

View File

@ -111,12 +111,14 @@ minetest.register_node("farming:coffee_1", {
tiles = {"farming_coffee_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -129,8 +131,11 @@ minetest.register_node("farming:coffee_2", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -143,8 +148,11 @@ minetest.register_node("farming:coffee_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -157,12 +165,15 @@ minetest.register_node("farming:coffee_4", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Coffee growth doesnnot have growing=1 so abm never has to check these
-- Last stage of growth doesn not have growing group so abm never checks these
minetest.register_node("farming:coffee_5", {
drawtype = "plantlike",
@ -172,7 +183,6 @@ minetest.register_node("farming:coffee_5", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:coffee_beans 2'}, rarity = 1},
@ -180,7 +190,10 @@ minetest.register_node("farming:coffee_5", {
{items = {'farming:coffee_beans 2'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory=1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -58,8 +58,11 @@ minetest.register_node("farming:corn_1", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -71,8 +74,11 @@ minetest.register_node("farming:corn_2", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -85,8 +91,11 @@ minetest.register_node("farming:corn_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -99,8 +108,11 @@ minetest.register_node("farming:corn_4", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -108,12 +120,16 @@ minetest.register_node("farming:corn_5", {
drawtype = "plantlike",
tiles = {"farming_corn_5.png"},
paramtype = "light",
waving = 1,
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -122,12 +138,16 @@ minetest.register_node("farming:corn_6", {
tiles = {"farming_corn_6.png"},
visual_scale = 1.45,
paramtype = "light",
waving = 1,
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -136,9 +156,9 @@ minetest.register_node("farming:corn_7", {
tiles = {"farming_corn_7.png"},
visual_scale = 1.45,
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:corn'}, rarity = 1},
@ -146,12 +166,15 @@ minetest.register_node("farming:corn_7", {
{items = {'farming:corn'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Corn growth doesnnot have growing=1 so abm never has to check these
-- Last stage of growth doesn not have growing group so abm never checks these
minetest.register_node("farming:corn_8", {
drawtype = "plantlike",
@ -161,7 +184,6 @@ minetest.register_node("farming:corn_8", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:corn 2'}, rarity = 1},
@ -169,7 +191,10 @@ minetest.register_node("farming:corn_8", {
{items = {'farming:corn 2'}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -19,7 +19,7 @@ minetest.register_node("farming:seed_cotton", {
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
selection_box = farming.select,
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cotton_1")
end,
@ -51,12 +51,14 @@ minetest.register_node("farming:cotton_1", {
tiles = {"farming_cotton_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -65,12 +67,14 @@ minetest.register_node("farming:cotton_2", {
tiles = {"farming_cotton_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -83,8 +87,11 @@ minetest.register_node("farming:cotton_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -97,8 +104,11 @@ minetest.register_node("farming:cotton_4", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -115,8 +125,11 @@ minetest.register_node("farming:cotton_5", {
{items = {"farming:seed_cotton"}, rarity = 1},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -133,8 +146,11 @@ minetest.register_node("farming:cotton_6", {
{items = {"farming:cotton"}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -153,12 +169,15 @@ minetest.register_node("farming:cotton_7", {
{items = {"farming:seed_cotton"}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Define last stage of Cotton growth separate and without growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:cotton_8", {
drawtype = "plantlike",
@ -177,7 +196,10 @@ minetest.register_node("farming:cotton_8", {
{items = {"farming:seed_cotton"}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -17,12 +17,14 @@ minetest.register_node("farming:cucumber_1", {
drawtype = "plantlike",
tiles = {"farming_cucumber_1.png"},
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -34,8 +36,11 @@ minetest.register_node("farming:cucumber_2", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -47,12 +52,15 @@ minetest.register_node("farming:cucumber_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Cucumber growth doesnnot have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:cucumber_4", {
drawtype = "plantlike",
@ -61,14 +69,16 @@ minetest.register_node("farming:cucumber_4", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:cucumber'}, rarity = 1},
{items = {'farming:cucumber 2'}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -76,7 +76,7 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
-- turn the node into soil, wear out item and play sound
minetest.set_node(pt.under, {name = "farming:soil"})
minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5,})
minetest.sound_play("default_dig_crumbly", {pos = pt.under, gain = 0.5})
itemstack:add_wear(65535/(uses - 1))
return itemstack
end

View File

@ -1,5 +1,5 @@
--[[
Minetest Farming Redo Mod 1.20 (20th May 2015)
Minetest Farming Redo Mod 1.20 (5th July 2015)
by TenPlus1
NEW growing routine by prestidigitator
]]
@ -8,6 +8,10 @@ farming = {}
farming.mod = "redo"
farming.path = minetest.get_modpath("farming")
farming.hoe_on_use = default.hoe_on_use
farming.select = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5}
}
farming.DEBUG = false
-- farming.DEBUG = {} -- Uncomment to turn on profiling code/functions
@ -38,7 +42,6 @@ if farming.DEBUG then
timer_avg.."µs/run")
print("Total farming time: "..dt.."µs")
end
else
end
local statistics = dofile(farming.path.."/statistics.lua")
@ -214,7 +217,12 @@ local function reg_plant_stages(plant_name, stage, force_last)
local ns = reg_plant_stages(plant_name, stage + 1, true)
local stages_left = (ns and { ns.name, unpack(ns.stages_left) }) or {}
stages = { plant_name = plant_name, name = node_name, stage = stage, stages_left = stages_left }
stages = {
plant_name = plant_name,
name = node_name,
stage = stage,
stages_left = stages_left
}
if #stages_left > 0 then
local old_constr = node_def.on_construct
@ -237,7 +245,12 @@ local function reg_plant_stages(plant_name, stage, force_last)
})
end
elseif force_last then
stages = { plant_name = plant_name, name = node_name, stage = stage, stages_left = {} }
stages = {
plant_name = plant_name,
name = node_name,
stage = stage,
stages_left = {}
}
else
return nil
end
@ -378,7 +391,6 @@ if farming.DEBUG then
end
end
-- Place Seeds on Soil
function farming.place_seed(itemstack, placer, pointed_thing, plantname)
@ -420,7 +432,6 @@ function farming.place_seed(itemstack, placer, pointed_thing, plantname)
end
end
-- Function to register plants (for compatibility)
farming.register_plant = function(name, def)
@ -450,7 +461,7 @@ farming.register_plant = function(name, def)
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
selection_box = farming.select,
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":"..pname.."_1")
end
@ -489,7 +500,7 @@ farming.register_plant = function(name, def)
buildable_to = true,
is_ground_content = true,
drop = drop,
selection_box = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
selection_box = farming.select,
groups = g,
sounds = default.node_sound_leaves_defaults(),
})
@ -503,8 +514,7 @@ end
--[[ Cotton (example, is already registered in cotton.lua)
farming.register_plant("farming:cotton", {
description = "Cotton seed",
description = "Cotton2 seed",
inventory_image = "farming_cotton_seed.png",
steps = 8,
})
--]]
})]]

View File

@ -38,9 +38,8 @@ function farming.register_mgv6_decorations()
register_plant("beanbush", 18, 35, "", -1)
end
-- enable in mapgen v6 only
-- enable in v6 mapgen only
local mg_params = minetest.get_mapgen_params()
if mg_params.mgname == "v6" then
if minetest.get_mapgen_params().mgname == "v6" then
farming.register_mgv6_decorations()
end

View File

@ -33,12 +33,14 @@ minetest.register_node("farming:melon_1", {
tiles = {"farming_melon_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -47,12 +49,14 @@ minetest.register_node("farming:melon_2", {
tiles = {"farming_melon_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -65,8 +69,11 @@ minetest.register_node("farming:melon_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -79,8 +86,11 @@ minetest.register_node("farming:melon_4", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -93,8 +103,11 @@ minetest.register_node("farming:melon_5", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -105,8 +118,11 @@ minetest.register_node("farming:melon_6", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -117,12 +133,15 @@ minetest.register_node("farming:melon_7", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Melon growth doesnnot have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:melon_8", {
--drawtype = "nodebox",
@ -130,7 +149,6 @@ minetest.register_node("farming:melon_8", {
tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png"},
paramtype = "light",
walkable = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:melon_slice 9'}, rarity = 1},

View File

@ -35,8 +35,11 @@ minetest.register_node("farming:potato_1", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -49,8 +52,11 @@ minetest.register_node("farming:potato_2", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -62,19 +68,21 @@ minetest.register_node("farming:potato_3", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:potato'}, rarity = 1},
{items = {'farming:potato'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Potato growth doesnnot have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:potato_4", {
drawtype = "plantlike",
@ -84,14 +92,16 @@ minetest.register_node("farming:potato_4", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:potato 2'}, rarity = 1},
{items = {'farming:potato 3'}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory=1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -3,8 +3,15 @@
minetest.register_node("farming:pumpkin", {
description = "Pumpkin",
tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png"},
groups = {choppy=1,oddly_breakable_by_hand=1,flammable=2,plant=1},
tiles = {
"farming_pumpkin_top.png",
"farming_pumpkin_top.png",
"farming_pumpkin_side.png"
},
groups = {
choppy = 1, oddly_breakable_by_hand = 1,
flammable = 2, plant = 1
},
drop = {
items = {
{items = {'farming:pumpkin_slice 9'}, rarity = 1},
@ -41,7 +48,14 @@ minetest.register_craft({
-- Jack 'O Lantern
minetest.register_node("farming:jackolantern", {
description = "Jack 'O Lantern",
tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face_off.png"},
tiles = {
"farming_pumpkin_top.png",
"farming_pumpkin_top.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_face_off.png"
},
paramtype2 = "facedir",
groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
@ -53,8 +67,15 @@ minetest.register_node("farming:jackolantern", {
minetest.register_node("farming:jackolantern_on", {
description = "Jack 'O Lantern",
tiles = {"farming_pumpkin_top.png", "farming_pumpkin_top.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_side.png", "farming_pumpkin_face_on.png"},
light_source = 14,
tiles = {
"farming_pumpkin_top.png",
"farming_pumpkin_top.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_side.png",
"farming_pumpkin_face_on.png"
},
light_source = default.LIGHT_MAX - 1,
paramtype2 = "facedir",
groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2},
sounds = default.node_sound_wood_defaults(),
@ -110,8 +131,11 @@ minetest.register_node("farming:pumpkin_1", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -124,8 +148,11 @@ minetest.register_node("farming:pumpkin_2", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory =1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -138,8 +165,11 @@ minetest.register_node("farming:pumpkin_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -152,8 +182,11 @@ minetest.register_node("farming:pumpkin_4", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -166,8 +199,11 @@ minetest.register_node("farming:pumpkin_5", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -179,8 +215,11 @@ minetest.register_node("farming:pumpkin_6", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -191,12 +230,15 @@ minetest.register_node("farming:pumpkin_7", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Pumpkin growth does not have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:pumpkin_8", {
drawtype = "plantlike",
@ -204,13 +246,15 @@ minetest.register_node("farming:pumpkin_8", {
paramtype = "light",
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:pumpkin_slice 9'}, rarity = 1},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_defaults(),
})

View File

@ -34,12 +34,14 @@ minetest.register_node("farming:raspberry_1", {
tiles = {"farming_raspberry_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -52,8 +54,11 @@ minetest.register_node("farming:raspberry_2", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -66,12 +71,15 @@ minetest.register_node("farming:raspberry_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Raspberry growth does not have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:raspberry_4", {
drawtype = "plantlike",
@ -81,7 +89,6 @@ minetest.register_node("farming:raspberry_4", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:raspberries 2'}, rarity = 1},
@ -89,7 +96,10 @@ minetest.register_node("farming:raspberry_4", {
{items = {'farming:raspberries'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -32,12 +32,14 @@ minetest.register_node("farming:rhubarb_1", {
tiles = {"farming_rhubarb_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -50,12 +52,15 @@ minetest.register_node("farming:rhubarb_2", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Rhubarb growth doesnnot have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:rhubarb_3", {
drawtype = "plantlike",
@ -65,7 +70,6 @@ minetest.register_node("farming:rhubarb_3", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:rhubarb 2'}, rarity = 1},
@ -73,7 +77,10 @@ minetest.register_node("farming:rhubarb_3", {
{items = {'farming:rhubarb'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -3,7 +3,6 @@ minetest.register_node("farming:soil", {
description = "Soil",
tiles = {"farming_soil.png", "default_dirt.png"},
drop = "default:dirt",
is_ground_content = true,
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 2},
sounds = default.node_sound_dirt_defaults(),
})
@ -16,7 +15,6 @@ minetest.register_node("farming:soil_wet", {
description = "Wet Soil",
tiles = {"farming_soil_wet.png", "farming_soil_wet_side.png"},
drop = "default:dirt",
is_ground_content = true,
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 3},
sounds = default.node_sound_dirt_defaults(),
})
@ -29,7 +27,11 @@ minetest.register_abm({
chance = 4,
action = function(pos, node)
local nn = minetest.get_node({x=pos.x,y=pos.y+1,z=pos.z}).name
pos.y = pos.y + 1
local nn = minetest.get_node_or_nil(pos)
pos.y = pos.y - 1
if nn then nn = nn.name else return end
-- what's on top of soil, if solid/not plant change soil to dirt
if minetest.registered_nodes[nn]

View File

@ -12,4 +12,3 @@ minetest.register_craft({
output = "farming:sugar 2",
recipe = "default:papyrus",
})

View File

@ -18,12 +18,14 @@ minetest.register_node("farming:tomato_1", {
tiles = {"farming_tomato_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -32,12 +34,14 @@ minetest.register_node("farming:tomato_2", {
tiles = {"farming_tomato_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -50,8 +54,11 @@ minetest.register_node("farming:tomato_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -64,8 +71,11 @@ minetest.register_node("farming:tomato_4", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -78,8 +88,11 @@ minetest.register_node("farming:tomato_5", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -92,8 +105,11 @@ minetest.register_node("farming:tomato_6", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -104,19 +120,21 @@ minetest.register_node("farming:tomato_7", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:tomato'}, rarity = 1},
{items = {'farming:tomato'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Carrot growth doesnnot have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:tomato_8", {
drawtype = "plantlike",
@ -125,14 +143,16 @@ minetest.register_node("farming:tomato_8", {
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:tomato 3'}, rarity = 1},
{items = {'farming:tomato 3'}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -22,7 +22,7 @@ minetest.register_node("farming:seed_wheat", {
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
selection_box = farming.select,
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:wheat_1")
end,
@ -96,12 +96,14 @@ minetest.register_node("farming:wheat_1", {
tiles = {"farming_wheat_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing=1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -110,12 +112,14 @@ minetest.register_node("farming:wheat_2", {
tiles = {"farming_wheat_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -128,8 +132,11 @@ minetest.register_node("farming:wheat_3", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -142,8 +149,11 @@ minetest.register_node("farming:wheat_4", {
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -161,8 +171,11 @@ minetest.register_node("farming:wheat_5", {
{items = {'farming:seed_wheat'}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -180,8 +193,11 @@ minetest.register_node("farming:wheat_6", {
{items = {'farming:seed_wheat'}, rarity = 1},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
@ -201,12 +217,15 @@ minetest.register_node("farming:wheat_7", {
{items = {'farming:seed_wheat'}, rarity = 3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1,growing=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1, growing = 1
},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Wheat growth doesnnot have growing=1 so abm never has to check these
-- Last stage of growth does not have growing group so abm never checks these
minetest.register_node("farming:wheat_8", {
drawtype = "plantlike",
@ -223,7 +242,10 @@ minetest.register_node("farming:wheat_8", {
{items = {'farming:seed_wheat'}, rarity = 2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
groups = {snappy=3,flammable=2,plant=1,not_in_creative_inventory=1,attached_node=1},
selection_box = farming.select,
groups = {
snappy = 3, flammable = 2, plant = 1, attached_node = 1,
not_in_creative_inventory = 1
},
sounds = default.node_sound_leaves_defaults(),
})