Update Farming Redo and Add Air Sword

Yup, you read that right.
master
Chris N 2014-11-07 11:38:39 -10:00
parent 57c4e11d1b
commit c5fc35f0b8
50 changed files with 860 additions and 291 deletions

View File

@ -1,4 +1,5 @@
Minetest Farming Redo Mod 1.0 by TenPlus1
Minetest Farming Redo
by TenPlus1
based on
@ -73,6 +74,12 @@ Created by Doc (License: WTFPL):
farming_potato_2.png
farming_potato_3.png
farming_potato_4.png
farming_raspberries.png
farming_raspberry_1.png
farming_raspberry_2.png
farming_raspberry_3.png
farming_raspberry_4.png
Created by Gambit:
default_junglegrass.png
@ -114,4 +121,10 @@ Created by TenPlus1
farming_cocoa_2.png
farming_cocoa_3.png
farming_cocoa_beans.png
farming_cookie.png
farming_cookie.png
farming_raspberry_smoothie.png
farming_rhubarb_1.png
farming_rhubarb_2.png
farming_rhubarb_3.png
farming_rhubarb.png
farming_rhubarb_pie.png

View File

@ -0,0 +1,93 @@
--= Blueberries
minetest.register_craftitem("farming:blueberries", {
description = "Blueberries",
inventory_image = "farming_blueberries.png",
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1")
end,
on_use = minetest.item_eat(1),
})
-- Blueberry Muffin (Thanks to sosogirl123 for muffin image in deviantart.com)
minetest.register_craftitem("farming:muffin_blueberry", {
description = "Blueberry Muffin",
inventory_image = "farming_blueberry_muffin.png",
on_use = minetest.item_eat(2),
})
minetest.register_craft({
output = "farming:muffin_blueberry 2",
recipe = {
{"farming:blueberries", "farming:bread", "farming:blueberries"},
}
})
-- Define Blueberry growth stages
minetest.register_node("farming:blueberry_1", {
drawtype = "plantlike",
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},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("farming:blueberry_2", {
drawtype = "plantlike",
tiles = {"farming_blueberry_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},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("farming:blueberry_3", {
drawtype = "plantlike",
tiles = {"farming_blueberry_3.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},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Blueberry growth does not have growing=1 so abm never has to check these
minetest.register_node("farming:blueberry_4", {
drawtype = "plantlike",
tiles = {"farming_blueberry_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:blueberries 2'},rarity=1},
{items = {'farming:blueberries'},rarity=2},
{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},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -6,7 +6,7 @@ minetest.register_craftitem("farming:carrot", {
description = "Carrot",
inventory_image = "farming_carrot.png",
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:carrot_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1")
end,
on_use = minetest.item_eat(4),
})
@ -34,6 +34,7 @@ minetest.register_node("farming:carrot_1", {
drawtype = "plantlike",
tiles = {"farming_carrot_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -47,6 +48,7 @@ minetest.register_node("farming:carrot_2", {
drawtype = "plantlike",
tiles = {"farming_carrot_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -60,6 +62,7 @@ minetest.register_node("farming:carrot_3", {
drawtype = "plantlike",
tiles = {"farming_carrot_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -73,6 +76,7 @@ minetest.register_node("farming:carrot_4", {
drawtype = "plantlike",
tiles = {"farming_carrot_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -86,6 +90,7 @@ minetest.register_node("farming:carrot_5", {
drawtype = "plantlike",
tiles = {"farming_carrot_5.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -99,6 +104,7 @@ minetest.register_node("farming:carrot_6", {
drawtype = "plantlike",
tiles = {"farming_carrot_6.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -112,6 +118,7 @@ minetest.register_node("farming:carrot_7", {
drawtype = "plantlike",
tiles = {"farming_carrot_7.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -133,6 +140,7 @@ minetest.register_node("farming:carrot_8", {
drawtype = "plantlike",
tiles = {"farming_carrot_8.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,

View File

@ -1,25 +1,15 @@
-- Re-register Jungletree (tree=2 for placement below)
-- Override default jungletree, add tree=2 for cocoa placement
minetest.register_node(":default:jungletree", {
description = "Jungle Tree",
tiles = {"default_jungletree_top.png", "default_jungletree_top.png", "default_jungletree.png"},
paramtype2 = "facedir",
is_ground_content = false,
groups = {tree=2,choppy=2,oddly_breakable_by_hand=1,flammable=2},
sounds = default.node_sound_wood_defaults(),
on_place = minetest.rotate_node
})
minetest.override_item("default:jungletree", {groups = {tree=2,choppy=2,oddly_breakable_by_hand=1,flammable=2}})
-- Place Cocoa
function place_cocoa(itemstack, placer, pointed_thing, plantname)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return
end
if pt.type ~= "node" then
if not pt and pt.type ~= "node" then
return
end
@ -31,8 +21,7 @@ function place_cocoa(itemstack, placer, pointed_thing, plantname)
end
-- check if pointing at jungletree
if minetest.get_item_group(under.name, "tree") == 2 then
else
if minetest.get_item_group(under.name, "tree") ~= 2 then
return
end
@ -106,11 +95,6 @@ minetest.register_node("farming:cocoa_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},
sounds = default.node_sound_leaves_defaults(),
after_place_node = function(pos, placer, itemstack, pointed_thing)
if placer:is_player() then
minetest.set_node(pos, {name="ethereal:banana", param2=1})
end
end,
})
minetest.register_node("farming:cocoa_2", {
@ -150,7 +134,7 @@ minetest.register_node("farming:cocoa_3", {
minetest.register_abm({
nodenames = {"default:jungletree"},
neighbors = {"default:jungleleaves"},
neighbors = {"default:jungleleaves", "moretrees:jungletree_leaves_green"},
interval = 80,
chance = 20,
action = function(pos, node)
@ -164,7 +148,7 @@ minetest.register_abm({
else return
end
if minetest.get_node(pos).name == "air" then
if minetest.get_node(pos).name == "air" and minetest.get_node_light(pos) > 11 then
-- print ("COCOA", pos.x, pos.y, pos.z)
minetest.set_node(pos,{name="farming:cocoa_"..tostring(math.random(1,3))})
end

View File

@ -5,7 +5,7 @@ minetest.register_craftitem("farming:coffee_beans", {
description = "Coffee Beans",
inventory_image = "farming_coffee_beans.png",
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:coffee_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1")
end,
})
@ -110,6 +110,7 @@ minetest.register_node("farming:coffee_1", {
drawtype = "plantlike",
tiles = {"farming_coffee_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -123,6 +124,7 @@ minetest.register_node("farming:coffee_2", {
drawtype = "plantlike",
tiles = {"farming_coffee_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -136,6 +138,7 @@ minetest.register_node("farming:coffee_3", {
drawtype = "plantlike",
tiles = {"farming_coffee_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -149,6 +152,7 @@ minetest.register_node("farming:coffee_4", {
drawtype = "plantlike",
tiles = {"farming_coffee_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -164,6 +168,7 @@ minetest.register_node("farming:coffee_5", {
drawtype = "plantlike",
tiles = {"farming_coffee_5.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,

View File

@ -0,0 +1,97 @@
-- is Ethereal mod installed?
local eth = minetest.get_modpath("ethereal") or nil
-- Banana
if eth then
minetest.register_alias("farming_plus:banana_sapling", "ethereal:banana_tree_sapling")
minetest.register_alias("farming_plus:banana_leaves", "ethereal:bananaleaves")
minetest.register_alias("farming_plus:banana", "ethereal:banana")
else
minetest.register_alias("farming_plus:banana_sapling", "default:sapling")
minetest.register_alias("farming_plus:banana_leaves", "default:leaves")
minetest.register_alias("farming_plus:banana", "default:apple")
end
-- Carrot
minetest.register_alias("farming_plus:carrot_seed", "farming:carrot")
minetest.register_alias("farming_plus:carrot_1", "farming:carrot_1")
minetest.register_alias("farming_plus:carrot_2", "farming:carrot_4")
minetest.register_alias("farming_plus:carrot_3", "farming:carrot_6")
minetest.register_alias("farming_plus:carrot", "farming:carrot_8")
-- Cocoa
minetest.register_alias("farming_plus:cocoa_sapling", "farming:cocoa_beans")
minetest.register_alias("farming_plus:cocoa_leaves", "default:leaves")
minetest.register_alias("farming_plus:cocoa", "default:apple")
minetest.register_alias("farming_plus:cocoa_bean", "farming:cocoa_beans")
-- Orange
minetest.register_alias("farming_plus:orange_1", "farming:tomato_1")
minetest.register_alias("farming_plus:orange_2", "farming:tomato_4")
minetest.register_alias("farming_plus:orange_3", "farming:tomato_6")
minetest.register_alias("farming_plus:orange", "farming:tomato_8")
if eth then
minetest.register_alias("farming_plus:orange_item", "ethereal:orange")
minetest.register_alias("farming_plus:orange_seed", "ethereal:orange_tree_sapling")
else
minetest.register_alias("farming_plus:orange_item", "default:apple")
minetest.register_alias("farming_plus:orange_seed", "default:sapling")
end
-- Potato
minetest.register_alias("farming_plus:potato_item", "farming:potato")
minetest.register_alias("farming_plus:potato_1", "farming:potato_1")
minetest.register_alias("farming_plus:potato_2", "farming:potato_2")
minetest.register_alias("farming_plus:potato", "farming:potato_3")
minetest.register_alias("farming_plus:potato_seed", "farming:potato")
-- Pumpkin
minetest.register_alias("farming:pumpkin_seed", "farming:pumpkin_slice")
minetest.register_alias("farming:pumpkin_face", "farming:pumpkin")
minetest.register_alias("farming:pumpkin_face_light", "farming:jackolantern")
minetest.register_alias("farming:big_pumpkin", "farming:pumpkin")
minetest.register_alias("farming:big_pumpkin_side", "air")
minetest.register_alias("farming:big_pumpkin_corner", "air")
minetest.register_alias("farming:big_pumpkin_top", "air")
minetest.register_alias("farming:scarecrow", "farming:pumpkin")
minetest.register_alias("farming:scarecrow_bottom", "default:fence_wood")
minetest.register_alias("farming:scarecrow_light", "farming:jackolantern")
minetest.register_alias("farming:pumpkin_flour", "farming:pumpkin_dough")
-- Rhubarb
minetest.register_alias("farming_plus:rhubarb_seed", "farming:rhubarb")
minetest.register_alias("farming_plus:rhubarb_1", "farming:rhubarb_1")
minetest.register_alias("farming_plus:rhubarb_2", "farming:rhubarb_2")
minetest.register_alias("farming_plus:rhubarb", "farming:rhubarb_3")
minetest.register_alias("farming_plus:rhubarb_item", "farming:rhubarb")
-- Strawberry
if eth then
minetest.register_alias("farming_plus:strawberry_item", "ethereal:strawberry")
minetest.register_alias("farming_plus:strawberry_seed", "ethereal:strawberry")
minetest.register_alias("farming_plus:strawberry_1", "ethereal:strawberry_1")
minetest.register_alias("farming_plus:strawberry_2", "ethereal:strawberry_3")
minetest.register_alias("farming_plus:strawberry_3", "ethereal:strawberry_5")
minetest.register_alias("farming_plus:strawberry", "ethereal:strawberry_7")
else
minetest.register_alias("farming_plus:strawberry_item", "farming:raspberries")
minetest.register_alias("farming_plus:strawberry_seed", "farming:raspberries")
minetest.register_alias("farming_plus:strawberry_1", "farming:raspberry_1")
minetest.register_alias("farming_plus:strawberry_2", "farming:raspberry_2")
minetest.register_alias("farming_plus:strawberry_3", "farming:raspberry_3")
minetest.register_alias("farming_plus:strawberry", "farming:raspberry_4")
end
-- Tomato
minetest.register_alias("farming_plus:tomato_seed", "farming:tomato")
minetest.register_alias("farming_plus:tomato_item", "farming:tomato")
minetest.register_alias("farming_plus:tomato_1", "farming:tomato_2")
minetest.register_alias("farming_plus:tomato_2", "farming:tomato_4")
minetest.register_alias("farming_plus:tomato_3", "farming:tomato_6")
minetest.register_alias("farming_plus:tomato", "farming:tomato_8")
-- Weed
minetest.register_alias("farming:weed", "default:grass_2")

View File

@ -6,7 +6,7 @@ minetest.register_craftitem("farming:corn", {
description = "Corn",
inventory_image = "farming_corn.png",
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:corn_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1")
end,
on_use = minetest.item_eat(3),
})
@ -36,7 +36,8 @@ minetest.register_craftitem("farming:bottle_ethanol", {
minetest.register_craft( {
output = "farming:bottle_ethanol",
recipe = {
{ "vessels:glass_bottle", "farming:corn", "farming:corn" },
{ "vessels:glass_bottle", "farming:corn", "farming:corn"},
{ "farming:corn", "farming:corn", "farming:corn"},
}
})
@ -53,7 +54,7 @@ minetest.register_node("farming:corn_1", {
drawtype = "plantlike",
tiles = {"farming_corn_1.png"},
paramtype = "light",
waving = 1,
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
@ -66,7 +67,7 @@ minetest.register_node("farming:corn_2", {
drawtype = "plantlike",
tiles = {"farming_corn_2.png"},
paramtype = "light",
waving = 1,
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
@ -79,6 +80,7 @@ minetest.register_node("farming:corn_3", {
drawtype = "plantlike",
tiles = {"farming_corn_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -92,6 +94,7 @@ minetest.register_node("farming:corn_4", {
drawtype = "plantlike",
tiles = {"farming_corn_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -105,7 +108,7 @@ 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 = "",
@ -117,12 +120,13 @@ minetest.register_node("farming:corn_5", {
minetest.register_node("farming:corn_6", {
drawtype = "plantlike",
tiles = {"farming_corn_6.png"},
visual_scale = 1.45,
paramtype = "light",
waving = 1,
walkable = true,
sunlight_propagates = true,
walkable = false,
buildable_to = true,
drop = "",
selection_box = {type = "fixed",fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.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},
sounds = default.node_sound_leaves_defaults(),
})
@ -130,17 +134,19 @@ minetest.register_node("farming:corn_6", {
minetest.register_node("farming:corn_7", {
drawtype = "plantlike",
tiles = {"farming_corn_7.png"},
visual_scale = 1.45,
paramtype = "light",
waving = 1,
walkable = true,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:corn'},rarity=1},
{items = {'farming:corn'},rarity=2},
{items = {'farming:corn'},rarity=3},
}
},
selection_box = {type = "fixed",fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.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},
sounds = default.node_sound_leaves_defaults(),
})
@ -150,18 +156,20 @@ minetest.register_node("farming:corn_7", {
minetest.register_node("farming:corn_8", {
drawtype = "plantlike",
tiles = {"farming_corn_8.png"},
visual_scale = 1.45,
paramtype = "light",
waving = 1,
walkable = true,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:corn'},rarity=1},
{items = {'farming:corn 2'},rarity=1},
{items = {'farming:corn 2'},rarity=2},
{items = {'farming:corn 2'},rarity=2},
}
},
selection_box = {type = "fixed",fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.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},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -1,23 +1,39 @@
--= Cotton
-- Cotton Seed
minetest.register_craftitem("farming:seed_cotton", {
--minetest.register_craftitem("farming:seed_cotton", {
-- description = "Cotton Seed",
-- inventory_image = "farming_cotton_seed.png",
-- on_place = function(itemstack, placer, pointed_thing)
-- return farming.place_seed(itemstack, placer, pointed_thing, "farming:cotton_1")
-- end,
--})
minetest.register_node("farming:seed_cotton", {
description = "Cotton Seed",
tiles = {"farming_cotton_seed.png"},
inventory_image = "farming_cotton_seed.png",
wield_image = "farming_cotton_seed.png",
drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1},
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:cotton_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cotton_1")
end,
})
-- String
-- Cotton
minetest.register_craftitem("farming:string", {
description = "String",
inventory_image = "farming_string.png",
minetest.register_craftitem("farming:cotton", {
description = "Cotton",
inventory_image = "farming_cotton.png",
})
minetest.register_alias("farming:string", "farming:cotton")
-- String to Wool
minetest.register_craft({
@ -34,6 +50,7 @@ minetest.register_node("farming:cotton_1", {
drawtype = "plantlike",
tiles = {"farming_cotton_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -47,6 +64,7 @@ minetest.register_node("farming:cotton_2", {
drawtype = "plantlike",
tiles = {"farming_cotton_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -60,6 +78,7 @@ minetest.register_node("farming:cotton_3", {
drawtype = "plantlike",
tiles = {"farming_cotton_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -73,6 +92,7 @@ minetest.register_node("farming:cotton_4", {
drawtype = "plantlike",
tiles = {"farming_cotton_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -86,12 +106,13 @@ minetest.register_node("farming:cotton_5", {
drawtype = "plantlike",
tiles = {"farming_cotton_5.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
drop = {
items = {
{items = {'farming:seed_cotton'},rarity=1},
{items = {"farming:seed_cotton"},rarity=1},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
@ -108,8 +129,8 @@ minetest.register_node("farming:cotton_6", {
buildable_to = true,
drop = {
items = {
{items = {'farming:string'},rarity=1},
{items = {'farming:string'},rarity=2},
{items = {"farming:cotton"},rarity=1},
{items = {"farming:cotton"},rarity=2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
@ -126,10 +147,10 @@ minetest.register_node("farming:cotton_7", {
buildable_to = true,
drop = {
items = {
{items = {'farming:string'},rarity=1},
{items = {'farming:string'},rarity=2},
{items = {'farming:seed_cotton'},rarity=1},
{items = {'farming:seed_cotton'},rarity=2},
{items = {"farming:cotton"},rarity=1},
{items = {"farming:cotton"},rarity=2},
{items = {"farming:seed_cotton"},rarity=1},
{items = {"farming:seed_cotton"},rarity=2},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
@ -148,12 +169,12 @@ minetest.register_node("farming:cotton_8", {
buildable_to = true,
drop = {
items = {
{items = {'farming:string'},rarity=1},
{items = {'farming:string'},rarity=2},
{items = {'farming:string'},rarity=3},
{items = {'farming:seed_cotton'},rarity=1},
{items = {'farming:seed_cotton'},rarity=2},
{items = {'farming:seed_cotton'},rarity=3},
{items = {"farming:string"},rarity=1},
{items = {"farming:string"},rarity=2},
{items = {"farming:string"},rarity=3},
{items = {"farming:seed_cotton"},rarity=1},
{items = {"farming:seed_cotton"},rarity=2},
{items = {"farming:seed_cotton"},rarity=3},
}
},
selection_box = {type = "fixed",fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},

View File

@ -6,7 +6,7 @@ minetest.register_craftitem("farming:cucumber", {
description = "Cucumber",
inventory_image = "farming_cucumber.png",
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1")
end,
on_use = minetest.item_eat(4),
})

45
mods/farming/donut.lua Normal file
View File

@ -0,0 +1,45 @@
-- Donut (thanks to Bockwurst for making the donut images)
minetest.register_craftitem("farming:donut", {
description = "Donut",
inventory_image = "farming_donut.png",
on_use = minetest.item_eat(4),
})
minetest.register_craft({
output = "farming:donut 3",
recipe = {
{'', 'farming:wheat', ''},
{'farming:wheat', '', 'farming:wheat'},
{'', 'farming:wheat', ''},
}
})
-- Chocolate Donut
minetest.register_craftitem("farming:donut_chocolate", {
description = "Chocolate Donut",
inventory_image = "farming_donut_chocolate.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "farming:donut_chocolate",
recipe = {
{'farming:cocoa_beans'},
{'farming:donut'},
}
})
-- Apple Donut
minetest.register_craftitem("farming:donut_apple", {
description = "Apple Donut",
inventory_image = "farming_donut_apple.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "farming:donut_apple",
recipe = {
{'default:apple'},
{'farming:donut'},
}
})

View File

@ -1,87 +1,9 @@
--= Grass
-- Override default grass and have it drop Wheat Seeds
minetest.register_node(":default:grass_1", {
description = "Grass",
drawtype = "plantlike",
tiles = {"default_grass_1.png"},
-- use a bigger inventory image
inventory_image = "default_grass_3.png",
wield_image = "default_grass_3.png",
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
max_items = 1,
items = {
{items = {'farming:seed_wheat'},rarity = 5},
{items = {'default:grass_1'}},
}
},
groups = {snappy=3,flammable=3,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
--= Disabled the following random grass placement as it crashes servers when protection nearby...
-- on_place = function(itemstack, placer, pointed_thing)
-- -- place a random grass node
-- local stack = ItemStack("default:grass_"..math.random(1,5))
-- local ret = minetest.item_place(stack, placer, pointed_thing)
-- return ItemStack("default:grass_1 "..itemstack:get_count()-(1-ret:get_count()))
-- end,
})
for i=1,5 do
-- Override default Jungle Grass and have it drop Cotton Seeds
minetest.register_node(":default:junglegrass", {
description = "Jungle Grass",
drawtype = "plantlike",
visual_scale = 1.3,
tiles = {"default_junglegrass.png"},
inventory_image = "default_junglegrass.png",
wield_image = "default_junglegrass.png",
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
max_items = 1,
items = {
{items = {'farming:seed_cotton'},rarity = 8},
{items = {'default:junglegrass'}},
}
},
groups = {snappy=3,flammable=2,flora=1,attached_node=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
-- Define rest of grass for growing
for i=2,5 do
minetest.register_node(":default:grass_"..i, {
description = "Grass",
drawtype = "plantlike",
tiles = {"default_grass_"..i..".png"},
inventory_image = "default_grass_"..i..".png",
wield_image = "default_grass_"..i..".png",
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
minetest.override_item("default:grass_"..i, {
drop = {
max_items = 1,
items = {
@ -89,11 +11,18 @@ for i=2,5 do
{items = {'default:grass_1'}},
}
},
groups = {snappy=3,flammable=3,flora=1,attached_node=1,not_in_creative_inventory=1},
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},
},
})
end
end
-- Override default Jungle Grass and have it drop Cotton Seeds
minetest.override_item("default:junglegrass", {
drop = {
max_items = 1,
items = {
{items = {'farming:seed_cotton'},rarity = 8},
{items = {'default:junglegrass'}},
}
},
})

View File

@ -1,15 +1,51 @@
--= Hoes
-- Hoe registration function
farming.register_hoe = function(name, def)
-- Check for : prefix (register new hoes in your mod's namespace)
if name:sub(1,1) ~= ":" then
name = ":" .. name
end
-- Check def table
if def.description == nil then
def.description = "Hoe"
end
if def.inventory_image == nil then
def.inventory_image = "unknown_item.png"
end
if def.recipe == nil then
def.recipe = {
{"air","air",""},
{"","group:stick",""},
{"","group:stick",""}
}
end
if def.max_uses == nil then
def.max_uses = 30
end
-- Register the tool
minetest.register_tool(name, {
description = def.description,
inventory_image = def.inventory_image,
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, def.max_uses)
end
})
-- Register its recipe
minetest.register_craft({
output = name:gsub(":", "", 1),
recipe = def.recipe
})
end
-- Turns nodes with group soil=1 into soil
function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
return
end
if pt.type ~= "node" then
if not pt or pt.type ~= "node" then
return
end
@ -25,10 +61,8 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
local above = minetest.get_node(p)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return
end
if not minetest.registered_nodes[above.name] then
if not minetest.registered_nodes[under.name]
or not minetest.registered_nodes[above.name] then
return
end
@ -53,19 +87,12 @@ function farming.hoe_on_use(itemstack, user, pointed_thing, uses)
return itemstack
end
-- Wooden Hoe
-- Define Hoes
minetest.register_tool("farming:hoe_wood", {
farming.register_hoe(":farming:hoe_wood", {
description = "Wooden Hoe",
inventory_image = "farming_tool_woodhoe.png",
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, 30)
end,
})
minetest.register_craft({
output = "farming:hoe_wood",
max_uses = 30,
recipe = {
{"group:wood", "group:wood"},
{"", "group:stick"},
@ -73,19 +100,10 @@ minetest.register_craft({
}
})
-- Stone Hoe
minetest.register_tool("farming:hoe_stone", {
farming.register_hoe(":farming:hoe_stone", {
description = "Stone Hoe",
inventory_image = "farming_tool_stonehoe.png",
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, 90)
end,
})
minetest.register_craft({
output = "farming:hoe_stone",
max_uses = 90,
recipe = {
{"group:stone", "group:stone"},
{"", "group:stick"},
@ -93,19 +111,10 @@ minetest.register_craft({
}
})
-- Steel Hoe
minetest.register_tool("farming:hoe_steel", {
farming.register_hoe(":farming:hoe_steel", {
description = "Steel Hoe",
inventory_image = "farming_tool_steelhoe.png",
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, 200)
end,
})
minetest.register_craft({
output = "farming:hoe_steel",
max_uses = 200,
recipe = {
{"default:steel_ingot", "default:steel_ingot"},
{"", "group:stick"},
@ -113,19 +122,10 @@ minetest.register_craft({
}
})
-- Bronze Hoe
minetest.register_tool("farming:hoe_bronze", {
farming.register_hoe(":farming:hoe_bronze", {
description = "Bronze Hoe",
inventory_image = "farming_tool_bronzehoe.png",
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, 220)
end,
})
minetest.register_craft({
output = "farming:hoe_bronze",
max_uses = 220,
recipe = {
{"default:bronze_ingot", "default:bronze_ingot"},
{"", "group:stick"},
@ -133,19 +133,10 @@ minetest.register_craft({
}
})
-- Mese
minetest.register_tool("farming:hoe_mese", {
farming.register_hoe(":farming:hoe_mese", {
description = "Mese Hoe",
inventory_image = "farming_tool_mesehoe.png",
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, 350)
end,
})
minetest.register_craft({
output = "farming:hoe_mese",
max_uses = 350,
recipe = {
{"default:mese_crystal", "default:mese_crystal"},
{"", "group:stick"},
@ -153,22 +144,13 @@ minetest.register_craft({
}
})
-- Diamond
minetest.register_tool("farming:hoe_diamond", {
farming.register_hoe(":farming:hoe_diamond", {
description = "Diamond Hoe",
inventory_image = "farming_tool_diamondhoe.png",
on_use = function(itemstack, user, pointed_thing)
return farming.hoe_on_use(itemstack, user, pointed_thing, 500)
end,
})
minetest.register_craft({
output = "farming:hoe_diamond",
max_uses = 500,
recipe = {
{"default:diamond", "default:diamond"},
{"", "group:stick"},
{"", "group:stick"},
}
})
})

View File

@ -1,10 +1,11 @@
--[[
Minetest Farming Redo Mod 1.0 (13th August 2014)
Minetest Farming Redo Mod 1.10 (4th November 2014)
by TenPlus1
Some additions by HeroOfTheWinds for use with SkyTest
]]
farming = {}
farming.mod = "redo"
farming.hoe_on_use = default.hoe_on_use
dofile(minetest.get_modpath("farming").."/soil.lua")
@ -22,46 +23,43 @@ dofile(minetest.get_modpath("farming").."/melon.lua")
dofile(minetest.get_modpath("farming").."/sugar.lua")
dofile(minetest.get_modpath("farming").."/pumpkin.lua")
dofile(minetest.get_modpath("farming").."/cocoa.lua")
dofile(minetest.get_modpath("farming").."/raspberry.lua")
dofile(minetest.get_modpath("farming").."/blueberry.lua")
dofile(minetest.get_modpath("farming").."/rhubarb.lua")
dofile(minetest.get_modpath("farming").."/donut.lua") -- sweet treat
dofile(minetest.get_modpath("farming").."/mapgen.lua")
dofile(minetest.get_modpath("farming").."/compatibility.lua") -- Farming Plus compatibility
-- Place Seeds on Soil
function place_seed(itemstack, placer, pointed_thing, plantname)
function farming.place_seed(itemstack, placer, pointed_thing, plantname)
local pt = pointed_thing
-- check if pointing at a node
if not pt then
if not pt and pt.type ~= "node" then
return
end
if pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local above = minetest.get_node(pt.above)
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return
end
if not minetest.registered_nodes[above.name] then
return
end
-- check if pointing at the top of the node
if pt.above.y ~= pt.under.y+1 then
return
end
-- check if you can replace the node above the pointed node
if not minetest.registered_nodes[above.name].buildable_to then
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name]
or not minetest.registered_nodes[above.name] then
return
end
-- check if pointing at soil
if minetest.get_item_group(under.name, "soil") <= 1 then
-- can I replace above node, and am I pointing at soil
if not minetest.registered_nodes[above.name].buildable_to
or minetest.get_item_group(under.name, "soil") < 2 then
return
end
-- add the node and remove 1 item from the itemstack
minetest.add_node(pt.above, {name=plantname})
if not minetest.setting_getbool("creative_mode") then
@ -88,38 +86,26 @@ minetest.register_abm({
local numb = data[2]
-- check if fully grown
if not minetest.registered_nodes[plant..(numb + 1)] then
return
end
if not minetest.registered_nodes[plant..(numb + 1)] then return end
-- Check for Cocoa Pod
if plant == "farming:cocoa_" and minetest.find_node_near(pos, 1, {"default:jungletree"})then
if plant == "farming:cocoa_" and minetest.find_node_near(pos, 1, {"default:jungletree"}) then
else
-- check if on wet soil
pos.y = pos.y-1
local n = minetest.get_node(pos)
if n.name ~= "farming:soil_wet" then
return
end
pos.y = pos.y+1
-- check if on wet soil
pos.y = pos.y-1
if minetest.get_node(pos).name ~= "farming:soil_wet" then return end
pos.y = pos.y+1
-- check light
if minetest.get_node_light(pos) < 13 then
return
end
-- check light
if minetest.get_node_light(pos) < 13 then return end
end
-- grow
minetest.set_node(pos, {name=plant..(numb + 1)})
-- check for corn
if plant == "farming:corn_" and tonumber(numb) > 4 then
pos.y = pos.y + 1
minetest.set_node(pos, {name=plant..(numb + 1)})
end
end
})
@ -174,3 +160,90 @@ minetest.register_abm({
end
end
})
-- Function to register plants (for compatibility)
farming.register_plant = function(name, def)
local mname = name:split(":")[1]
local pname = name:split(":")[2]
-- Check def table
if not def.description then
def.description = "Seed"
end
if not def.inventory_image then
def.inventory_image = "unknown_item.png"
end
if not def.steps then
return nil
end
-- Register seed
minetest.register_node(":" .. mname .. ":seed_" .. pname, {
description = def.description,
tiles = {def.inventory_image},
inventory_image = def.inventory_image,
wield_image = def.inventory_image,
drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1},
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":"..pname.."_1")
end
})
-- Register harvest
minetest.register_craftitem(":" .. mname .. ":" .. pname, {
description = pname:gsub("^%l", string.upper),
inventory_image = mname .. "_" .. pname .. ".png",
})
-- Register growing steps
for i=1,def.steps do
local drop = {
items = {
{items = {mname .. ":" .. pname}, rarity = 9 - i},
{items = {mname .. ":" .. pname}, rarity= 18 - i * 2},
{items = {mname .. ":seed_" .. pname}, rarity = 9 - i},
{items = {mname .. ":seed_" .. pname}, rarity = 18 - i * 2},
}
}
local g = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1, growing = 1}
-- Last step doesn't need growing=1 so Abm never has to check these
if i == def.steps then
g = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1}
end
minetest.register_node(mname .. ":" .. pname .. "_" .. i, {
drawtype = "plantlike",
waving = 1,
tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"},
paramtype = "light",
walkable = false,
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},},
groups = g,
sounds = default.node_sound_leaves_defaults(),
})
end
-- Return info
local r = {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname}
return r
end
--[[ Cotton (example, is already registered in cotton.lua)
farming.register_plant("farming:cotton", {
description = "Cotton seed",
inventory_image = "farming_cotton_seed.png",
steps = 8,
})
--]]

View File

@ -52,7 +52,7 @@ minetest.register_on_generated(function(minp, maxp, seed)
-- If dirt with grass, add plant in various stages of maturity
if nn == "default:dirt_with_grass" then
local type = math.random(1,8)
local type = math.random(1,11)
if type == 1 and ground_y > 15 then
minetest.set_node(p,{name="farming:potato_"..pr:next(3, 4)})
elseif type == 2 then
@ -69,6 +69,12 @@ minetest.register_on_generated(function(minp, maxp, seed)
minetest.set_node(p,{name="farming:melon_8"})
elseif type == 8 and ground_y > 15 then
minetest.set_node(p,{name="farming:pumpkin_8"})
elseif type == 9 and ground_y > 5 then
minetest.set_node(p,{name="farming:raspberry_4"})
elseif type == 10 and ground_y > 10 then
minetest.set_node(p,{name="farming:rhubarb_3"})
elseif type == 11 and ground_y > 5 then
minetest.set_node(p,{name="farming:blueberry_4"})
end
end
end

View File

@ -5,7 +5,7 @@ minetest.register_craftitem("farming:melon_slice", {
description = "Melon Slice",
inventory_image = "farming_melon_slice.png",
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:melon_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1")
end,
on_use = minetest.item_eat(2),
})
@ -32,6 +32,7 @@ minetest.register_node("farming:melon_1", {
drawtype = "plantlike",
tiles = {"farming_melon_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -45,6 +46,7 @@ minetest.register_node("farming:melon_2", {
drawtype = "plantlike",
tiles = {"farming_melon_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -58,10 +60,10 @@ minetest.register_node("farming:melon_3", {
drawtype = "plantlike",
tiles = {"farming_melon_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = 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},
@ -72,10 +74,10 @@ minetest.register_node("farming:melon_4", {
drawtype = "plantlike",
tiles = {"farming_melon_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = 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},
@ -86,10 +88,10 @@ minetest.register_node("farming:melon_5", {
drawtype = "plantlike",
tiles = {"farming_melon_5.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = 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},
@ -100,10 +102,8 @@ minetest.register_node("farming:melon_6", {
drawtype = "plantlike",
tiles = {"farming_melon_6.png"},
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = 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},
@ -114,10 +114,8 @@ minetest.register_node("farming:melon_7", {
drawtype = "plantlike",
tiles = {"farming_melon_7.png"},
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = 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},
@ -131,7 +129,6 @@ minetest.register_node("farming:melon_8", {
description = "Melon",
tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png"},
paramtype = "light",
waving = 1,
walkable = true,
is_ground_content = true,
drop = {

View File

@ -6,7 +6,7 @@ minetest.register_craftitem("farming:potato", {
description = "Potato",
inventory_image = "farming_potato.png",
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:potato_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1")
end,
on_use = minetest.item_eat(1),
})
@ -30,6 +30,7 @@ minetest.register_node("farming:potato_1", {
drawtype = "plantlike",
tiles = {"farming_potato_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -43,6 +44,7 @@ minetest.register_node("farming:potato_2", {
drawtype = "plantlike",
tiles = {"farming_potato_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -56,6 +58,7 @@ minetest.register_node("farming:potato_3", {
drawtype = "plantlike",
tiles = {"farming_potato_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -77,6 +80,7 @@ minetest.register_node("farming:potato_4", {
drawtype = "plantlike",
tiles = {"farming_potato_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,

View File

@ -17,7 +17,7 @@ minetest.register_craftitem("farming:pumpkin_slice", {
description = "Pumpkin Slice",
inventory_image = "farming_pumpkin_slice.png",
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1")
end,
on_use = minetest.item_eat(2),
})
@ -41,11 +41,28 @@ 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.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=3,flammable=2},
sounds = default.node_sound_wood_defaults(),
on_punch = function(pos, node, puncher)
node.name = "farming:jackolantern_on"
minetest.set_node(pos, node)
end,
})
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,
paramtype2 = "facedir",
groups = {choppy=3,flammable=2,plant=1},
groups = {choppy=3,flammable=2},
sounds = default.node_sound_wood_defaults(),
drop = "farming:jackolantern",
on_punch = function(pos, node, puncher)
node.name = "farming:jackolantern"
minetest.set_node(pos, node)
end,
})
minetest.register_craft({
@ -88,6 +105,7 @@ minetest.register_node("farming:pumpkin_1", {
drawtype = "plantlike",
tiles = {"farming_pumpkin_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -101,6 +119,7 @@ minetest.register_node("farming:pumpkin_2", {
drawtype = "plantlike",
tiles = {"farming_pumpkin_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -114,6 +133,7 @@ minetest.register_node("farming:pumpkin_3", {
drawtype = "plantlike",
tiles = {"farming_pumpkin_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -127,6 +147,7 @@ minetest.register_node("farming:pumpkin_4", {
drawtype = "plantlike",
tiles = {"farming_pumpkin_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -140,6 +161,7 @@ minetest.register_node("farming:pumpkin_5", {
drawtype = "plantlike",
tiles = {"farming_pumpkin_5.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -166,7 +188,6 @@ minetest.register_node("farming:pumpkin_7", {
drawtype = "plantlike",
tiles = {"farming_pumpkin_7.png"},
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
drop = "",
@ -181,7 +202,6 @@ minetest.register_node("farming:pumpkin_8", {
drawtype = "plantlike",
tiles = {"farming_pumpkin_8.png"},
paramtype = "light",
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,

View File

@ -0,0 +1,95 @@
--= Raspberries
minetest.register_craftitem("farming:raspberries", {
description = "Raspberries",
inventory_image = "farming_raspberries.png",
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1")
end,
on_use = minetest.item_eat(1),
})
-- Raspberry Smoothie
minetest.register_craftitem("farming:smoothie_raspberry", {
description = "Raspberry Smoothie",
inventory_image = "farming_raspberry_smoothie.png",
on_use = minetest.item_eat(2, "vessels:drinking_glass"),
})
minetest.register_craft({
output = "farming:smoothie_raspberry",
recipe = {
{"default:snow"},
{"farming:raspberries"},
{"vessels:drinking_glass"},
}
})
-- Define Raspberry growth stages
minetest.register_node("farming:raspberry_1", {
drawtype = "plantlike",
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},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("farming:raspberry_2", {
drawtype = "plantlike",
tiles = {"farming_raspberry_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},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("farming:raspberry_3", {
drawtype = "plantlike",
tiles = {"farming_raspberry_3.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},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Raspberry growth does not have growing=1 so abm never has to check these
minetest.register_node("farming:raspberry_4", {
drawtype = "plantlike",
tiles = {"farming_raspberry_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:raspberries 2'},rarity=1},
{items = {'farming:raspberries'},rarity=2},
{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},
sounds = default.node_sound_leaves_defaults(),
})

79
mods/farming/rhubarb.lua Normal file
View File

@ -0,0 +1,79 @@
--= Rhubarb
minetest.register_craftitem("farming:rhubarb", {
description = "Rhubarb",
inventory_image = "farming_rhubarb.png",
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1")
end,
on_use = minetest.item_eat(1),
})
minetest.register_craftitem("farming:rhubarb_pie", {
description = "Rhubarb Pie",
inventory_image = "farming_rhubarb_pie.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
output = "farming:rhubarb_pie",
recipe = {
{"", "farming:sugar", ""},
{"farming:rhubarb", "farming:rhubarb", "farming:rhubarb"},
{"farming:wheat", "farming:wheat", "farming:wheat"},
}
})
-- Define Rhubarb growth stages
minetest.register_node("farming:rhubarb_1", {
drawtype = "plantlike",
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},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_node("farming:rhubarb_2", {
drawtype = "plantlike",
tiles = {"farming_rhubarb_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},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Rhubarb growth doesnnot have growing=1 so abm never has to check these
minetest.register_node("farming:rhubarb_3", {
drawtype = "plantlike",
tiles = {"farming_rhubarb_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
is_ground_content = true,
drop = {
items = {
{items = {'farming:rhubarb 2'},rarity=1},
{items = {'farming:rhubarb'},rarity=2},
{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},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -11,6 +11,7 @@ minetest.register_node("farming:soil", {
groups = {crumbly=3, not_in_creative_inventory=1, soil=2},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_alias("farming:desert_sand_soil", "farming:soil")
-- Wet Soil
@ -22,6 +23,7 @@ minetest.register_node("farming:soil_wet", {
groups = {crumbly=3, not_in_creative_inventory=1, soil=3},
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_alias("farming:desert_sand_soil_wet", "farming:soil_wet")
-- Rich Soil

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 637 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 590 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 601 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 B

View File

@ -6,7 +6,7 @@ minetest.register_craftitem("farming:tomato", {
description = "Tomato",
inventory_image = "farming_tomato.png",
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:tomato_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1")
end,
on_use = minetest.item_eat(4),
})
@ -17,6 +17,7 @@ minetest.register_node("farming:tomato_1", {
drawtype = "plantlike",
tiles = {"farming_tomato_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -30,6 +31,7 @@ minetest.register_node("farming:tomato_2", {
drawtype = "plantlike",
tiles = {"farming_tomato_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -43,6 +45,7 @@ minetest.register_node("farming:tomato_3", {
drawtype = "plantlike",
tiles = {"farming_tomato_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -56,6 +59,7 @@ minetest.register_node("farming:tomato_4", {
drawtype = "plantlike",
tiles = {"farming_tomato_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -69,6 +73,7 @@ minetest.register_node("farming:tomato_5", {
drawtype = "plantlike",
tiles = {"farming_tomato_5.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -82,6 +87,7 @@ minetest.register_node("farming:tomato_6", {
drawtype = "plantlike",
tiles = {"farming_tomato_6.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,

View File

@ -3,11 +3,28 @@
-- Wheat Seed
minetest.register_craftitem("farming:seed_wheat", {
--minetest.register_craftitem("farming:seed_wheat", {
-- description = "Wheat Seed",
-- inventory_image = "farming_wheat_seed.png",
-- on_place = function(itemstack, placer, pointed_thing)
-- return farming.place_seed(itemstack, placer, pointed_thing, "farming:wheat_1")
-- end,
--})
minetest.register_node("farming:seed_wheat", {
description = "Wheat Seed",
tiles = {"farming_wheat_seed.png"},
inventory_image = "farming_wheat_seed.png",
wield_image = "farming_wheat_seed.png",
drawtype = "signlike",
groups = {seed = 1, snappy = 3, attached_node = 1},
paramtype = "light",
paramtype2 = "wallmounted",
walkable = false,
sunlight_propagates = true,
selection_box = {type = "fixed", fixed = {-0.5, -0.5, -0.5, 0.5, -5/16, 0.5},},
on_place = function(itemstack, placer, pointed_thing)
return place_seed(itemstack, placer, pointed_thing, "farming:wheat_1")
return farming.place_seed(itemstack, placer, pointed_thing, "farming:wheat_1")
end,
})
@ -52,6 +69,7 @@ minetest.register_node("farming:wheat_1", {
drawtype = "plantlike",
tiles = {"farming_wheat_1.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -65,6 +83,7 @@ minetest.register_node("farming:wheat_2", {
drawtype = "plantlike",
tiles = {"farming_wheat_2.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -78,6 +97,7 @@ minetest.register_node("farming:wheat_3", {
drawtype = "plantlike",
tiles = {"farming_wheat_3.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -91,6 +111,7 @@ minetest.register_node("farming:wheat_4", {
drawtype = "plantlike",
tiles = {"farming_wheat_4.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -104,6 +125,7 @@ minetest.register_node("farming:wheat_5", {
drawtype = "plantlike",
tiles = {"farming_wheat_5.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -122,6 +144,7 @@ minetest.register_node("farming:wheat_6", {
drawtype = "plantlike",
tiles = {"farming_wheat_6.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,
@ -140,6 +163,7 @@ minetest.register_node("farming:wheat_7", {
drawtype = "plantlike",
tiles = {"farming_wheat_7.png"},
paramtype = "light",
sunlight_propagates = true,
waving = 1,
walkable = false,
buildable_to = true,

View File

@ -7,7 +7,10 @@ function skylands:farmplant(data, vi)
local c_coffee = minetest.get_content_id("farming:coffee_5")
local c_melon = minetest.get_content_id("farming:melon_8")
local c_pumpkin = minetest.get_content_id("farming:pumpkin_8")
local rand = math.random(1,8)
local c_raspberry = minetest.get_content_id("farming:raspberry_4")
local c_rhubarb = minetest.get_content_id("farming:rhubarb_3")
local c_blueberry = minetest.get_content_id("farming:blueberry_4")
local rand = math.random(1,11)
if rand == 1 then
data[vi] = c_potato
elseif rand == 2 then
@ -22,7 +25,13 @@ function skylands:farmplant(data, vi)
data[vi] = c_coffee
elseif rand == 7 then
data[vi] = c_melon
else
elseif rand == 8 then
data[vi] = c_pumpkin
elseif rand == 9 then
data[vi] = c_raspberry
elseif rand == 10 and ground_y > 10 then
data[vi] = c_rhubarb
else
data[vi] = c_blueberry
end
end

View File

@ -3,6 +3,45 @@ minetest.register_craftitem("skylands:cavorite_handle", {
inventory_image = "skylands_cavorite_handle.png",
})
minetest.register_craftitem("skylands:hallowed_air", {
description = "Hallowed Air",
inventory_image = "skylands_hallowed_air.png",
})
minetest.register_craftitem("skylands:cavorite_jar", {
description = "Cavorite Jar",
inventory_image = "skylands_cavorite_jar.png",
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
if (minetest.find_node_near(user:getpos(), 6, {"skylands:quartz_pillar"}) and user:getpos().y >= 8000) then
return "skylands:hallowed_air"
end
return "skylands:cavorite_jar"
end,
})
minetest.register_craftitem("skylands:holy_hilt", {
description = "Holy Sword Hilt",
inventory_image = "skylands_holy_hilt.png",
})
--
-- HERE IT IS
-- THE HOLY AIR SWORD!!!!
--
minetest.register_tool("skylands:air_sword", {
description = "Air Sword",
inventory_image = "skylands_tool_airsword.png",
tool_capabilities = {
full_punch_interval = 0.1,
max_drop_level=1,
groupcaps={
snappy={times={[1]=0.2, [2]=0.1, [3]=0.05}, uses=999, maxlevel=3},
},
damage_groups = {fleshy=999},
}
})
--
-- Picks
--
@ -321,6 +360,36 @@ minetest.register_tool("skylands:cavorite_sword_diamond", {
--- Crafting
---
--cavorite jar, used to hold hallowed air
minetest.register_craft({
output = "skylands:cavorite_jar",
recipe = {
{"skylands:cavorite", "", "skylands:cavorite"},
{"skylands:cavorite", "", "skylands:cavorite"},
{"skylands:cavorite", "skylands:cavorite", "skylands:cavorite"},
}
})
--holy sword hilt, only possible hilt for the air sword
minetest.register_craft({
output = "skylands:holy_hilt",
recipe = {
{"default:diamond", "skylands:cavorite", "default:diamond"},
{"", "default:gold_ingot", ""},
{"", "default:diamond", ""},
}
})
--The Holy Air Sword
minetest.register_craft({
output = "skylands:air_sword",
recipe = {
{"skylands:hallowed_air"},
{"skylands:hallowed_air"},
{"skylands:holy_hilt"},
}
})
--cavorite handle, base of all tool upgrades
minetest.register_craft({
output = "skylands:cavorite_handle",
@ -549,7 +618,7 @@ minetest.register_craft({
--check to add wear to crafts when previous tool was worn
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
if string.find(itemstack:get_name(), "cavorite") then --either cavorite_handle or a cavorite tool
if string.find(itemstack:get_name(), "cavorite") and (itemstack:get_name() ~= "skylands:cavorite_jar") and (itemstack:get_name() ~= "skylands:cavorite_handle") then --either cavorite_handle or a cavorite tool
local wear = 0 --store wear
local old_tool = false --store old tool used
--loop through old crafting grid to find old tool