add carrots

This commit is contained in:
Jordach 2015-01-25 20:33:14 +00:00
parent 10a7742d54
commit d7a602ab34
164 changed files with 823 additions and 3 deletions

View File

@ -82,7 +82,7 @@ creative_inventory.set_creative_formspec = function(player, start_i, pagenum)
"button[0.3,6.5;1.6,1;creative_prev;<<]"..
"button[2.7,6.5;1.6,1;creative_next;>>]"..
"label[5,1.5;Trash:]"..
"list[detached:creative_trash;main;5,2;1,1;]")
"list[detached:creative_trash;main;5,2;1,1;]".."listcolors[#664620;#f9ca93;#ffffff;#c69c6a;#ffffff]".."background[-0.405,-0.515;13.85,8.75;".."creativeui.png]")
end
minetest.register_on_joinplayer(function(player)
-- If in creative mode, modify player's inventory forms

View File

@ -0,0 +1,186 @@
--= Coffee
minetest.register_craftitem("farming:coffee_beans", {
description = "Coffee Beans",
inventory_image = "farming_coffee_beans.png",
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1")
end,
})
--= Glass Cup
--minetest.register_craftitem("farming:drinking_cup", {
-- description = "Drinking Cup",
-- inventory_image = "vessels_drinking_cup.png",
--})
minetest.register_node("farming:drinking_cup", {
description = "Drinking Cup (empty)",
drawtype = "plantlike",
tiles = {"vessels_drinking_cup.png"},
inventory_image = "vessels_drinking_cup.png",
wield_image = "vessels_drinking_cup.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1},
sounds = default.node_sound_glass_defaults(),
})
minetest.register_craft( {
output = "farming:drinking_cup 5",
recipe = {
{ "default:glass", "", "default:glass" },
{"", "default:glass",""},
}
})
--= Cold Cup of Coffee
--minetest.register_craftitem("farming:coffee_cup", {
-- description = "Cold Cup of Coffee",
-- inventory_image = "farming_coffee_cup.png",
-- on_use = minetest.item_eat(2, "farming:drinking_cup"),
--})
minetest.register_node("farming:coffee_cup", {
description = "Cup of Coffee (cold)",
drawtype = "plantlike",
tiles = {"farming_coffee_cup.png"},
inventory_image = "farming_coffee_cup.png",
wield_image = "farming_coffee_cup.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1},
on_use = minetest.item_eat(2, "farming:drinking_cup"),
sounds = default.node_sound_glass_defaults(),
})
minetest.register_craft( {
output = "farming:coffee_cup",
recipe = {
{"farming:drinking_cup", "farming:coffee_beans","bucket:bucket_water"},
{"","",""},
{"","",""}
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}}
})
minetest.register_craft({
type = "cooking",
cooktime = 5,
output = "farming:coffee_cup_hot",
recipe = "farming:coffee_cup"
})
--= Hot Cup of Coffee
--minetest.register_craftitem("farming:coffee_cup_hot", {
-- description = "Hot Cup of Coffee",
-- inventory_image = "farming_coffee_cup_hot.png",
-- on_use = minetest.item_eat(3, "farming:drinking_cup"),
--})
minetest.register_node("farming:coffee_cup_hot", {
description = "Cup of Coffee (hot)",
drawtype = "plantlike",
tiles = {"farming_coffee_cup_hot.png"},
inventory_image = "farming_coffee_cup_hot.png",
wield_image = "farming_coffee_cup_hot.png",
paramtype = "light",
walkable = false,
selection_box = {
type = "fixed",
fixed = {-0.25, -0.5, -0.25, 0.25, 0.25, 0.25}
},
groups = {vessel=1,dig_immediate=3,attached_node=1},
on_use = minetest.item_eat(3, "farming:drinking_cup"),
sounds = default.node_sound_glass_defaults(),
})
-- Define Coffee growth stages
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,
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:coffee_2", {
drawtype = "plantlike",
tiles = {"farming_coffee_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:coffee_3", {
drawtype = "plantlike",
tiles = {"farming_coffee_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(),
})
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,
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 Coffee growth doesnnot have growing=1 so abm never has to check these
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,
is_ground_content = true,
drop = {
items = {
{items = {'farming:coffee_beans 2'},rarity=1},
{items = {'farming:coffee_beans 2'},rarity=2},
{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},
sounds = default.node_sound_leaves_defaults(),
})

View File

@ -0,0 +1,195 @@
--[[
Minetest Farming Redo Mod 1.10 (4th November 2014)
by TenPlus1
]]
farming = {}
farming.mod = "redo"
farming.hoe_on_use = default.hoe_on_use
dofile(minetest.get_modpath("farming").."/soil.lua")
dofile(minetest.get_modpath("farming").."/hoes.lua")
dofile(minetest.get_modpath("farming").."/grass.lua")
dofile(minetest.get_modpath("farming").."/wheat.lua")
dofile(minetest.get_modpath("farming").."/cotton.lua")
dofile(minetest.get_modpath("farming").."/carrot.lua")
dofile(minetest.get_modpath("farming").."/potato.lua")
dofile(minetest.get_modpath("farming").."/tomato.lua")
dofile(minetest.get_modpath("farming").."/cucumber.lua")
dofile(minetest.get_modpath("farming").."/corn.lua")
dofile(minetest.get_modpath("farming").."/coffee.lua")
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 farming.place_seed(itemstack, placer, pointed_thing, plantname)
local pt = pointed_thing
-- check if pointing at a node
if not pt and pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local above = minetest.get_node(pt.above)
-- check if pointing at the top of the node
if pt.above.y ~= pt.under.y+1 then
return
end
-- 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
-- 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
itemstack:take_item()
end
return itemstack
end
-- Single ABM Handles Growing of All Plants
minetest.register_abm({
nodenames = {"group:growing"},
neighbors = {"farming:soil_wet", "default:jungletree"},
interval = 60,
chance = 2,
action = function(pos, node)
-- get node type (e.g. farming:wheat_1)
local data = nil
data = string.split(node.name, '_', 2)
local plant = data[1].."_"
local numb = data[2]
-- check if fully grown
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
else
-- 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) <= 11 then return end
end
-- grow
minetest.set_node(pos, {name=plant..(numb + 1)})
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

@ -0,0 +1,97 @@
--= Potato (Original textures from DocFarming mod)
-- https://forum.minetest.net/viewtopic.php?id=3948
minetest.register_craftitem("farming:potato", {
description = "Potato",
inventory_image = "farming_potato.png",
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1")
end,
on_use = minetest.item_eat(1),
})
minetest.register_craftitem("farming:baked_potato", {
description = "Baked Potato",
inventory_image = "farming_baked_potato.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
type = "cooking",
cooktime = 10,
output = "farming:baked_potato",
recipe = "farming:potato"
})
-- Define Potato growth stages
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,
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:potato_2", {
drawtype = "plantlike",
tiles = {"farming_potato_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:potato_3", {
drawtype = "plantlike",
tiles = {"farming_potato_3.png"},
paramtype = "light",
sunlight_propagates = true,
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},
sounds = default.node_sound_leaves_defaults(),
})
-- Last stage of Potato growth doesnnot have growing=1 so abm never has to check these
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,
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},
sounds = default.node_sound_leaves_defaults(),
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

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: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 552 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 192 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 197 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 311 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 341 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 189 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 220 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 359 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 339 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 348 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 185 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 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: 378 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 219 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 187 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 237 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 283 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 259 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 271 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 200 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 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: 231 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 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

Some files were not shown because too many files have changed in this diff Show More