Version MFF.
@ -1,27 +0,0 @@
|
||||
farming.register_hoe(name, hoe definition)
|
||||
-> Register a new hoe, see [hoe definition]
|
||||
|
||||
farming.register_plant(name, Plant definition)
|
||||
-> Register a new growing plant, see [Plant definition]
|
||||
|
||||
Hoe Definition
|
||||
{
|
||||
description = "", -- Description for tooltip
|
||||
inventory_image = "unknown_item.png", -- Image to be used as wield- and inventory image
|
||||
max_uses = 30, -- Uses until destroyed
|
||||
recipe = { -- Craft recipe
|
||||
{"air", "air", "air"},
|
||||
{"", "group:stick"},
|
||||
{"", "group:stick"},
|
||||
}
|
||||
}
|
||||
|
||||
Plant definition
|
||||
{
|
||||
description = "", -- Description of seed item
|
||||
inventory_image = "unknown_item.png", -- Image to be used as seed's wield- and inventory image
|
||||
steps = 8, -- How many steps the plant has to grow, until it can be harvested
|
||||
^ Always provide a plant texture for ech step, format: modname_plantname_i.png (i = stepnumber)
|
||||
minlight = 13, -- Minimum light to grow
|
||||
maxlight = LIGHT_MAX -- Maximum light to grow
|
||||
}
|
125
mods/farming/README.txt
Normal file → Executable file
@ -1,23 +1,49 @@
|
||||
Minetest 0.4 mod: farming
|
||||
=========================
|
||||
Farming Redo Mod
|
||||
by TenPlus1
|
||||
|
||||
License of source code:
|
||||
-----------------------
|
||||
Copyright (C) 2014 webdesigner97
|
||||
https://forum.minetest.net/viewtopic.php?id=9019
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
Farming Redo is a simplified version of the built-in farming mod in minetest and comes with wheat, cotton, carrot, cucumber, potato and tomato to start out with which spawn throughout the map... new foods need only be planted on tilled soil so no seeds are required, original wheat and cotton will require seeds which are found inside normal and jungle grass...
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
This mod works by adding your new plant to the {growing=1} group and numbering the stages from _1 to as many stages as you like, but the underscore MUST be used only once in the node name to separate plant from stage number e.g.
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
"farming:cotton_1" through to "farming:cotton_8"
|
||||
"farming:wheat_1" through to "farming:wheat_8"
|
||||
"farming:cucumber_4" through to "farming:cucumber_4"
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
Changelog:
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
||||
1.23 - Huge code tweak and tidy done and added barley seeds to be found in dry grass, barley can make flour for bread also.
|
||||
1.22 - Added grape bushes at high climates which can be cultivated into grape vines using trellis (9 sticks).
|
||||
1.21 - Added auto-refill code for planting crops (thanks crabman77), also fixed a few bugs
|
||||
1.20b- Tidied code, made api compatible with new 0.4.13 changes and changed to soil texture overlays
|
||||
1.20 - NEW growing routine added that allows crops to grow while player is away doing other things (thanks prestidigitator)
|
||||
1.14 - Added Green Beans from Crops mod (thanks sofar), little bushels in the wild but need to be grown using beanpoles crafted with 4 sticks (2 either side)
|
||||
1.13 - Fixed seed double-placement glitch. Mapgen now uses 0.4.12+ for plant generation
|
||||
1.12 - Player cannot place seeds in protected area, also growing speeds changed to match defaults
|
||||
1.11 - Added Straw Bale, streamlined growing abm a little, fixed melon rotation bug with screwdriver
|
||||
1.10 - Added Blueberry Bush and Blueberry Muffins, also Pumpkin/Melon easier to pick up, added check for unloaded map
|
||||
1.09 - Corn now uses single nodes instead of 1 ontop of the other, Ethanol recipe is more expensive (requires 5 corn) and some code cleanup.
|
||||
1.08 - Added Farming Plus compatibility, plus can be removed and no more missing nodes
|
||||
1.07 - Added Rhubarb and Rhubarb Pie
|
||||
1.06 - register_hoe and register_plant added for compatibility with default farming mod, although any plants registered will use farming redo to grow
|
||||
1.05 - Added Raspberry Bushels and Raspberry Smoothie
|
||||
1.04 - Added Donuts... normal, chocolate and apple... and a few code cleanups and now compatible with jungletree's from MoreTrees mod
|
||||
1.03 - Bug fixes and more compatibility as drop-in replacement for built-in farming mod
|
||||
1.02 - Added farming.mod string to help other mods identify which farming mod is running, if it returns "redo" then you're using this one, "" empty is built-in mod
|
||||
1.01 - Crafting coffee or ethanol returns empty bucket/bottle, also Cocoa spawns a little rarer
|
||||
1.0 - Added Cocoa which randomly grows on jungle tree's, pods give cocoa beans which can be used to farm more pods on a jungle trunk or make Cookies which have been added (or other treats)
|
||||
0.9 - Added Pumpkin, Jack 'O Lantern, Pumpkin Slice and Sugar
|
||||
(a huge thanks to painterly.net for allowing me to use their textures)
|
||||
0.8 - Added Watermelon and Melon Slice
|
||||
0.7 - Added Coffee, Coffee Beans, Drinking Cup, Cold and Hot Cup of Coffee
|
||||
0.6 - Added Corn, Corn on the Cob... Also reworked Abm
|
||||
0.5 - Added Carrot, Cucumber, Potato (and Baked Potato), Tomato
|
||||
0.4 - Checks for Protection, also performance changes
|
||||
0.3 - Added Diamond and Mese hoe
|
||||
0.2 - Fixed check for wet soil
|
||||
0.1 - Fixed growing bug
|
||||
0.0 - Initial release
|
||||
|
||||
License of media (textures):
|
||||
----------------------------
|
||||
@ -28,13 +54,13 @@ Created by PilzAdam (License: WTFPL):
|
||||
farming_soil_wet_side.png
|
||||
farming_string.png
|
||||
|
||||
Created by BlockMen (License: CC BY 3.0):
|
||||
farming_tool_diamondhoe.png
|
||||
farming_tool_mesehoe.png
|
||||
Created by Calinou (License: CC BY-SA):
|
||||
farming_tool_bronzehoe.png
|
||||
farming_tool_steelhoe.png
|
||||
farming_tool_stonehoe.png
|
||||
farming_tool_woodhoe.png
|
||||
farming_tool_mesehoe.png
|
||||
farming_tool_diamondhoe.png
|
||||
|
||||
Created by VanessaE (License: WTFPL):
|
||||
farming_cotton_seed.png
|
||||
@ -57,3 +83,68 @@ Created by VanessaE (License: WTFPL):
|
||||
farming_cotton_6.png
|
||||
farming_cotton_7.png
|
||||
farming_cotton_8.png
|
||||
|
||||
Created by Doc (License: WTFPL):
|
||||
farming_cucumber.png
|
||||
farming_cucumber_1.png
|
||||
farming_cucumber_2.png
|
||||
farming_cucumber_3.png
|
||||
farming_cucumber_4.png
|
||||
farming_potato.png
|
||||
farming_potato_1.png
|
||||
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
|
||||
farming_carrot.png
|
||||
farming_carrot_1.png
|
||||
farming_carrot_2.png
|
||||
farming_carrot_3.png
|
||||
farming_carrot_4.png
|
||||
farming_carrot_5.png
|
||||
farming_carrot_6.png
|
||||
farming_carrot_7.png
|
||||
farming_carrot_8.png
|
||||
|
||||
Created by JoseTheCrafter and edited by TenPlus1:
|
||||
farming_tomato.png
|
||||
farming_tomato_1.png
|
||||
farming_tomato_2.png
|
||||
farming_tomato_3.png
|
||||
farming_tomato_4.png
|
||||
farming_tomato_5.png
|
||||
farming_tomato_6.png
|
||||
farming_tomato_7.png
|
||||
farming_tomato_8.png
|
||||
|
||||
Created by GeMinecraft and edited by TenPlus1:
|
||||
farming_corn.png
|
||||
farming_corn_cob.png
|
||||
farming_corn_1.png
|
||||
farming_corn_2.png
|
||||
farming_corn_3.png
|
||||
farming_corn_4.png
|
||||
farming_corn_5.png
|
||||
farming_corn_6.png
|
||||
farming_corn_7.png
|
||||
farming_corn_8.png
|
||||
|
||||
Created by TenPlus1
|
||||
farming_cocoa_1.png
|
||||
farming_cocoa_2.png
|
||||
farming_cocoa_3.png
|
||||
farming_cocoa_beans.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
|
||||
|
@ -1,284 +0,0 @@
|
||||
-- Wear out hoes, place soil
|
||||
-- TODO Ignore group:flower
|
||||
farming.hoe_on_use = function(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
|
||||
return
|
||||
end
|
||||
|
||||
local under = minetest.get_node(pt.under)
|
||||
local p = {x=pt.under.x, y=pt.under.y+1, z=pt.under.z}
|
||||
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
|
||||
return
|
||||
end
|
||||
|
||||
-- check if the node above the pointed thing is air
|
||||
if above.name ~= "air" then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if pointing at soil
|
||||
if minetest.get_item_group(under.name, "soil") ~= 1 then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if (wet) soil defined
|
||||
local regN = minetest.registered_nodes
|
||||
if regN[under.name].soil == nil or regN[under.name].soil.wet == nil or regN[under.name].soil.dry == nil then
|
||||
return
|
||||
end
|
||||
|
||||
-- turn the node into soil, wear out item and play sound
|
||||
minetest.set_node(pt.under, {name = regN[under.name].soil.dry})
|
||||
minetest.sound_play("default_dig_crumbly", {
|
||||
pos = pt.under,
|
||||
gain = 0.5,
|
||||
})
|
||||
itemstack:add_wear(65535/(uses-1))
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- Register new hoes
|
||||
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
|
||||
|
||||
-- Seed placement
|
||||
farming.place_seed = function(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
|
||||
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
|
||||
end
|
||||
|
||||
-- check if pointing at soil
|
||||
if 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, param2 = 1})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- Register plants
|
||||
farming.register_plant = function(name, def)
|
||||
local mname = name:split(":")[1]
|
||||
local pname = name:split(":")[2]
|
||||
-- Check def table
|
||||
if def.description == nil then
|
||||
def.description = "Seed"
|
||||
end
|
||||
if def.inventory_image == nil then
|
||||
def.inventory_image = "unknown_item.png"
|
||||
end
|
||||
if def.steps == nil then
|
||||
return nil
|
||||
end
|
||||
if def.minlight == nil then
|
||||
def.minlight = 1
|
||||
end
|
||||
if def.maxlight == nil then
|
||||
def.maxlight = 14
|
||||
end
|
||||
if not def.fertility then
|
||||
def.fertility = {}
|
||||
end
|
||||
-- Register seed
|
||||
local g = {seed = 1, snappy = 3, attached_node = 1}
|
||||
for k, v in pairs(def.fertility) do
|
||||
g[v] = 1
|
||||
end
|
||||
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 = g,
|
||||
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},
|
||||
},
|
||||
fertility = def.fertility,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, mname .. ":seed_" .. pname)
|
||||
end
|
||||
})
|
||||
-- Seed -> plant
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:seed"},
|
||||
neighbors = {"group:soil"},
|
||||
interval = 90,
|
||||
chance = 2,
|
||||
action = function(pos, node)
|
||||
local seedferts = minetest.registered_nodes[node.name].fertility
|
||||
local soilferts = {}
|
||||
-- Collect fertilities of soil
|
||||
for k, v in pairs(minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name].groups) do
|
||||
if k == "grassland" or k == "desert" then
|
||||
soilferts[k] = k
|
||||
end
|
||||
end
|
||||
-- Cannot grow if no fertility match found
|
||||
local fertmatch = false
|
||||
for k, v in pairs(seedferts) do
|
||||
if soilferts[v] ~= nil then
|
||||
fertmatch = true
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if fertmatch == true and minetest.get_item_group(minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name, "wet") ~= 0 then
|
||||
minetest.set_node(pos, {name = node.name:gsub("seed_", "") .. "_1"})
|
||||
end
|
||||
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 nodegroups = {snappy = 3, flammable = 2, plant = 1, not_in_creative_inventory = 1, attached_node = 1}
|
||||
nodegroups[pname] = i
|
||||
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 = nodegroups,
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
end
|
||||
-- Growing ABM
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:" .. pname},
|
||||
neighbors = {"group:soil"},
|
||||
interval = 90,
|
||||
chance = 2,
|
||||
action = function(pos, node)
|
||||
-- return if already full grown
|
||||
if minetest.get_item_group(node.name, pname) == def.steps then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if on wet soil
|
||||
pos.y = pos.y - 1
|
||||
local n = minetest.get_node(pos)
|
||||
if minetest.get_item_group(n.name, "soil") < 3 then
|
||||
return
|
||||
end
|
||||
pos.y = pos.y + 1
|
||||
|
||||
-- check light
|
||||
if not minetest.get_node_light(pos) then
|
||||
return
|
||||
end
|
||||
if minetest.get_node_light(pos) < def.minlight or minetest.get_node_light(pos) > def.maxlight then
|
||||
return
|
||||
end
|
||||
|
||||
-- grow
|
||||
local height = minetest.get_item_group(node.name, pname) + 1
|
||||
minetest.set_node(pos, {name = mname .. ":" .. pname .. "_" .. height})
|
||||
end
|
||||
})
|
||||
-- Return
|
||||
local r = {
|
||||
seed = mname .. ":seed_" .. pname,
|
||||
harvest = mname .. ":" .. pname
|
||||
}
|
||||
return r
|
||||
end
|
98
mods/farming/barley.lua
Normal file
@ -0,0 +1,98 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- barley seeds
|
||||
minetest.register_node("farming:seed_barley", {
|
||||
description = S("Barley Seed"),
|
||||
tiles = {"farming_barley_seed.png"},
|
||||
inventory_image = "farming_barley_seed.png",
|
||||
wield_image = "farming_barley_seed.png",
|
||||
drawtype = "signlike",
|
||||
groups = {seed = 1, snappy = 3, attached_node = 1},
|
||||
paramtype = "light",
|
||||
paramtype2 = "wallmounted",
|
||||
walkable = false,
|
||||
sunlight_propagates = true,
|
||||
selection_box = farming.select,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:barley_1")
|
||||
end,
|
||||
})
|
||||
|
||||
-- harvested barley
|
||||
minetest.register_craftitem("farming:barley", {
|
||||
description = S("Barley"),
|
||||
inventory_image = "farming_barley.png",
|
||||
})
|
||||
|
||||
-- flour
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "farming:flour",
|
||||
recipe = {"farming:barley", "farming:barley", "farming:barley", "farming:barley"}
|
||||
})
|
||||
|
||||
-- barley definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_barley_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:barley_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_barley_2.png"}
|
||||
minetest.register_node("farming:barley_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_barley_3.png"}
|
||||
minetest.register_node("farming:barley_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_barley_4.png"}
|
||||
minetest.register_node("farming:barley_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5
|
||||
crop_def.tiles = {"farming_barley_5.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:barley'}, rarity = 2},
|
||||
{items = {'farming:seed_barley'}, rarity = 2},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:barley_5", table.copy(crop_def))
|
||||
|
||||
-- stage 6
|
||||
crop_def.tiles = {"farming_barley_6.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:barley'}, rarity = 2},
|
||||
{items = {'farming:seed_barley'}, rarity = 1},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:barley_6", table.copy(crop_def))
|
||||
|
||||
-- stage 7 (final)
|
||||
crop_def.tiles = {"farming_barley_7.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:barley'}, rarity = 1},
|
||||
{items = {'farming:barley'}, rarity = 3},
|
||||
{items = {'farming:seed_barley'}, rarity = 1},
|
||||
{items = {'farming:seed_barley'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:barley_7", table.copy(crop_def))
|
195
mods/farming/beanpole.lua
Executable file
@ -0,0 +1,195 @@
|
||||
--[[
|
||||
All textures by
|
||||
(C) Auke Kok <sofar@foo-projects.org>
|
||||
CC-BY-SA-3.0
|
||||
]]
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- beans
|
||||
minetest.register_craftitem("farming:beans", {
|
||||
description = S("Green Beans"),
|
||||
inventory_image = "farming_beans.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
|
||||
if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
|
||||
return
|
||||
end
|
||||
|
||||
local nodename = minetest.get_node(pointed_thing.under).name
|
||||
|
||||
if nodename == "farming:beanpole" then
|
||||
minetest.set_node(pointed_thing.under, {name = "farming:beanpole_1"})
|
||||
|
||||
minetest.sound_play("default_place_node", {pos = pointed_thing.above, gain = 1.0})
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
|
||||
itemstack:take_item()
|
||||
|
||||
-- check for refill
|
||||
if itemstack:get_count() == 0 then
|
||||
|
||||
minetest.after(0.20,
|
||||
farming.refill_plant,
|
||||
placer,
|
||||
"farming:beans",
|
||||
placer:get_wield_index()
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
-- beans can be used for green dye
|
||||
minetest.register_craft({
|
||||
output = "dye:green",
|
||||
recipe = {
|
||||
{'farming:beans'},
|
||||
}
|
||||
})
|
||||
|
||||
-- beanpole
|
||||
minetest.register_node("farming:beanpole", {
|
||||
description = S("Bean Pole (place on soil before planting beans)"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_beanpole.png"},
|
||||
inventory_image = "farming_beanpole.png",
|
||||
visual_scale = 1.45,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
drop = "farming:beanpole",
|
||||
selection_box = farming.select,
|
||||
groups = {snappy = 3, flammable = 2, attached_node = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local top = {
|
||||
x = pointed_thing.above.x,
|
||||
y = pointed_thing.above.y + 1,
|
||||
z = pointed_thing.above.z
|
||||
}
|
||||
|
||||
if minetest.is_protected(pointed_thing.above, placer:get_player_name())
|
||||
or minetest.is_protected(top, placer:get_player_name()) then -- MFF crabman(18/06/2015)
|
||||
return
|
||||
end
|
||||
local nodename = minetest.get_node(pointed_thing.under).name
|
||||
|
||||
if minetest.get_item_group(nodename, "soil") < 2 then
|
||||
return
|
||||
end
|
||||
|
||||
nodename = minetest.get_node(top).name
|
||||
|
||||
if nodename ~= "air" then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.set_node(pointed_thing.above, {name = "farming:beanpole"})
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:beanpole",
|
||||
recipe = {
|
||||
{'', '', ''},
|
||||
{'default:stick', '', 'default:stick'},
|
||||
{'default:stick', '', 'default:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "farming:beanpole",
|
||||
burntime = 10,
|
||||
})
|
||||
|
||||
-- green bean definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_beanpole_1.png"},
|
||||
visual_scale = 1.45,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:beanpole'}, rarity = 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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:beanpole_1", table.copy(crop_def))
|
||||
|
||||
-- stage2
|
||||
crop_def.tiles = {"farming_beanpole_2.png"}
|
||||
minetest.register_node("farming:beanpole_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_beanpole_3.png"}
|
||||
minetest.register_node("farming:beanpole_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_beanpole_4.png"}
|
||||
minetest.register_node("farming:beanpole_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5 (final)
|
||||
crop_def.tiles = {"farming_beanpole_5.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:beanpole'}, rarity = 1},
|
||||
{items = {'farming:beans 3'}, rarity = 1},
|
||||
{items = {'farming:beans 2'}, rarity = 2},
|
||||
{items = {'farming:beans 2'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:beanpole_5", table.copy(crop_def))
|
||||
|
||||
-- wild green bean bush (this is what you find on the map)
|
||||
minetest.register_node("farming:beanbush", {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_beanbush.png"},
|
||||
paramtype = "light",
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:beans 1'}, rarity = 1},
|
||||
{items = {'farming:beans 1'}, rarity = 2},
|
||||
{items = {'farming:beans 1'}, rarity = 3},
|
||||
}
|
||||
},
|
||||
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(),
|
||||
})
|
67
mods/farming/blueberry.lua
Executable file
@ -0,0 +1,67 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- blueberries
|
||||
minetest.register_craftitem("farming:blueberries", {
|
||||
description = S("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 @ deviantart.com for muffin image)
|
||||
|
||||
minetest.register_craftitem("farming:muffin_blueberry", {
|
||||
description = S("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"},
|
||||
}
|
||||
})
|
||||
|
||||
-- blueberry definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_blueberry_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:blueberry_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_blueberry_2.png"}
|
||||
minetest.register_node("farming:blueberry_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_blueberry_3.png"}
|
||||
minetest.register_node("farming:blueberry_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4 (final)
|
||||
crop_def.tiles = {"farming_blueberry_4.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:blueberries 2'}, rarity = 1},
|
||||
{items = {'farming:blueberries'}, rarity = 2},
|
||||
{items = {'farming:blueberries'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:blueberry_4", table.copy(crop_def))
|
95
mods/farming/carrot.lua
Executable file
@ -0,0 +1,95 @@
|
||||
|
||||
--[[
|
||||
Original textures from PixelBox texture pack
|
||||
https://forum.minetest.net/viewtopic.php?id=4990
|
||||
]]
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- carrot
|
||||
minetest.register_craftitem("farming:carrot", {
|
||||
description = S("Carrot"),
|
||||
inventory_image = "farming_carrot.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(4),
|
||||
})
|
||||
|
||||
-- golden carrot
|
||||
minetest.register_craftitem("farming:carrot_gold", {
|
||||
description = S("Golden Carrot"),
|
||||
inventory_image = "farming_carrot_gold.png",
|
||||
on_use = minetest.item_eat(6),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:carrot_gold",
|
||||
recipe = {
|
||||
{"", "default:gold_lump", ""},
|
||||
{"default:gold_lump", "farming:carrot", "default:gold_lump"},
|
||||
{"", "default:gold_lump", ""},
|
||||
}
|
||||
})
|
||||
|
||||
-- carrot definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_carrot_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:carrot_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_carrot_2.png"}
|
||||
minetest.register_node("farming:carrot_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_carrot_3.png"}
|
||||
minetest.register_node("farming:carrot_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_carrot_4.png"}
|
||||
minetest.register_node("farming:carrot_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5
|
||||
crop_def.tiles = {"farming_carrot_5.png"}
|
||||
minetest.register_node("farming:carrot_5", table.copy(crop_def))
|
||||
|
||||
-- stage 6
|
||||
crop_def.tiles = {"farming_carrot_6.png"}
|
||||
minetest.register_node("farming:carrot_6", table.copy(crop_def))
|
||||
|
||||
-- stage 7
|
||||
crop_def.tiles = {"farming_carrot_7.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:carrot'}, rarity = 1},
|
||||
{items = {'farming:carrot 2'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:carrot_7", table.copy(crop_def))
|
||||
|
||||
-- stage 8 (final)
|
||||
crop_def.tiles = {"farming_carrot_8.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:carrot 2'}, rarity = 1},
|
||||
{items = {'farming:carrot 3'}, rarity = 2},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:carrot_8", table.copy(crop_def))
|
174
mods/farming/cocoa.lua
Executable file
@ -0,0 +1,174 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- place cocoa
|
||||
function place_cocoa(itemstack, placer, pointed_thing, plantname)
|
||||
|
||||
local pt = pointed_thing
|
||||
|
||||
-- check if pointing at a node
|
||||
if not pt or pt.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
local under = minetest.get_node(pt.under)
|
||||
|
||||
-- return if any of the nodes are not registered
|
||||
if not minetest.registered_nodes[under.name] then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if pointing at jungletree
|
||||
if under.name ~= "default:jungletree"
|
||||
or minetest.get_node(pt.above).name ~= "air" then
|
||||
return
|
||||
end
|
||||
|
||||
-- add the node and remove 1 item from the itemstack
|
||||
minetest.set_node(pt.above, {name = plantname})
|
||||
|
||||
minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
|
||||
itemstack:take_item()
|
||||
|
||||
-- check for refill
|
||||
if itemstack:get_count() == 0 then
|
||||
|
||||
minetest.after(0.20,
|
||||
farming.refill_plant,
|
||||
placer,
|
||||
"farming:cocoa_beans",
|
||||
placer:get_wield_index()
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- cocoa beans
|
||||
minetest.register_craftitem("farming:cocoa_beans", {
|
||||
description = S("Cocoa Beans"),
|
||||
inventory_image = "farming_cocoa_beans.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "dye:brown 2",
|
||||
recipe = {
|
||||
{ "farming:cocoa_beans" },
|
||||
}
|
||||
})
|
||||
|
||||
-- chocolate cookie
|
||||
minetest.register_craftitem("farming:cookie", {
|
||||
description = S("Cookie"),
|
||||
inventory_image = "farming_cookie.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "farming:cookie 8",
|
||||
recipe = {
|
||||
{ "farming:wheat", "farming:cocoa_beans", "farming:wheat" },
|
||||
}
|
||||
})
|
||||
|
||||
-- bar of dark chocolate (thanks to Ice Pandora for her deviantart.com chocolate tutorial)
|
||||
minetest.register_craftitem("farming:chocolate_dark", {
|
||||
description = S("Bar of Dark Chocolate"),
|
||||
inventory_image = "farming_chocolate_dark.png",
|
||||
on_use = minetest.item_eat(2), --/MFF (Mg|05/26/2015)
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "farming:chocolate_dark",
|
||||
recipe = {
|
||||
{ "farming:cocoa_beans", "farming:cocoa_beans", "farming:cocoa_beans" },
|
||||
}
|
||||
})
|
||||
|
||||
-- cocoa definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_cocoa_1.png"},
|
||||
paramtype = "light",
|
||||
walkable = true,
|
||||
drop = {
|
||||
items = {
|
||||
{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, growing = 1,
|
||||
not_in_creative_inventory=1, leafdecay = 1, leafdecay_drop = 1
|
||||
},
|
||||
sounds = default.node_sound_leaves_defaults()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:cocoa_1", table.copy(crop_def))
|
||||
|
||||
-- stage2
|
||||
crop_def.tiles = {"farming_cocoa_2.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:cocoa_beans 1'}, rarity = 1},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:cocoa_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3 (final)
|
||||
crop_def.tiles = {"farming_cocoa_3.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:cocoa_beans 2'}, rarity = 1},
|
||||
{items = {'farming:cocoa_beans 1'}, rarity = 2},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:cocoa_3", table.copy(crop_def))
|
||||
|
||||
-- add random cocoa pods to jungle tree trunks
|
||||
minetest.register_abm({
|
||||
nodenames = {"default:jungletree"},
|
||||
neighbors = {"default:jungleleaves", "moretrees:jungletree_leaves_green"},
|
||||
interval = 8,
|
||||
chance = 80,
|
||||
catch_up = false,
|
||||
action = function(pos, node)
|
||||
|
||||
local dir = math.random(1, 50)
|
||||
|
||||
if dir == 1 then
|
||||
pos.x = pos.x + 1
|
||||
elseif dir == 2 then
|
||||
pos.x = pos.x - 1
|
||||
elseif dir == 3 then
|
||||
pos.z = pos.z + 1
|
||||
elseif dir == 4 then
|
||||
pos.z = pos.z -1
|
||||
else return
|
||||
end
|
||||
|
||||
local nodename = minetest.get_node(pos).name
|
||||
|
||||
if nodename == "air"
|
||||
and minetest.get_node_light(pos) > 12 then
|
||||
|
||||
--print ("Cocoa Pod added at " .. minetest.pos_to_string(pos))
|
||||
|
||||
minetest.set_node(pos, {
|
||||
name = "farming:cocoa_" .. tostring(math.random(1, 3))
|
||||
})
|
||||
end
|
||||
end,
|
||||
})
|
132
mods/farming/coffee.lua
Executable file
@ -0,0 +1,132 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- coffee
|
||||
minetest.register_craftitem("farming:coffee_beans", {
|
||||
description = S("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,
|
||||
})
|
||||
|
||||
|
||||
-- drinking cup
|
||||
minetest.register_node("farming:drinking_cup", {
|
||||
description = S("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_node("farming:coffee_cup", {
|
||||
description = S("Cold Cup of Coffee"),
|
||||
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_node("farming:coffee_cup_hot", {
|
||||
description = S("Hot Cup of Coffee"),
|
||||
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(),
|
||||
})
|
||||
|
||||
-- coffee definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_coffee_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:coffee_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_coffee_2.png"}
|
||||
minetest.register_node("farming:coffee_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_coffee_3.png"}
|
||||
minetest.register_node("farming:coffee_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_coffee_4.png"}
|
||||
minetest.register_node("farming:coffee_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5 (final)
|
||||
crop_def.tiles = {"farming_coffee_5.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:coffee_beans 2'}, rarity = 1},
|
||||
{items = {'farming:coffee_beans 2'}, rarity = 2},
|
||||
{items = {'farming:coffee_beans 2'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:coffee_5", table.copy(crop_def))
|
101
mods/farming/compatibility.lua
Executable file
@ -0,0 +1,101 @@
|
||||
-- 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")
|
||||
|
||||
-- Moreores
|
||||
minetest.register_alias("moreores:hoe_silver", "farming:hoe_silver")
|
||||
minetest.register_alias("moreores:hoe_mithril", "farming:hoe_mithril")
|
116
mods/farming/corn.lua
Executable file
@ -0,0 +1,116 @@
|
||||
|
||||
--[[
|
||||
Original textures from GeMinecraft
|
||||
http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/wip-mods/1440575-1-2-5-generation-minecraft-beta-1-2-farming-and
|
||||
]]
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- corn
|
||||
minetest.register_craftitem("farming:corn", {
|
||||
description = S("Corn"),
|
||||
inventory_image = "farming_corn.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(3),
|
||||
})
|
||||
|
||||
-- corn on the cob (texture by TenPlus1)
|
||||
minetest.register_craftitem("farming:corn_cob", {
|
||||
description = S("Corn on the Cob"),
|
||||
inventory_image = "farming_corn_cob.png",
|
||||
on_use = minetest.item_eat(5),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 10,
|
||||
output = "farming:corn_cob",
|
||||
recipe = "farming:corn"
|
||||
})
|
||||
|
||||
-- ethanol (thanks to JKMurray for this idea)
|
||||
minetest.register_craftitem("farming:bottle_ethanol", {
|
||||
description = S("Bottle of Ethanol"),
|
||||
inventory_image = "farming_bottle_ethanol.png",
|
||||
})
|
||||
|
||||
minetest.register_craft( {
|
||||
output = "farming:bottle_ethanol",
|
||||
recipe = {
|
||||
{ "vessels:glass_bottle", "farming:corn", "farming:corn"},
|
||||
{ "farming:corn", "farming:corn", "farming:corn"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "farming:bottle_ethanol",
|
||||
burntime = 240,
|
||||
replacements = {{ "farming:bottle_ethanol", "vessels:glass_bottle"}}
|
||||
})
|
||||
|
||||
-- corn definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_corn_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:corn_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_corn_2.png"}
|
||||
minetest.register_node("farming:corn_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_corn_3.png"}
|
||||
minetest.register_node("farming:corn_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_corn_4.png"}
|
||||
minetest.register_node("farming:corn_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5
|
||||
crop_def.tiles = {"farming_corn_5.png"}
|
||||
minetest.register_node("farming:corn_5", table.copy(crop_def))
|
||||
|
||||
-- stage 6
|
||||
crop_def.tiles = {"farming_corn_6.png"}
|
||||
crop_def.visual_scale = 1.45
|
||||
minetest.register_node("farming:corn_6", table.copy(crop_def))
|
||||
|
||||
-- stage 7
|
||||
crop_def.tiles = {"farming_corn_7.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:corn'}, rarity = 1},
|
||||
{items = {'farming:corn'}, rarity = 2},
|
||||
{items = {'farming:corn'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:corn_7", table.copy(crop_def))
|
||||
|
||||
-- stage 8 (final)
|
||||
crop_def.tiles = {"farming_corn_8.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:corn 2'}, rarity = 1},
|
||||
{items = {'farming:corn 2'}, rarity = 2},
|
||||
{items = {'farming:corn 2'}, rarity = 2},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:corn_8", table.copy(crop_def))
|
123
mods/farming/cotton.lua
Executable file
@ -0,0 +1,123 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- cotton seeds
|
||||
minetest.register_node("farming:seed_cotton", {
|
||||
description = S("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 = farming.select,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cotton_1")
|
||||
end,
|
||||
})
|
||||
|
||||
-- cotton / string
|
||||
|
||||
minetest.register_craftitem("farming:cotton", {
|
||||
description = S("Cotton"),
|
||||
inventory_image = "farming_cotton.png",
|
||||
})
|
||||
|
||||
minetest.register_alias("farming:string", "farming:cotton")
|
||||
|
||||
-- cotton to wool
|
||||
minetest.register_craft({
|
||||
output = "wool:white",
|
||||
recipe = {
|
||||
{"farming:string", "farming:string"},
|
||||
{"farming:string", "farming:string"},
|
||||
}
|
||||
})
|
||||
|
||||
-- cotton definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_cotton_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:cotton_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_cotton_2.png"}
|
||||
minetest.register_node("farming:cotton_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_cotton_3.png"}
|
||||
minetest.register_node("farming:cotton_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_cotton_4.png"}
|
||||
minetest.register_node("farming:cotton_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5
|
||||
crop_def.tiles = {"farming_cotton_5.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {"farming:seed_cotton"}, rarity = 1},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:cotton_5", table.copy(crop_def))
|
||||
|
||||
-- stage 6
|
||||
crop_def.tiles = {"farming_cotton_6.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {"farming:cotton"}, rarity = 1},
|
||||
{items = {"farming:cotton"}, rarity = 2},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:cotton_6", table.copy(crop_def))
|
||||
|
||||
-- stage 7
|
||||
crop_def.tiles = {"farming_cotton_7.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {"farming:cotton"}, rarity = 1},
|
||||
{items = {"farming:cotton"}, rarity = 2},
|
||||
{items = {"farming:seed_cotton"}, rarity = 1},
|
||||
{items = {"farming:seed_cotton"}, rarity = 2},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:cotton_7", table.copy(crop_def))
|
||||
|
||||
-- stage 8 (final)
|
||||
crop_def.tiles = {"farming_cotton_8.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.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},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:cotton_8", table.copy(crop_def))
|
||||
|
||||
--[[ Cotton (example, is already registered in cotton.lua)
|
||||
farming.register_plant("farming:cotton", {
|
||||
description = "Cotton seed",
|
||||
inventory_image = "farming_cotton_seed.png",
|
||||
steps = 8,
|
||||
})]]
|
55
mods/farming/cucumber.lua
Executable file
@ -0,0 +1,55 @@
|
||||
|
||||
--[[
|
||||
Original textures from DocFarming mod
|
||||
https://forum.minetest.net/viewtopic.php?id=3948
|
||||
]]
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- cucumber
|
||||
minetest.register_craftitem("farming:cucumber", {
|
||||
description = S("Cucumber"),
|
||||
inventory_image = "farming_cucumber.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(4),
|
||||
})
|
||||
|
||||
-- cucumber definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_cucumber_1.png"},
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:cucumber_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_cucumber_2.png"}
|
||||
minetest.register_node("farming:cucumber_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_cucumber_3.png"}
|
||||
minetest.register_node("farming:cucumber_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4 (final)
|
||||
crop_def.tiles = {"farming_cucumber_4.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:cucumber'}, rarity = 1},
|
||||
{items = {'farming:cucumber 2'}, rarity = 2},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:cucumber_4", table.copy(crop_def))
|
1
mods/farming/depends.txt
Normal file → Executable file
@ -1,2 +1,3 @@
|
||||
default
|
||||
wool
|
||||
intllib?
|
||||
|
1
mods/farming/description.txt
Normal file
@ -0,0 +1 @@
|
||||
Adds many plants and food to Minetest
|
48
mods/farming/donut.lua
Executable file
@ -0,0 +1,48 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- Donut (thanks to Bockwurst for making the donut images)
|
||||
minetest.register_craftitem("farming:donut", {
|
||||
description = S("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 = S("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 = S("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'},
|
||||
}
|
||||
})
|
202
mods/farming/grapes.lua
Executable file
@ -0,0 +1,202 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- grapes
|
||||
minetest.register_craftitem("farming:grapes", {
|
||||
description = S("Grapes"),
|
||||
inventory_image = "farming_grapes.png",
|
||||
on_use = minetest.item_eat(2),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
|
||||
if minetest.is_protected(pointed_thing.under, placer:get_player_name()) then
|
||||
return
|
||||
end
|
||||
|
||||
local nodename = minetest.get_node(pointed_thing.under).name
|
||||
|
||||
if nodename == "farming:trellis" then
|
||||
minetest.set_node(pointed_thing.under, {name = "farming:grapes_1"})
|
||||
|
||||
minetest.sound_play("default_place_node", {pos = pointed_thing.above, gain = 1.0})
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
|
||||
itemstack:take_item()
|
||||
|
||||
-- check for refill
|
||||
if itemstack:get_count() == 0 then
|
||||
|
||||
minetest.after(0.20,
|
||||
farming.refill_plant,
|
||||
placer,
|
||||
"farming:grapes",
|
||||
placer:get_wield_index()
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
-- grapes can be used for violet dye
|
||||
minetest.register_craft({
|
||||
output = "dye:violet",
|
||||
recipe = {
|
||||
{'farming:grapes'},
|
||||
}
|
||||
})
|
||||
|
||||
-- trellis
|
||||
minetest.register_node("farming:trellis", {
|
||||
description = S("Trellis (place on soil before planting grapes)"),
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_trellis.png"},
|
||||
inventory_image = "farming_trellis.png",
|
||||
visual_scale = 1.45,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
drop = "farming:trellis",
|
||||
selection_box = farming.select,
|
||||
groups = {snappy = 3, flammable = 2, attached_node = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local top = {
|
||||
x = pointed_thing.above.x,
|
||||
y = pointed_thing.above.y + 1,
|
||||
z = pointed_thing.above.z
|
||||
}
|
||||
if minetest.is_protected(pointed_thing.above, placer:get_player_name())
|
||||
or minetest.is_protected(top, placer:get_player_name()) then -- MFF crabman(18/06/2015)
|
||||
return
|
||||
end
|
||||
|
||||
local nodename = minetest.get_node(pointed_thing.under).name
|
||||
|
||||
if minetest.get_item_group(nodename, "soil") < 2 then
|
||||
return
|
||||
end
|
||||
|
||||
nodename = minetest.get_node(top).name
|
||||
|
||||
if nodename ~= "air" then
|
||||
return
|
||||
end
|
||||
|
||||
minetest.set_node(pointed_thing.above, {name = "farming:trellis"})
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:trellis",
|
||||
recipe = {
|
||||
{'default:stick', 'default:stick', 'default:stick'},
|
||||
{'default:stick', 'default:stick', 'default:stick'},
|
||||
{'default:stick', '', 'default:stick'},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "farming:trellis",
|
||||
burntime = 15,
|
||||
})
|
||||
|
||||
-- grapes definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_grapes_1.png"},
|
||||
visual_scale = 1.45,
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:trellis'}, rarity = 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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:grapes_1", table.copy(crop_def))
|
||||
|
||||
-- stage2
|
||||
crop_def.tiles = {"farming_grapes_2.png"}
|
||||
minetest.register_node("farming:grapes_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_grapes_3.png"}
|
||||
minetest.register_node("farming:grapes_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_grapes_4.png"}
|
||||
minetest.register_node("farming:grapes_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5
|
||||
crop_def.tiles = {"farming_grapes_5.png"}
|
||||
minetest.register_node("farming:grapes_5", table.copy(crop_def))
|
||||
|
||||
-- stage 6
|
||||
crop_def.tiles = {"farming_grapes_6.png"}
|
||||
minetest.register_node("farming:grapes_6", table.copy(crop_def))
|
||||
|
||||
-- stage 7
|
||||
crop_def.tiles = {"farming_grapes_7.png"}
|
||||
minetest.register_node("farming:grapes_7", table.copy(crop_def))
|
||||
|
||||
-- stage 8 (final)
|
||||
crop_def.tiles = {"farming_grapes_8.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:trellis'}, rarity = 1},
|
||||
{items = {'farming:grapes 3'}, rarity = 1},
|
||||
{items = {'farming:grapes 1'}, rarity = 2},
|
||||
{items = {'farming:grapes 1'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:grapes_8", table.copy(crop_def))
|
||||
|
||||
-- wild grape vine (this is what you find on the map)
|
||||
minetest.register_node("farming:grapebush", {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_grapebush.png"},
|
||||
paramtype = "light",
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
sunlight_propagates = true,
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:grapes 1'}, rarity = 1},
|
||||
{items = {'farming:grapes 1'}, rarity = 2},
|
||||
{items = {'farming:grapes 1'}, rarity = 3},
|
||||
}
|
||||
},
|
||||
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(),
|
||||
})
|
42
mods/farming/grass.lua
Executable file
@ -0,0 +1,42 @@
|
||||
|
||||
for i = 3, 5 do
|
||||
|
||||
-- Override default grass and have it drop Wheat Seeds
|
||||
|
||||
minetest.override_item("default:grass_" .. i, {
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {'farming:seed_wheat'}, rarity = 5},
|
||||
{items = {'default:grass_1'}},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
-- Override default dry grass and have it drop Barley Seeds
|
||||
if minetest.registered_nodes["default:dry_grass_1"] then
|
||||
|
||||
minetest.override_item("default:dry_grass_" .. i, {
|
||||
drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {'farming:seed_barley'}, rarity = 6},
|
||||
{items = {'default:dry_grass_1'}},
|
||||
}
|
||||
},
|
||||
})
|
||||
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'}},
|
||||
}
|
||||
},
|
||||
})
|
188
mods/farming/hoes.lua
Normal file → Executable file
@ -1,65 +1,181 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- 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
|
||||
if def.material == nil then
|
||||
minetest.register_craft({
|
||||
output = name:sub(2),
|
||||
recipe = def.recipe
|
||||
})
|
||||
else
|
||||
minetest.register_craft({
|
||||
output = name:sub(2),
|
||||
recipe = {
|
||||
{def.material, def.material, ""},
|
||||
{"", "group:stick", ""},
|
||||
{"", "group:stick", ""}
|
||||
}
|
||||
})
|
||||
-- Reverse Recipe
|
||||
minetest.register_craft({
|
||||
output = name:sub(2),
|
||||
recipe = {
|
||||
{"", def.material, def.material},
|
||||
{"", "group:stick", ""},
|
||||
{"", "group:stick", ""}
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- Turns dirt 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 or pt.type ~= "node" then
|
||||
return
|
||||
end
|
||||
|
||||
local under = minetest.get_node(pt.under)
|
||||
local upos = pointed_thing.under
|
||||
|
||||
if minetest.is_protected(upos, user:get_player_name()) then
|
||||
minetest.record_protection_violation(upos, user:get_player_name())
|
||||
return
|
||||
end
|
||||
|
||||
local p = {x = pt.under.x, y = pt.under.y + 1, z = pt.under.z}
|
||||
local above = minetest.get_node(p)
|
||||
|
||||
-- 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 the node above the pointed thing is air
|
||||
if above.name ~= "air" then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if pointing at dirt
|
||||
if minetest.get_item_group(under.name, "soil") ~= 1 then
|
||||
return
|
||||
end
|
||||
|
||||
-- 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})
|
||||
if not minetest.setting_getbool("creative_mode") then --MFF DEBUT crabman(26/07/2015) not wearout if creative mod and invtweak refill break tools
|
||||
local tool_name = itemstack:get_name()
|
||||
itemstack:add_wear(65535/(uses-1))
|
||||
if itemstack:get_wear() == 0 and minetest.get_modpath("invtweak") then
|
||||
local index = user:get_wield_index()
|
||||
minetest.sound_play("invtweak_tool_break", {pos = user:getpos(), gain = 0.9, max_hear_distance = 5})
|
||||
minetest.after(0.20, refill, user, tool_name, index)
|
||||
end
|
||||
end --MFF FIN
|
||||
return itemstack
|
||||
end
|
||||
|
||||
-- Define Hoes
|
||||
-- Material fields added for MFF
|
||||
|
||||
farming.register_hoe(":farming:hoe_wood", {
|
||||
description = "Wooden Hoe",
|
||||
description = S("Wooden Hoe"),
|
||||
inventory_image = "farming_tool_woodhoe.png",
|
||||
max_uses = 30,
|
||||
recipe = {
|
||||
{"group:wood", "group:wood"},
|
||||
{"", "group:stick"},
|
||||
{"", "group:stick"},
|
||||
}
|
||||
material = "group:wood"
|
||||
})
|
||||
|
||||
farming.register_hoe(":farming:hoe_stone", {
|
||||
description = "Stone Hoe",
|
||||
description = S("Stone Hoe"),
|
||||
inventory_image = "farming_tool_stonehoe.png",
|
||||
max_uses = 90,
|
||||
recipe = {
|
||||
{"group:stone", "group:stone"},
|
||||
{"", "group:stick"},
|
||||
{"", "group:stick"},
|
||||
}
|
||||
material = "group:stone"
|
||||
})
|
||||
|
||||
farming.register_hoe(":farming:hoe_steel", {
|
||||
description = "Steel Hoe",
|
||||
description = S("Steel Hoe"),
|
||||
inventory_image = "farming_tool_steelhoe.png",
|
||||
max_uses = 200,
|
||||
recipe = {
|
||||
{"default:steel_ingot", "default:steel_ingot"},
|
||||
{"", "group:stick"},
|
||||
{"", "group:stick"},
|
||||
}
|
||||
material = "default:steel_ingot"
|
||||
})
|
||||
|
||||
farming.register_hoe(":farming:hoe_bronze", {
|
||||
description = "Bronze Hoe",
|
||||
description = S("Bronze Hoe"),
|
||||
inventory_image = "farming_tool_bronzehoe.png",
|
||||
max_uses = 220,
|
||||
recipe = {
|
||||
{"default:bronze_ingot", "default:bronze_ingot"},
|
||||
{"", "group:stick"},
|
||||
{"", "group:stick"},
|
||||
}
|
||||
material = "default:bronze_ingot"
|
||||
})
|
||||
|
||||
farming.register_hoe(":farming:hoe_silver", {
|
||||
description = S("Silver Hoe"),
|
||||
inventory_image = "farming_tool_silverhoe.png",
|
||||
max_uses = 300,
|
||||
material = "default:silver_ingot"
|
||||
})
|
||||
|
||||
farming.register_hoe(":farming:hoe_mese", {
|
||||
description = "Mese Hoe",
|
||||
description = S("Mese Hoe"),
|
||||
inventory_image = "farming_tool_mesehoe.png",
|
||||
max_uses = 350,
|
||||
recipe = {
|
||||
{"default:mese_crystal", "default:mese_crystal"},
|
||||
{"", "group:stick"},
|
||||
{"", "group:stick"},
|
||||
}
|
||||
material = "default:mese_crystal"
|
||||
})
|
||||
|
||||
farming.register_hoe(":farming:hoe_diamond", {
|
||||
description = "Diamond Hoe",
|
||||
description = S("Diamond Hoe"),
|
||||
inventory_image = "farming_tool_diamondhoe.png",
|
||||
max_uses = 500,
|
||||
recipe = {
|
||||
{"default:diamond", "default:diamond"},
|
||||
{"", "group:stick"},
|
||||
{"", "group:stick"},
|
||||
}
|
||||
material = "default:diamond"
|
||||
})
|
||||
|
||||
farming.register_hoe(":farming:hoe_mithril", {
|
||||
description = S("Mithril Hoe"),
|
||||
inventory_image = "farming_tool_mithrilhoe.png",
|
||||
max_uses = 1000,
|
||||
material = "default:mithril_ingot"
|
||||
})
|
||||
|
750
mods/farming/init.lua
Normal file → Executable file
@ -1,64 +1,708 @@
|
||||
-- Global farming namespace
|
||||
--[[
|
||||
Minetest Farming Redo Mod 1.22 (4th June 2016)
|
||||
by TenPlus1
|
||||
NEW growing routine by prestidigitator
|
||||
auto-refill by crabman77
|
||||
]]
|
||||
|
||||
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}
|
||||
}
|
||||
|
||||
-- Load files
|
||||
dofile(farming.path .. "/api.lua")
|
||||
dofile(farming.path .. "/nodes.lua")
|
||||
dofile(farming.path .. "/hoes.lua")
|
||||
farming.DEBUG = false
|
||||
-- farming.DEBUG = {} -- Uncomment to turn on profiling code/functions
|
||||
|
||||
-- WHEAT
|
||||
farming.register_plant("farming:wheat", {
|
||||
description = "Wheat seed",
|
||||
inventory_image = "farming_wheat_seed.png",
|
||||
steps = 8,
|
||||
minlight = 13,
|
||||
maxlight = LIGHT_MAX,
|
||||
fertility = {"grassland"}
|
||||
})
|
||||
minetest.register_craftitem("farming:flour", {
|
||||
description = "Flour",
|
||||
inventory_image = "farming_flour.png",
|
||||
local DEBUG_abm_runs = 0
|
||||
local DEBUG_abm_time = 0
|
||||
local DEBUG_timer_runs = 0
|
||||
local DEBUG_timer_time = 0
|
||||
|
||||
if farming.DEBUG then
|
||||
|
||||
function farming.DEBUG.reset_times()
|
||||
DEBUG_abm_runs = 0
|
||||
DEBUG_abm_time = 0
|
||||
DEBUG_timer_runs = 0
|
||||
DEBUG_timer_time = 0
|
||||
end
|
||||
|
||||
function farming.DEBUG.report_times()
|
||||
|
||||
local abm_n = DEBUG_abm_runs
|
||||
local abm_dt = DEBUG_abm_time
|
||||
local abm_avg = (abm_n > 0 and abm_dt / abm_n) or 0
|
||||
local timer_n = DEBUG_timer_runs
|
||||
local timer_dt = DEBUG_timer_time
|
||||
local timer_avg = (timer_n > 0 and timer_dt / timer_n) or 0
|
||||
local dt = abm_dt + timer_dt
|
||||
|
||||
print("ABM ran for "..abm_dt.."µs over "..abm_n.." runs: "..abm_avg.."µs/run")
|
||||
print("Timer ran for "..timer_dt.."µs over "..timer_n.." runs: "..timer_avg.."µs/run")
|
||||
print("Total farming time: "..dt.."µs")
|
||||
end
|
||||
end
|
||||
|
||||
local statistics = dofile(farming.path.."/statistics.lua")
|
||||
|
||||
-- Intllib
|
||||
|
||||
local S
|
||||
if minetest.get_modpath("intllib") then
|
||||
S = intllib.Getter()
|
||||
else
|
||||
S = function(s) return s end
|
||||
end
|
||||
farming.intllib = S
|
||||
|
||||
-- Utility Functions
|
||||
|
||||
local time_speed = tonumber(minetest.setting_get("time_speed")) or 72
|
||||
local SECS_PER_CYCLE = (time_speed > 0 and 24 * 60 * 60 / time_speed) or 0
|
||||
|
||||
local function clamp(x, min, max)
|
||||
return (x < min and min) or (x > max and max) or x
|
||||
end
|
||||
|
||||
local function in_range(x, min, max)
|
||||
return min <= x and x <= max
|
||||
end
|
||||
|
||||
--- Tests the amount of day or night time between two times.
|
||||
--
|
||||
-- @param t_game
|
||||
-- The current time, as reported by mintest.get_gametime().
|
||||
-- @param t_day
|
||||
-- The current time, as reported by mintest.get_timeofday().
|
||||
-- @param dt
|
||||
-- The amount of elapsed time.
|
||||
-- @param count_day
|
||||
-- If true, count elapsed day time. Otherwise, count elapsed night time.
|
||||
-- @return
|
||||
-- The amount of day or night time that has elapsed.
|
||||
|
||||
local function day_or_night_time(t_game, t_day, dt, count_day)
|
||||
|
||||
local t1_day = t_day - dt / SECS_PER_CYCLE
|
||||
local t1_c, t2_c -- t1_c < t2_c and t2_c always in [0, 1)
|
||||
|
||||
if count_day then
|
||||
|
||||
if t_day < 0.25 then
|
||||
t1_c = t1_day + 0.75 -- Relative to sunup, yesterday
|
||||
t2_c = t_day + 0.75
|
||||
else
|
||||
t1_c = t1_day - 0.25 -- Relative to sunup, today
|
||||
t2_c = t_day - 0.25
|
||||
end
|
||||
else
|
||||
if t_day < 0.75 then
|
||||
t1_c = t1_day + 0.25 -- Relative to sundown, yesterday
|
||||
t2_c = t_day + 0.25
|
||||
else
|
||||
t1_c = t1_day - 0.75 -- Relative to sundown, today
|
||||
t2_c = t_day - 0.75
|
||||
end
|
||||
end
|
||||
|
||||
local dt_c = clamp(t2_c, 0, 0.5) - clamp(t1_c, 0, 0.5) -- this cycle
|
||||
|
||||
if t1_c < -0.5 then
|
||||
local nc = math.floor(-t1_c)
|
||||
t1_c = t1_c + nc
|
||||
dt_c = dt_c + 0.5 * nc + clamp(-t1_c - 0.5, 0, 0.5)
|
||||
end
|
||||
|
||||
return dt_c * SECS_PER_CYCLE
|
||||
end
|
||||
|
||||
--- Tests the amount of elapsed day time.
|
||||
--
|
||||
-- @param dt
|
||||
-- The amount of elapsed time.
|
||||
-- @return
|
||||
-- The amount of day time that has elapsed.
|
||||
--
|
||||
local function day_time(dt)
|
||||
return day_or_night_time(minetest.get_gametime(), minetest.get_timeofday(), dt, true)
|
||||
end
|
||||
|
||||
--- Tests the amount of elapsed night time.
|
||||
--
|
||||
-- @param dt
|
||||
-- The amount of elapsed time.
|
||||
-- @return
|
||||
-- The amount of night time that has elapsed.
|
||||
--
|
||||
local function night_time(time_game, time_day, dt, count_day)
|
||||
return day_or_night_time(minetest.get_gametime(), minetest.get_timeofday(), dt, false)
|
||||
end
|
||||
|
||||
|
||||
-- Growth Logic
|
||||
|
||||
local STAGE_LENGTH_AVG = 160.0
|
||||
local STAGE_LENGTH_DEV = STAGE_LENGTH_AVG / 6
|
||||
local MIN_LIGHT = 11 -- /MFF (Mg|06/04/15 8:21PM--See #82)
|
||||
local MAX_LIGHT = 1000
|
||||
|
||||
--- Determines plant name and stage from node.
|
||||
--
|
||||
-- Separates node name on the last underscore (_).
|
||||
--
|
||||
-- @param node
|
||||
-- Node or position table, or node name.
|
||||
-- @return
|
||||
-- List (plant_name, stage), or nothing (nil) if node isn't loaded
|
||||
|
||||
local function plant_name_stage(node)
|
||||
|
||||
local name
|
||||
|
||||
if type(node) == 'table' then
|
||||
|
||||
if node.name then
|
||||
name = node.name
|
||||
elseif node.x and node.y and node.z then
|
||||
node = minetest.get_node_or_nil(node)
|
||||
name = node and node.name
|
||||
end
|
||||
else
|
||||
name = tostring(node)
|
||||
end
|
||||
|
||||
if not name or name == "ignore" then
|
||||
return nil
|
||||
end
|
||||
|
||||
local sep_pos = name:find("_[^_]+$")
|
||||
|
||||
if sep_pos and sep_pos > 1 then
|
||||
|
||||
local stage = tonumber(name:sub(sep_pos + 1))
|
||||
|
||||
if stage and stage >= 0 then
|
||||
return name:sub(1, sep_pos - 1), stage
|
||||
end
|
||||
end
|
||||
|
||||
return name, 0
|
||||
end
|
||||
|
||||
-- Map from node name to
|
||||
-- { plant_name = ..., name = ..., stage = n, stages_left = { node_name, ... } }
|
||||
|
||||
local plant_stages = {}
|
||||
|
||||
farming.plant_stages = plant_stages
|
||||
|
||||
--- Registers the stages of growth of a (possible plant) node.
|
||||
--
|
||||
-- @param node
|
||||
-- Node or position table, or node name.
|
||||
-- @return
|
||||
-- The (possibly zero) number of stages of growth the plant will go through
|
||||
-- before being fully grown, or nil if not a plant.
|
||||
|
||||
local register_plant_node
|
||||
|
||||
-- Recursive helper
|
||||
local function reg_plant_stages(plant_name, stage, force_last)
|
||||
|
||||
local node_name = plant_name and plant_name .. "_" .. stage
|
||||
local node_def = node_name and minetest.registered_nodes[node_name]
|
||||
|
||||
if not node_def then
|
||||
return nil
|
||||
end
|
||||
|
||||
local stages = plant_stages[node_name]
|
||||
|
||||
if stages then
|
||||
return stages
|
||||
end
|
||||
|
||||
if minetest.get_item_group(node_name, "growing") > 0 then
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
if #stages_left > 0 then
|
||||
|
||||
local old_constr = node_def.on_construct
|
||||
local old_destr = node_def.on_destruct
|
||||
|
||||
minetest.override_item(node_name,
|
||||
{
|
||||
on_construct = function(pos)
|
||||
|
||||
if old_constr then
|
||||
old_constr(pos)
|
||||
end
|
||||
|
||||
farming.handle_growth(pos)
|
||||
end,
|
||||
|
||||
on_destruct = function(pos)
|
||||
|
||||
minetest.get_node_timer(pos):stop()
|
||||
|
||||
if old_destr then
|
||||
old_destr(pos)
|
||||
end
|
||||
end,
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
return farming.plant_growth_timer(pos, elapsed, node_name)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
elseif force_last then
|
||||
|
||||
stages = {
|
||||
plant_name = plant_name,
|
||||
name = node_name,
|
||||
stage = stage,
|
||||
stages_left = {}
|
||||
}
|
||||
else
|
||||
return nil
|
||||
end
|
||||
|
||||
plant_stages[node_name] = stages
|
||||
|
||||
return stages
|
||||
end
|
||||
|
||||
register_plant_node = function(node)
|
||||
|
||||
local plant_name, stage = plant_name_stage(node)
|
||||
|
||||
if plant_name then
|
||||
|
||||
local stages = reg_plant_stages(plant_name, stage, false)
|
||||
return stages and #stages.stages_left
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
local function set_growing(pos, stages_left)
|
||||
|
||||
if not stages_left then
|
||||
return
|
||||
end
|
||||
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
|
||||
if stages_left > 0 then
|
||||
|
||||
if not timer:is_started() then
|
||||
|
||||
local stage_length = statistics.normal(STAGE_LENGTH_AVG, STAGE_LENGTH_DEV)
|
||||
|
||||
stage_length = clamp(stage_length, 0.5 * STAGE_LENGTH_AVG, 3.0 * STAGE_LENGTH_AVG)
|
||||
|
||||
timer:set(stage_length, -0.5 * math.random() * STAGE_LENGTH_AVG)
|
||||
end
|
||||
|
||||
elseif timer:is_started() then
|
||||
timer:stop()
|
||||
end
|
||||
end
|
||||
|
||||
-- Detects a plant type node at the given position, starting
|
||||
-- or stopping the plant growth timer as appopriate
|
||||
|
||||
-- @param pos
|
||||
-- The node's position.
|
||||
-- @param node
|
||||
-- The cached node table if available, or nil.
|
||||
|
||||
function farming.handle_growth(pos, node)
|
||||
|
||||
if not pos then
|
||||
return
|
||||
end
|
||||
|
||||
local stages_left = register_plant_node(node or pos)
|
||||
|
||||
if stages_left then
|
||||
set_growing(pos, stages_left)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.after(0, function()
|
||||
|
||||
for _, node_def in pairs(minetest.registered_nodes) do
|
||||
register_plant_node(node_def)
|
||||
end
|
||||
end)
|
||||
|
||||
local abm_func = farming.handle_growth
|
||||
|
||||
if farming.DEBUG then
|
||||
|
||||
local normal_abm_func = abm_func
|
||||
|
||||
abm_func = function(...)
|
||||
|
||||
local t0 = minetest.get_us_time()
|
||||
local r = { normal_abm_func(...) }
|
||||
local t1 = minetest.get_us_time()
|
||||
|
||||
DEBUG_abm_runs = DEBUG_abm_runs + 1
|
||||
DEBUG_abm_time = DEBUG_abm_time + (t1 - t0)
|
||||
|
||||
return unpack(r)
|
||||
end
|
||||
end
|
||||
|
||||
-- Just in case a growing type or added node is missed (also catches existing
|
||||
-- nodes added to map before timers were incorporated).
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = { "group:growing" },
|
||||
interval = 300,
|
||||
chance = 1,
|
||||
action = abm_func
|
||||
})
|
||||
|
||||
minetest.register_craftitem("farming:bread", {
|
||||
description = "Bread",
|
||||
inventory_image = "farming_bread.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
})
|
||||
-- Plant timer function.
|
||||
-- Grows plants under the right conditions.
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "farming:flour",
|
||||
recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
|
||||
})
|
||||
function farming.plant_growth_timer(pos, elapsed, node_name)
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 15,
|
||||
output = "farming:bread",
|
||||
recipe = "farming:flour"
|
||||
})
|
||||
local stages = plant_stages[node_name]
|
||||
|
||||
-- Cotton
|
||||
farming.register_plant("farming:cotton", {
|
||||
description = "Cotton seed",
|
||||
inventory_image = "farming_cotton_seed.png",
|
||||
steps = 8,
|
||||
minlight = 13,
|
||||
maxlight = LIGHT_MAX,
|
||||
fertility = {"grassland", "desert"}
|
||||
})
|
||||
if not stages then
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_craftitem("farming:string", {
|
||||
description = "String",
|
||||
inventory_image = "farming_cotton.png",
|
||||
})
|
||||
local max_growth = #stages.stages_left
|
||||
|
||||
minetest.register_craft({
|
||||
output = "wool:white",
|
||||
recipe = {
|
||||
{"farming:cotton", "farming:cotton"},
|
||||
{"farming:cotton", "farming:cotton"},
|
||||
}
|
||||
})
|
||||
if max_growth <= 0 then
|
||||
return false
|
||||
end
|
||||
|
||||
if stages.plant_name == "farming:cocoa" then
|
||||
|
||||
if not minetest.find_node_near(pos, 1,
|
||||
{"default:jungletree", "moretrees:jungletree_leaves_green"}) then
|
||||
|
||||
return true
|
||||
end
|
||||
else
|
||||
local under = minetest.get_node({ x = pos.x, y = pos.y - 1, z = pos.z })
|
||||
|
||||
if minetest.get_item_group(under.name, "soil") < 3 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
local growth
|
||||
local light_pos = {x = pos.x, y = pos.y + 1, z = pos.z}
|
||||
local lambda = elapsed / STAGE_LENGTH_AVG
|
||||
|
||||
if lambda < 0.1 then
|
||||
return true
|
||||
end
|
||||
|
||||
if max_growth == 1 or lambda < 2.0 then
|
||||
|
||||
local light = (minetest.get_node_light(light_pos) or 0)
|
||||
--print ("light level:", light)
|
||||
|
||||
if not in_range(light, MIN_LIGHT, MAX_LIGHT) then
|
||||
return true
|
||||
end
|
||||
|
||||
growth = 1
|
||||
else
|
||||
local night_light = (minetest.get_node_light(light_pos, 0) or 0)
|
||||
local day_light = (minetest.get_node_light(light_pos, 0.5) or 0)
|
||||
local night_growth = in_range(night_light, MIN_LIGHT, MAX_LIGHT)
|
||||
local day_growth = in_range(day_light, MIN_LIGHT, MAX_LIGHT)
|
||||
|
||||
if not night_growth then
|
||||
|
||||
if not day_growth then
|
||||
return true
|
||||
end
|
||||
|
||||
lambda = day_time(elapsed) / STAGE_LENGTH_AVG
|
||||
|
||||
elseif not day_growth then
|
||||
|
||||
lambda = night_time(elapsed) / STAGE_LENGTH_AVG
|
||||
end
|
||||
|
||||
growth = statistics.poisson(lambda, max_growth)
|
||||
|
||||
if growth < 1 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.registered_nodes[stages.stages_left[growth]] then
|
||||
minetest.swap_node(pos, {name = stages.stages_left[growth]})
|
||||
else
|
||||
return true
|
||||
end
|
||||
|
||||
return growth ~= max_growth
|
||||
end
|
||||
|
||||
if farming.DEBUG then
|
||||
|
||||
local timer_func = farming.plant_growth_timer;
|
||||
|
||||
farming.plant_growth_timer = function(pos, elapsed, node_name)
|
||||
|
||||
local t0 = minetest.get_us_time()
|
||||
local r = { timer_func(pos, elapsed, node_name) }
|
||||
local t1 = minetest.get_us_time()
|
||||
|
||||
DEBUG_timer_runs = DEBUG_timer_runs + 1
|
||||
DEBUG_timer_time = DEBUG_timer_time + (t1 - t0)
|
||||
|
||||
return unpack(r)
|
||||
end
|
||||
end
|
||||
|
||||
-- refill placed plant by crabman (26/08/2015)
|
||||
local can_refill_plant = {
|
||||
["farming:blueberry_1"] = "farming:blueberries",
|
||||
["farming:carrot_1"] = "farming:carrot",
|
||||
["farming:coffee_1"] = "farming:coffee_beans",
|
||||
["farming:corn_1"] = "farming:corn",
|
||||
["farming:cotton_1"] = "farming:seed_cotton",
|
||||
["farming:cucumber_1"] = "farming:cucumber",
|
||||
["farming:melon_1"] = "farming:melon_slice",
|
||||
["farming:potato_1"] = "farming:potato",
|
||||
["farming:pumpkin_1"] = "farming:pumpkin_slice",
|
||||
["farming:raspberry_1"] = "farming:raspberries",
|
||||
["farming:rhubarb_1"] = "farming:rhubarb",
|
||||
["farming:tomato_1"] = "farming:tomato",
|
||||
["farming:wheat_1"] = "farming:seed_wheat",
|
||||
["farming:grapes_1"] = "farming:grapes",
|
||||
["farming:beans_1"] = "farming:beans",
|
||||
["farming:rhubarb_1"] = "farming:rhubarb",
|
||||
["farming:cocoa_1"] = "farming:cocoa_beans",
|
||||
["farming:barley_1"] = "farming:seed_barley",
|
||||
}
|
||||
|
||||
function farming.refill_plant(player, plantname, index)
|
||||
|
||||
local inv = player:get_inventory()
|
||||
local old_stack = inv:get_stack("main", index)
|
||||
|
||||
if old_stack:get_name() ~= "" then
|
||||
return
|
||||
end
|
||||
|
||||
for i, stack in pairs(inv:get_list("main")) do
|
||||
|
||||
if stack:get_name() == plantname and i ~= index then
|
||||
|
||||
inv:set_stack("main", index, stack)
|
||||
stack:clear()
|
||||
inv:set_stack("main", i, stack)
|
||||
--minetest.log("action", "farming: refilled stack("..plantname..") of " .. player:get_player_name() )
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- 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 or 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]
|
||||
or not minetest.registered_nodes[above.name] then
|
||||
return
|
||||
end
|
||||
|
||||
-- is there an on_rightclick callback?
|
||||
if minetest.registered_nodes[under.name].on_rightclick and not placer:get_player_control().sneak then
|
||||
return minetest.registered_nodes[under.name].on_rightclick(pt.under, under, placer, itemstack, pointed_thing)
|
||||
end
|
||||
|
||||
-- check if pointing at the top of the node
|
||||
if pt.above.y ~= pt.under.y + 1 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
|
||||
-- avoid multiple seed placement bug
|
||||
or minetest.get_item_group(above.name, "plant") ~= 0 then
|
||||
return
|
||||
end
|
||||
|
||||
-- if not protected then add node and remove 1 item from the itemstack
|
||||
if not minetest.is_protected(pt.above, placer:get_player_name()) then
|
||||
|
||||
minetest.set_node(pt.above, {name = plantname, param2 = 1})
|
||||
|
||||
minetest.sound_play("default_place_node", {pos = pt.above, gain = 1.0})
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
|
||||
itemstack:take_item()
|
||||
|
||||
-- check for refill
|
||||
if itemstack:get_count() == 0
|
||||
and can_refill_plant[plantname] then
|
||||
|
||||
minetest.after(0.10,
|
||||
farming.refill_plant,
|
||||
placer,
|
||||
can_refill_plant[plantname],
|
||||
placer:get_wield_index()
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
return itemstack
|
||||
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 = S("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 = farming.select,
|
||||
|
||||
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.growing = 0
|
||||
end
|
||||
|
||||
local node_name = mname .. ":" .. pname .. "_" .. i
|
||||
|
||||
minetest.register_node(node_name, {
|
||||
drawtype = "plantlike",
|
||||
waving = 1,
|
||||
tiles = {mname .. "_" .. pname .. "_" .. i .. ".png"},
|
||||
paramtype = "light",
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = drop,
|
||||
selection_box = farming.select,
|
||||
groups = g,
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
||||
-- register_plant_node(node_name)
|
||||
end
|
||||
|
||||
-- Return info
|
||||
local r = {seed = mname .. ":seed_" .. pname, harvest = mname .. ":" .. pname}
|
||||
return r
|
||||
end
|
||||
|
||||
-- load crops
|
||||
|
||||
dofile(farming.path.."/soil.lua")
|
||||
dofile(farming.path.."/hoes.lua")
|
||||
dofile(farming.path.."/grass.lua")
|
||||
dofile(farming.path.."/wheat.lua")
|
||||
dofile(farming.path.."/cotton.lua")
|
||||
dofile(farming.path.."/carrot.lua")
|
||||
dofile(farming.path.."/potato.lua")
|
||||
dofile(farming.path.."/tomato.lua")
|
||||
dofile(farming.path.."/cucumber.lua")
|
||||
dofile(farming.path.."/corn.lua")
|
||||
dofile(farming.path.."/coffee.lua")
|
||||
dofile(farming.path.."/melon.lua")
|
||||
dofile(farming.path.."/sugar.lua")
|
||||
dofile(farming.path.."/pumpkin.lua")
|
||||
dofile(farming.path.."/cocoa.lua")
|
||||
dofile(farming.path.."/raspberry.lua")
|
||||
dofile(farming.path.."/blueberry.lua")
|
||||
dofile(farming.path.."/rhubarb.lua")
|
||||
dofile(farming.path.."/beanpole.lua")
|
||||
dofile(farming.path.."/grapes.lua")
|
||||
dofile(farming.path.."/barley.lua")
|
||||
dofile(farming.path.."/donut.lua")
|
||||
dofile(farming.path.."/mapgen.lua")
|
||||
dofile(farming.path.."/compatibility.lua") -- Farming Plus compatibility
|
||||
|
192
mods/farming/init.lua_orig
Executable file
@ -0,0 +1,192 @@
|
||||
--[[
|
||||
Minetest Farming Redo Mod 1.14 (11th May 2015)
|
||||
by TenPlus1
|
||||
]]
|
||||
|
||||
farming = {}
|
||||
farming.mod = "redo"
|
||||
farming.path = minetest.get_modpath("farming")
|
||||
farming.hoe_on_use = default.hoe_on_use
|
||||
|
||||
dofile(farming.path.."/soil.lua")
|
||||
dofile(farming.path.."/hoes.lua")
|
||||
dofile(farming.path.."/grass.lua")
|
||||
dofile(farming.path.."/wheat.lua")
|
||||
dofile(farming.path.."/cotton.lua")
|
||||
dofile(farming.path.."/carrot.lua")
|
||||
dofile(farming.path.."/potato.lua")
|
||||
dofile(farming.path.."/tomato.lua")
|
||||
dofile(farming.path.."/cucumber.lua")
|
||||
dofile(farming.path.."/corn.lua")
|
||||
dofile(farming.path.."/coffee.lua")
|
||||
dofile(farming.path.."/melon.lua")
|
||||
dofile(farming.path.."/sugar.lua")
|
||||
dofile(farming.path.."/pumpkin.lua")
|
||||
dofile(farming.path.."/cocoa.lua")
|
||||
dofile(farming.path.."/raspberry.lua")
|
||||
dofile(farming.path.."/blueberry.lua")
|
||||
dofile(farming.path.."/rhubarb.lua")
|
||||
dofile(farming.path.."/beanpole.lua")
|
||||
dofile(farming.path.."/donut.lua")
|
||||
dofile(farming.path.."/mapgen.lua")
|
||||
dofile(farming.path.."/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
|
||||
or minetest.get_item_group(above.name, "plant") ~= 0 then -- ADDED this line for multiple seed placement bug
|
||||
return
|
||||
end
|
||||
|
||||
-- add the node and remove 1 item from the itemstack
|
||||
if not minetest.is_protected(pt.above, placer:get_player_name()) then
|
||||
minetest.add_node(pt.above, {name=plantname})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
|
||||
-- Single ABM Handles Growing of All Plants
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:growing"},
|
||||
neighbors = {"farming:soil_wet", "default:jungletree"},
|
||||
interval = 80,
|
||||
chance = 2,
|
||||
|
||||
action = function(pos, node)
|
||||
|
||||
-- split plant name (e.g. farming:wheat_1)
|
||||
local plant = node.name:split("_")[1].."_"
|
||||
local numb = node.name:split("_")[2]
|
||||
|
||||
-- fully grown ?
|
||||
if not minetest.registered_nodes[plant..(numb + 1)] then return end
|
||||
|
||||
-- cocoa pod on jungle tree ?
|
||||
if plant ~= "farming:cocoa_" then
|
||||
|
||||
-- growing on wet soil ?
|
||||
if minetest.get_node({x=pos.x,y=pos.y-1,z=pos.z}).name ~= "farming:soil_wet" then return end
|
||||
end
|
||||
|
||||
-- enough light ?
|
||||
if minetest.get_node_light(pos) < 13 then return 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,
|
||||
})
|
||||
--]]
|
14
mods/farming/license.txt
Executable file
@ -0,0 +1,14 @@
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
Version 2, December 2004
|
||||
|
||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim or modified
|
||||
copies of this license document, and changing it is allowed as long
|
||||
as the name is changed.
|
||||
|
||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
63
mods/farming/mapgen.lua
Executable file
@ -0,0 +1,63 @@
|
||||
-- decoration function
|
||||
local function register_plant(name, min, max, spawnby, num)
|
||||
minetest.register_decoration({
|
||||
deco_type = "simple",
|
||||
place_on = {"default:dirt_with_grass"},
|
||||
sidelen = 16,
|
||||
noise_params = {
|
||||
offset = 0,
|
||||
scale = 0.006,
|
||||
spread = {x = 100, y = 100, z = 100},
|
||||
seed = 329,
|
||||
octaves = 3,
|
||||
persist = 0.6
|
||||
},
|
||||
y_min = min,
|
||||
y_max = max,
|
||||
decoration = "farming:" .. name,
|
||||
spawn_by = spawnby,
|
||||
num_spawn_by = num,
|
||||
})
|
||||
end
|
||||
|
||||
function farming.register_mgv6_decorations()
|
||||
register_plant("potato_3", 15, 40, "", -1)
|
||||
register_plant("tomato_7", 5, 20, "", -1)
|
||||
register_plant("carrot_8", 1, 30, "group:water", 1)
|
||||
register_plant("cucumber_4", 1, 20, "group:water", 1)
|
||||
register_plant("corn_7", 12, 22, "", -1)
|
||||
register_plant("corn_8", 10, 20, "", -1)
|
||||
register_plant("coffee_5", 20, 45, "", -1)
|
||||
register_plant("melon_8", 1, 20, "group:water", 1)
|
||||
register_plant("pumpkin_8", 1, 20, "group:water", 1)
|
||||
register_plant("raspberry_4", 3, 10, "", -1)
|
||||
register_plant("rhubarb_3", 3, 15, "", -1)
|
||||
register_plant("blueberry_4", 3, 10, "", -1)
|
||||
register_plant("beanbush", 18, 35, "", -1)
|
||||
register_plant("grapebush", 25, 45, "", -1)
|
||||
end
|
||||
|
||||
-- v7 maps have a beach so plants growing near water is limited to 6 high
|
||||
function farming.register_mgv7_decorations()
|
||||
register_plant("potato_3", 15, 40, "", -1)
|
||||
register_plant("tomato_7", 5, 20, "", -1)
|
||||
register_plant("carrot_8", 1, 6, "", -1)
|
||||
register_plant("cucumber_4", 1, 6, "", -1)
|
||||
register_plant("corn_7", 12, 22, "", -1)
|
||||
register_plant("corn_8", 10, 20, "", -1)
|
||||
register_plant("coffee_5", 20, 45, "", -1)
|
||||
register_plant("melon_8", 1, 6, "", -1)
|
||||
register_plant("pumpkin_8", 1, 6, "", -1)
|
||||
register_plant("raspberry_4", 3, 10, "", -1)
|
||||
register_plant("rhubarb_3", 3, 15, "", -1)
|
||||
register_plant("blueberry_4", 3, 10, "", -1)
|
||||
register_plant("beanbush", 18, 35, "", -1)
|
||||
register_plant("grapebush", 25, 45, "", -1)
|
||||
end
|
||||
|
||||
-- detect mapgen
|
||||
if minetest.get_mapgen_params().mgname == "v6" then
|
||||
farming.register_mgv6_decorations()
|
||||
else
|
||||
farming.register_mgv7_decorations()
|
||||
end
|
82
mods/farming/melon.lua
Executable file
@ -0,0 +1,82 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- melon
|
||||
minetest.register_craftitem("farming:melon_slice", {
|
||||
description = S("Melon Slice"),
|
||||
inventory_image = "farming_melon_slice.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:melon_8",
|
||||
recipe = {
|
||||
{"farming:melon_slice", "farming:melon_slice", "farming:melon_slice"},
|
||||
{"farming:melon_slice", "farming:melon_slice", "farming:melon_slice"},
|
||||
{"farming:melon_slice", "farming:melon_slice", "farming:melon_slice"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:melon_slice 9",
|
||||
recipe = {
|
||||
{"", "farming:melon_8", ""},
|
||||
}
|
||||
})
|
||||
|
||||
-- melon definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_melon_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:melon_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_melon_2.png"}
|
||||
minetest.register_node("farming:melon_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_melon_3.png"}
|
||||
minetest.register_node("farming:melon_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_melon_4.png"}
|
||||
minetest.register_node("farming:melon_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5
|
||||
crop_def.tiles = {"farming_melon_5.png"}
|
||||
minetest.register_node("farming:melon_5", table.copy(crop_def))
|
||||
|
||||
-- stage 6
|
||||
crop_def.tiles = {"farming_melon_6.png"}
|
||||
minetest.register_node("farming:melon_6", table.copy(crop_def))
|
||||
|
||||
-- stage 7
|
||||
crop_def.tiles = {"farming_melon_7.png"}
|
||||
minetest.register_node("farming:melon_7", table.copy(crop_def))
|
||||
|
||||
-- stage 8 (final)
|
||||
crop_def.drawtype = "nodebox"
|
||||
crop_def.description = S("Melon")
|
||||
crop_def.tiles = {"farming_melon_top.png", "farming_melon_top.png", "farming_melon_side.png"}
|
||||
crop_def.selection_box = {-.5, -.5, -.5, .5, .5, .5}
|
||||
crop_def.walkable = true
|
||||
crop_def.groups = {snappy = 1, oddly_breakable_by_hand = 1, flammable = 2, plant = 1}
|
||||
crop_def.drop = "farming:melon_slice 9"
|
||||
minetest.register_node("farming:melon_8", table.copy(crop_def))
|
1
mods/farming/mod.conf
Normal file
@ -0,0 +1 @@
|
||||
name = farming
|
@ -1,138 +0,0 @@
|
||||
minetest.override_item("default:dirt", {
|
||||
groups = {crumbly=3,soil=1},
|
||||
soil = {
|
||||
base = "default:dirt",
|
||||
dry = "farming:soil",
|
||||
wet = "farming:soil_wet"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.override_item("default:dirt_with_grass", {
|
||||
groups = {crumbly=3,soil=1},
|
||||
soil = {
|
||||
base = "default:dirt_with_grass",
|
||||
dry = "farming:soil",
|
||||
wet = "farming:soil_wet"
|
||||
}
|
||||
})
|
||||
|
||||
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, grassland = 1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
soil = {
|
||||
base = "default:dirt",
|
||||
dry = "farming:soil",
|
||||
wet = "farming:soil_wet"
|
||||
}
|
||||
})
|
||||
|
||||
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, wet = 1, grassland = 1},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
soil = {
|
||||
base = "default:dirt",
|
||||
dry = "farming:soil",
|
||||
wet = "farming:soil_wet"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.override_item("default:desert_sand", {
|
||||
groups = {crumbly=3, falling_node=1, sand=1, soil = 1},
|
||||
soil = {
|
||||
base = "default:desert_sand",
|
||||
dry = "farming:desert_sand_soil",
|
||||
wet = "farming:desert_sand_soil_wet"
|
||||
}
|
||||
})
|
||||
minetest.register_node("farming:desert_sand_soil", {
|
||||
description = "Desert Sand",
|
||||
tiles = {"farming_desert_sand_soil.png", "default_desert_sand.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, not_in_creative_inventory = 1, falling_node=1, sand=1, soil = 2, desert = 1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
soil = {
|
||||
base = "default:desert_sand",
|
||||
dry = "farming:desert_sand_soil",
|
||||
wet = "farming:desert_sand_soil_wet"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_node("farming:desert_sand_soil_wet", {
|
||||
description = "Desert Sand",
|
||||
drop = "default:desert_sand",
|
||||
tiles = {"farming_desert_sand_soil_wet.png", "farming_desert_sand_soil_wet_side.png"},
|
||||
is_ground_content = true,
|
||||
groups = {crumbly=3, falling_node=1, sand=1, not_in_creative_inventory=1, soil=3, wet = 1, desert = 1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
soil = {
|
||||
base = "default:desert_sand",
|
||||
dry = "farming:desert_sand_soil",
|
||||
wet = "farming:desert_sand_soil_wet"
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_abm({
|
||||
nodenames = {"group:soil", "group:wet"},
|
||||
interval = 5,
|
||||
chance = 10,
|
||||
action = function(pos, node)
|
||||
pos.y = pos.y+1
|
||||
local nn = minetest.get_node(pos).name
|
||||
node = minetest.registered_nodes[node.name]
|
||||
pos.y = pos.y-1
|
||||
|
||||
if node.soil == nil or node.soil.wet == nil or node.soil.base == nil or node.soil.dry == nil then
|
||||
return
|
||||
end
|
||||
|
||||
if minetest.registered_nodes[nn] and minetest.registered_nodes[nn].walkable and minetest.get_item_group(nn, "plant") == 0 and node.name ~= node.soil.base then
|
||||
minetest.set_node(pos, {name = node.soil.base})
|
||||
end
|
||||
-- check if there is water nearby
|
||||
if minetest.find_node_near(pos, 3, {"group:water"}) then
|
||||
-- if it is dry soil and not base node, turn it into wet soil
|
||||
if node.name ~= node.soil.base and minetest.get_item_group(node.name, "wet") == 0 then
|
||||
minetest.set_node(pos, {name = node.soil.wet})
|
||||
end
|
||||
else
|
||||
-- turn it back into base if it is already dry
|
||||
if minetest.get_item_group(node.name, "wet") == 0 then
|
||||
-- only turn it back if there is no plant/seed on top of it
|
||||
if minetest.get_item_group(nn, "plant") == 0 and minetest.get_item_group(nn, "seed") == 0 then
|
||||
minetest.set_node(pos, {name = node.soil.base})
|
||||
end
|
||||
|
||||
-- if its wet turn it back into dry soil
|
||||
elseif minetest.get_item_group(node.name, "wet") == 1 then
|
||||
minetest.set_node(pos, {name = node.soil.dry})
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
for i = 1, 5 do
|
||||
minetest.override_item("default:grass_"..i, {drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {'farming:seed_wheat'},rarity = 5},
|
||||
{items = {'default:grass_1'}},
|
||||
}
|
||||
}})
|
||||
end
|
||||
|
||||
minetest.override_item("default:junglegrass", {drop = {
|
||||
max_items = 1,
|
||||
items = {
|
||||
{items = {'farming:seed_cotton'},rarity = 8},
|
||||
{items = {'default:junglegrass'}},
|
||||
}
|
||||
}})
|
77
mods/farming/potato.lua
Executable file
@ -0,0 +1,77 @@
|
||||
|
||||
--[[
|
||||
Original textures from DocFarming mod
|
||||
https://forum.minetest.net/viewtopic.php?id=3948
|
||||
]]
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- potato
|
||||
minetest.register_craftitem("farming:potato", {
|
||||
description = S("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),
|
||||
})
|
||||
|
||||
-- baked potato
|
||||
minetest.register_craftitem("farming:baked_potato", {
|
||||
description = S("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"
|
||||
})
|
||||
|
||||
-- potato definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_potato_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:potato_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_potato_2.png"}
|
||||
minetest.register_node("farming:potato_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_potato_3.png"}
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:potato'}, rarity = 1},
|
||||
{items = {'farming:potato'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:potato_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_potato_4.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:potato 2'}, rarity = 1},
|
||||
{items = {'farming:potato 3'}, rarity = 2},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:potato_4", table.copy(crop_def))
|
181
mods/farming/pumpkin.lua
Executable file
@ -0,0 +1,181 @@
|
||||
|
||||
--[[
|
||||
Big thanks to PainterlyPack.net for allowing me to use these textures
|
||||
]]
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- pumpkin
|
||||
minetest.register_node("farming:pumpkin", {
|
||||
description = S("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
|
||||
},
|
||||
drop = {
|
||||
items = {
|
||||
{items = {'farming:pumpkin_slice 9'}, rarity = 1},
|
||||
}
|
||||
},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
})
|
||||
|
||||
-- pumpkin slice
|
||||
minetest.register_craftitem("farming:pumpkin_slice", {
|
||||
description = S("Pumpkin Slice"),
|
||||
inventory_image = "farming_pumpkin_slice.png",
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1")
|
||||
end,
|
||||
on_use = minetest.item_eat(2),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:pumpkin",
|
||||
recipe = {
|
||||
{"farming:pumpkin_slice", "farming:pumpkin_slice", "farming:pumpkin_slice"},
|
||||
{"farming:pumpkin_slice", "farming:pumpkin_slice", "farming:pumpkin_slice"},
|
||||
{"farming:pumpkin_slice", "farming:pumpkin_slice", "farming:pumpkin_slice"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:pumpkin_slice 9",
|
||||
recipe = {
|
||||
{"", "farming:pumpkin", ""},
|
||||
}
|
||||
})
|
||||
|
||||
-- jack 'o lantern
|
||||
minetest.register_node("farming:jackolantern", {
|
||||
description = S("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"
|
||||
},
|
||||
paramtype2 = "facedir",
|
||||
groups = {choppy = 1, oddly_breakable_by_hand = 1, flammable = 2},
|
||||
sounds = default.node_sound_wood_defaults(),
|
||||
on_punch = function(pos, node, puncher)
|
||||
node.name = "farming:jackolantern_on"
|
||||
minetest.swap_node(pos, node)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("farming:jackolantern_on", {
|
||||
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(),
|
||||
drop = "farming:jackolantern",
|
||||
on_punch = function(pos, node, puncher)
|
||||
node.name = "farming:jackolantern"
|
||||
minetest.swap_node(pos, node)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:jackolantern",
|
||||
recipe = {
|
||||
{"", "", ""},
|
||||
{"", "default:torch", ""},
|
||||
{"", "farming:pumpkin", ""},
|
||||
}
|
||||
})
|
||||
|
||||
-- pumpkin bread
|
||||
minetest.register_craftitem("farming:pumpkin_bread", {
|
||||
description = S("Pumpkin Bread"),
|
||||
inventory_image = "farming_pumpkin_bread.png",
|
||||
on_use = minetest.item_eat(8)
|
||||
})
|
||||
|
||||
minetest.register_craftitem("farming:pumpkin_dough", {
|
||||
description = S("Pumpkin Dough"),
|
||||
inventory_image = "farming_pumpkin_dough.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "farming:pumpkin_dough",
|
||||
type = "shapeless",
|
||||
recipe = {"farming:flour", "farming:pumpkin_slice", "farming:pumpkin_slice"}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "farming:pumpkin_bread",
|
||||
recipe = "farming:pumpkin_dough",
|
||||
cooktime = 10
|
||||
})
|
||||
|
||||
-- pumpkin definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_pumpkin_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
waving = 1,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:pumpkin_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_pumpkin_2.png"}
|
||||
minetest.register_node("farming:pumpkin_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_pumpkin_3.png"}
|
||||
minetest.register_node("farming:pumpkin_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4
|
||||
crop_def.tiles = {"farming_pumpkin_4.png"}
|
||||
minetest.register_node("farming:pumpkin_4", table.copy(crop_def))
|
||||
|
||||
-- stage 5
|
||||
crop_def.tiles = {"farming_pumpkin_5.png"}
|
||||
minetest.register_node("farming:pumpkin_5", table.copy(crop_def))
|
||||
|
||||
-- stage 6
|
||||
crop_def.tiles = {"farming_pumpkin_6.png"}
|
||||
minetest.register_node("farming:pumpkin_6", table.copy(crop_def))
|
||||
|
||||
-- stage 7
|
||||
crop_def.tiles = {"farming_pumpkin_7.png"}
|
||||
minetest.register_node("farming:pumpkin_7", table.copy(crop_def))
|
||||
|
||||
-- stage 8 (final)
|
||||
crop_def.tiles = {"farming_pumpkin_8.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:pumpkin_slice 9'}, rarity = 1},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:pumpkin_8", table.copy(crop_def))
|
68
mods/farming/raspberry.lua
Executable file
@ -0,0 +1,68 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- raspberries
|
||||
minetest.register_craftitem("farming:raspberries", {
|
||||
description = S("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 = S("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"},
|
||||
}
|
||||
})
|
||||
|
||||
-- raspberries definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_raspberry_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:raspberry_1", table.copy(crop_def))
|
||||
|
||||
-- stage 2
|
||||
crop_def.tiles = {"farming_raspberry_2.png"}
|
||||
minetest.register_node("farming:raspberry_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3
|
||||
crop_def.tiles = {"farming_raspberry_3.png"}
|
||||
minetest.register_node("farming:raspberry_3", table.copy(crop_def))
|
||||
|
||||
-- stage 4 (final)
|
||||
crop_def.tiles = {"farming_raspberry_4.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:raspberries 2'}, rarity = 1},
|
||||
{items = {'farming:raspberries'}, rarity = 2},
|
||||
{items = {'farming:raspberries'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:raspberry_4", table.copy(crop_def))
|
64
mods/farming/rhubarb.lua
Executable file
@ -0,0 +1,64 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- rhubarb
|
||||
minetest.register_craftitem("farming:rhubarb", {
|
||||
description = S("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),
|
||||
})
|
||||
|
||||
-- rhubarb pie
|
||||
minetest.register_craftitem("farming:rhubarb_pie", {
|
||||
description = S("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"},
|
||||
}
|
||||
})
|
||||
|
||||
-- rhubarb definition
|
||||
local crop_def = {
|
||||
drawtype = "plantlike",
|
||||
tiles = {"farming_rhubarb_1.png"},
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
buildable_to = true,
|
||||
drop = "",
|
||||
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()
|
||||
}
|
||||
|
||||
-- stage 1
|
||||
minetest.register_node("farming:rhubarb_1", table.copy(crop_def))
|
||||
|
||||
-- stage2
|
||||
crop_def.tiles = {"farming_rhubarb_2.png"}
|
||||
minetest.register_node("farming:rhubarb_2", table.copy(crop_def))
|
||||
|
||||
-- stage 3 (final)
|
||||
crop_def.tiles = {"farming_rhubarb_3.png"}
|
||||
crop_def.groups.growing = 0
|
||||
crop_def.drop = {
|
||||
items = {
|
||||
{items = {'farming:rhubarb 2'}, rarity = 1},
|
||||
{items = {'farming:rhubarb'}, rarity = 2},
|
||||
{items = {'farming:rhubarb'}, rarity = 3},
|
||||
}
|
||||
}
|
||||
minetest.register_node("farming:rhubarb_3", table.copy(crop_def))
|
67
mods/farming/soil.lua
Executable file
@ -0,0 +1,67 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
-- normal soil
|
||||
minetest.register_node("farming:soil", {
|
||||
description = S("Soil"),
|
||||
tiles = {"default_dirt.png^farming_soil.png", "default_dirt.png"},
|
||||
drop = "default:dirt",
|
||||
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 2},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
-- wet soil
|
||||
minetest.register_node("farming:soil_wet", {
|
||||
description = S("Wet Soil"),
|
||||
tiles = {"default_dirt.png^farming_soil_wet.png", "default_dirt.png^farming_soil_wet_side.png"},
|
||||
drop = "default:dirt",
|
||||
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 3},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
-- sand is not soil, change existing sand-soil to use normal soil
|
||||
minetest.register_alias("farming:desert_sand_soil", "farming:soil")
|
||||
minetest.register_alias("farming:desert_sand_soil_wet", "farming:soil_wet")
|
||||
|
||||
-- if water near soil then change to wet soil
|
||||
minetest.register_abm({
|
||||
nodenames = {"farming:soil", "farming:soil_wet"},
|
||||
interval = 15,
|
||||
chance = 4,
|
||||
catch_up = false,
|
||||
|
||||
action = function(pos, node)
|
||||
|
||||
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]
|
||||
and minetest.registered_nodes[nn].walkable
|
||||
and minetest.get_item_group(nn, "plant") == 0 then
|
||||
minetest.set_node(pos, {name = "default:dirt"})
|
||||
return
|
||||
end
|
||||
|
||||
-- if map around soil not loaded then skip until loaded
|
||||
if minetest.find_node_near(pos, 3, {"ignore"}) then
|
||||
return
|
||||
end
|
||||
|
||||
-- check if there is water nearby and change soil accordingly
|
||||
if minetest.find_node_near(pos, 3, {"group:water"}) then
|
||||
if node.name == "farming:soil" then
|
||||
minetest.set_node(pos, {name = "farming:soil_wet"})
|
||||
end
|
||||
|
||||
elseif node.name == "farming:soil_wet" then
|
||||
minetest.set_node(pos, {name = "farming:soil"})
|
||||
|
||||
elseif node.name == "farming:soil" then
|
||||
minetest.set_node(pos, {name = "default:dirt"})
|
||||
end
|
||||
end,
|
||||
})
|
174
mods/farming/statistics.lua
Executable file
@ -0,0 +1,174 @@
|
||||
local statistics = {}
|
||||
local ROOT_2 = math.sqrt(2.0)
|
||||
|
||||
-- Approximations for erf(x) and erfInv(x) from
|
||||
-- https://en.wikipedia.org/wiki/Error_function
|
||||
|
||||
local erf
|
||||
local erf_inv
|
||||
|
||||
local A = 8 * (math.pi - 3.0)/(3.0 * math.pi * (4.0 - math.pi))
|
||||
local B = 4.0 / math.pi
|
||||
local C = 2.0/(math.pi * A)
|
||||
local D = 1.0 / A
|
||||
|
||||
erf = function(x)
|
||||
|
||||
if x == 0 then return 0; end
|
||||
|
||||
local xSq = x * x
|
||||
local aXSq = A * xSq
|
||||
local v = math.sqrt(1.0 - math.exp(-xSq * (B + aXSq) / (1.0 + aXSq)))
|
||||
|
||||
return (x > 0 and v) or -v
|
||||
end
|
||||
|
||||
erf_inv = function(x)
|
||||
|
||||
if x == 0 then return 0; end
|
||||
|
||||
if x <= -1 or x >= 1 then return nil; end
|
||||
|
||||
local y = math.log(1 - x * x)
|
||||
local u = C + 0.5 * y
|
||||
local v = math.sqrt(math.sqrt(u * u - D * y) - u)
|
||||
|
||||
return (x > 0 and v) or -v
|
||||
end
|
||||
|
||||
local function std_normal(u)
|
||||
return ROOT_2 * erf_inv(2.0 * u - 1.0)
|
||||
end
|
||||
|
||||
local poisson
|
||||
local cdf_table = {}
|
||||
|
||||
local function generate_cdf(lambda_index, lambda)
|
||||
|
||||
local max = math.ceil(4 * lambda)
|
||||
local pdf = math.exp(-lambda)
|
||||
local cdf = pdf
|
||||
local t = { [0] = pdf }
|
||||
|
||||
for i = 1, max - 1 do
|
||||
pdf = pdf * lambda / i
|
||||
cdf = cdf + pdf
|
||||
t[i] = cdf
|
||||
end
|
||||
|
||||
return t
|
||||
end
|
||||
|
||||
for li = 1, 100 do
|
||||
cdf_table[li] = generate_cdf(li, 0.25 * li)
|
||||
end
|
||||
|
||||
poisson = function(lambda, max)
|
||||
|
||||
if max < 2 then
|
||||
return (math.random() < math.exp(-lambda) and 0) or 1
|
||||
elseif lambda >= 2 * max then
|
||||
return max
|
||||
end
|
||||
|
||||
local u = math.random()
|
||||
local lambda_index = math.floor(4 * lambda + 0.5)
|
||||
local cdfs = cdf_table[lambda_index]
|
||||
|
||||
if cdfs then
|
||||
|
||||
lambda = 0.25 * lambda_index
|
||||
|
||||
if u < cdfs[0] then return 0; end
|
||||
if max > #cdfs then max = #cdfs + 1 else max = math.floor(max); end
|
||||
if u >= cdfs[max - 1] then return max; end
|
||||
|
||||
if max > 4 then -- Binary search
|
||||
|
||||
local s = 0
|
||||
|
||||
while s + 1 < max do
|
||||
|
||||
local m = math.floor(0.5 * (s + max))
|
||||
|
||||
if u < cdfs[m] then max = m; else s = m; end
|
||||
end
|
||||
else
|
||||
for i = 1, max - 1 do
|
||||
if u < cdfs[i] then return i; end
|
||||
end
|
||||
end
|
||||
|
||||
return max
|
||||
else
|
||||
local x = lambda + math.sqrt(lambda) * std_normal(u)
|
||||
|
||||
return (x < 0.5 and 0) or (x >= max - 0.5 and max) or math.floor(x + 0.5)
|
||||
end
|
||||
end
|
||||
|
||||
-- Error function.
|
||||
statistics.erf = erf
|
||||
|
||||
-- Inverse error function.
|
||||
statistics.erf_inv = erf_inv
|
||||
|
||||
--- Standard normal distribution function (mean 0, standard deviation 1).
|
||||
--
|
||||
-- @return
|
||||
-- Any real number (actually between -3.0 and 3.0).
|
||||
|
||||
statistics.std_normal = function()
|
||||
|
||||
local u = math.random()
|
||||
|
||||
if u < 0.001 then
|
||||
return -3.0
|
||||
elseif u > 0.999 then
|
||||
return 3.0
|
||||
end
|
||||
|
||||
return std_normal(u)
|
||||
end
|
||||
|
||||
--- Standard normal distribution function (mean 0, standard deviation 1).
|
||||
--
|
||||
-- @param mu
|
||||
-- The distribution mean.
|
||||
-- @param sigma
|
||||
-- The distribution standard deviation.
|
||||
-- @return
|
||||
-- Any real number (actually between -3*sigma and 3*sigma).
|
||||
|
||||
statistics.normal = function(mu, sigma)
|
||||
|
||||
local u = math.random()
|
||||
|
||||
if u < 0.001 then
|
||||
return mu - 3.0 * sigma
|
||||
elseif u > 0.999 then
|
||||
return mu + 3.0 * sigma
|
||||
end
|
||||
|
||||
return mu + sigma * std_normal(u)
|
||||
end
|
||||
|
||||
--- Poisson distribution function.
|
||||
--
|
||||
-- @param lambda
|
||||
-- The distribution mean and variance.
|
||||
-- @param max
|
||||
-- The distribution maximum.
|
||||
-- @return
|
||||
-- An integer between 0 and max (both inclusive).
|
||||
|
||||
statistics.poisson = function(lambda, max)
|
||||
|
||||
lambda, max = tonumber(lambda), tonumber(max)
|
||||
|
||||
if not lambda or not max or lambda <= 0 or max < 1 then return 0; end
|
||||
|
||||
return poisson(lambda, max)
|
||||
end
|
||||
|
||||
return statistics
|
16
mods/farming/sugar.lua
Executable file
@ -0,0 +1,16 @@
|
||||
|
||||
local S = farming.intllib
|
||||
|
||||
--= Sugar
|
||||
|
||||
minetest.register_craftitem("farming:sugar", {
|
||||
description = S("Sugar"),
|
||||
inventory_image = "farming_sugar.png",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 3,
|
||||
output = "farming:sugar 2",
|
||||
recipe = "default:papyrus",
|
||||
})
|
BIN
mods/farming/textures/default_junglegrass.png
Executable file
After Width: | Height: | Size: 251 B |
BIN
mods/farming/textures/farming_baked_potato.png
Executable file
After Width: | Height: | Size: 318 B |
BIN
mods/farming/textures/farming_barley.png
Normal file
After Width: | Height: | Size: 230 B |
BIN
mods/farming/textures/farming_barley_1.png
Normal file
After Width: | Height: | Size: 140 B |
BIN
mods/farming/textures/farming_barley_2.png
Normal file
After Width: | Height: | Size: 151 B |
BIN
mods/farming/textures/farming_barley_3.png
Normal file
After Width: | Height: | Size: 209 B |
BIN
mods/farming/textures/farming_barley_4.png
Normal file
After Width: | Height: | Size: 229 B |
BIN
mods/farming/textures/farming_barley_5.png
Normal file
After Width: | Height: | Size: 246 B |
BIN
mods/farming/textures/farming_barley_6.png
Normal file
After Width: | Height: | Size: 271 B |
BIN
mods/farming/textures/farming_barley_7.png
Normal file
After Width: | Height: | Size: 277 B |
BIN
mods/farming/textures/farming_barley_seed.png
Normal file
After Width: | Height: | Size: 145 B |
BIN
mods/farming/textures/farming_beanbush.png
Normal file
After Width: | Height: | Size: 227 B |
BIN
mods/farming/textures/farming_beanpole.png
Normal file
After Width: | Height: | Size: 323 B |
BIN
mods/farming/textures/farming_beanpole_1.png
Normal file
After Width: | Height: | Size: 242 B |
BIN
mods/farming/textures/farming_beanpole_2.png
Normal file
After Width: | Height: | Size: 264 B |
BIN
mods/farming/textures/farming_beanpole_3.png
Normal file
After Width: | Height: | Size: 297 B |
BIN
mods/farming/textures/farming_beanpole_4.png
Normal file
After Width: | Height: | Size: 355 B |
BIN
mods/farming/textures/farming_beanpole_5.png
Normal file
After Width: | Height: | Size: 353 B |
BIN
mods/farming/textures/farming_beans.png
Normal file
After Width: | Height: | Size: 193 B |
BIN
mods/farming/textures/farming_blueberries.png
Executable file
After Width: | Height: | Size: 164 B |
BIN
mods/farming/textures/farming_blueberry_1.png
Executable file
After Width: | Height: | Size: 113 B |
BIN
mods/farming/textures/farming_blueberry_2.png
Executable file
After Width: | Height: | Size: 187 B |
BIN
mods/farming/textures/farming_blueberry_3.png
Executable file
After Width: | Height: | Size: 193 B |
BIN
mods/farming/textures/farming_blueberry_4.png
Executable file
After Width: | Height: | Size: 204 B |
BIN
mods/farming/textures/farming_blueberry_muffin.png
Executable file
After Width: | Height: | Size: 224 B |
BIN
mods/farming/textures/farming_bottle_ethanol.png
Executable file
After Width: | Height: | Size: 168 B |
BIN
mods/farming/textures/farming_bread.png
Normal file → Executable file
Before Width: | Height: | Size: 548 B After Width: | Height: | Size: 552 B |
BIN
mods/farming/textures/farming_carrot.png
Executable file
After Width: | Height: | Size: 213 B |
BIN
mods/farming/textures/farming_carrot_1.png
Executable file
After Width: | Height: | Size: 108 B |
BIN
mods/farming/textures/farming_carrot_2.png
Executable file
After Width: | Height: | Size: 111 B |
BIN
mods/farming/textures/farming_carrot_3.png
Executable file
After Width: | Height: | Size: 112 B |
BIN
mods/farming/textures/farming_carrot_4.png
Executable file
After Width: | Height: | Size: 119 B |
BIN
mods/farming/textures/farming_carrot_5.png
Executable file
After Width: | Height: | Size: 123 B |
BIN
mods/farming/textures/farming_carrot_6.png
Executable file
After Width: | Height: | Size: 129 B |
BIN
mods/farming/textures/farming_carrot_7.png
Executable file
After Width: | Height: | Size: 144 B |
BIN
mods/farming/textures/farming_carrot_8.png
Executable file
After Width: | Height: | Size: 160 B |
BIN
mods/farming/textures/farming_carrot_gold.png
Executable file
After Width: | Height: | Size: 206 B |
BIN
mods/farming/textures/farming_chocolate_dark.png
Executable file
After Width: | Height: | Size: 189 B |
BIN
mods/farming/textures/farming_cocoa_1.png
Executable file
After Width: | Height: | Size: 229 B |
BIN
mods/farming/textures/farming_cocoa_2.png
Executable file
After Width: | Height: | Size: 240 B |
BIN
mods/farming/textures/farming_cocoa_3.png
Executable file
After Width: | Height: | Size: 247 B |
BIN
mods/farming/textures/farming_cocoa_beans.png
Executable file
After Width: | Height: | Size: 183 B |
BIN
mods/farming/textures/farming_coffee_1.png
Executable file
After Width: | Height: | Size: 135 B |
BIN
mods/farming/textures/farming_coffee_2.png
Executable file
After Width: | Height: | Size: 143 B |
BIN
mods/farming/textures/farming_coffee_3.png
Executable file
After Width: | Height: | Size: 171 B |
BIN
mods/farming/textures/farming_coffee_4.png
Executable file
After Width: | Height: | Size: 189 B |
BIN
mods/farming/textures/farming_coffee_5.png
Executable file
After Width: | Height: | Size: 189 B |
BIN
mods/farming/textures/farming_coffee_beans.png
Executable file
After Width: | Height: | Size: 194 B |
BIN
mods/farming/textures/farming_coffee_cup.png
Executable file
After Width: | Height: | Size: 161 B |
BIN
mods/farming/textures/farming_coffee_cup_hot.png
Executable file
After Width: | Height: | Size: 173 B |
BIN
mods/farming/textures/farming_cookie.png
Executable file
After Width: | Height: | Size: 545 B |
BIN
mods/farming/textures/farming_corn.png
Executable file
After Width: | Height: | Size: 191 B |
BIN
mods/farming/textures/farming_corn_1.png
Executable file
After Width: | Height: | Size: 107 B |
BIN
mods/farming/textures/farming_corn_2.png
Executable file
After Width: | Height: | Size: 121 B |
BIN
mods/farming/textures/farming_corn_3.png
Executable file
After Width: | Height: | Size: 142 B |
BIN
mods/farming/textures/farming_corn_4.png
Executable file
After Width: | Height: | Size: 154 B |
BIN
mods/farming/textures/farming_corn_5.png
Executable file
After Width: | Height: | Size: 161 B |
BIN
mods/farming/textures/farming_corn_6.png
Executable file
After Width: | Height: | Size: 209 B |
BIN
mods/farming/textures/farming_corn_7.png
Executable file
After Width: | Height: | Size: 222 B |
BIN
mods/farming/textures/farming_corn_8.png
Executable file
After Width: | Height: | Size: 251 B |
BIN
mods/farming/textures/farming_corn_cob.png
Executable file
After Width: | Height: | Size: 175 B |
0
mods/farming/textures/farming_cotton.png
Normal file → Executable file
Before Width: | Height: | Size: 166 B After Width: | Height: | Size: 166 B |
BIN
mods/farming/textures/farming_cotton_1.png
Normal file → Executable file
Before Width: | Height: | Size: 95 B After Width: | Height: | Size: 110 B |
BIN
mods/farming/textures/farming_cotton_2.png
Normal file → Executable file
Before Width: | Height: | Size: 119 B After Width: | Height: | Size: 120 B |
BIN
mods/farming/textures/farming_cotton_3.png
Normal file → Executable file
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 144 B |
BIN
mods/farming/textures/farming_cotton_4.png
Normal file → Executable file
Before Width: | Height: | Size: 179 B After Width: | Height: | Size: 150 B |
Before Width: | Height: | Size: 221 B After Width: | Height: | Size: 158 B |