Add files via upload
parent
e53f37ac57
commit
f4722033c7
45
LICENSE
45
LICENSE
|
@ -1,24 +1,35 @@
|
|||
## Crops Plus - by Grizzly Adam
|
||||
|
||||
Crops - a minetest mod that adds more farming crops
|
||||
An extension to the crops mod by Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
See spdx.org/licenses to see what the License Identifiers used below mean.
|
||||
|
||||
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
|
||||
|
||||
All source code (lua):
|
||||
(C) Auke Kok <sofar@foo-projects.org>
|
||||
LGPL-2.0+
|
||||
------------Code----------
|
||||
Crops Plus code is licensed under the LGPL-2.1
|
||||
(C) 2018 Grizzly Adam
|
||||
(C) 2015-2017 Auke Kok
|
||||
|
||||
All textures, models:
|
||||
(C) Auke Kok <sofar@foo-projects.org>
|
||||
CC-BY-SA-3.0
|
||||
garlic.lua based on potato.lua
|
||||
onion.lua based on potato.lua
|
||||
pepper.lua based on tomato.lua
|
||||
|
||||
Translations:
|
||||
- de.po
|
||||
(C) 2017 LNJ <git@lnj.li>
|
||||
LGPL-2.0+
|
||||
- init.lua modified Jan 12, 2018 to increase interval & damage interval, and to add new crops.
|
||||
- crop_setting.txt modified Jan 12, 2018 to set difficulty to easy by default
|
||||
- cornlua, & tomato.lua modified Jan 17, 2018 to change on_use = minetest.item_eat values.
|
||||
- tomato.lua modified Jan 20, 2018 to add tomato sauce to crafting recipe. Tomato seeds are now a byproduct of making tomato sauce.
|
||||
-melon.lua modified Jan 20, 2018 to change on_use = minetest.item_eat values, add watermelon juice and watermelon slush recipes, and make melon seeds a byproduct of watermelon juice and slush recipes.
|
||||
|
||||
Sounds:
|
||||
|
||||
----------Textures----------
|
||||
Crops Plus Textures are licensed under the CC-BY-SA-3.0
|
||||
(C) 2018 Adam Grizzly ....
|
||||
(C) 2015-2017 Auke Kok ....
|
||||
|
||||
All Garlic, Onions, Peppers, Tomato sauce, Watermelon Juice, and Watermelon Slush textures by Grizzly Adam
|
||||
|
||||
|
||||
-----------Sounds-----------
|
||||
- crops_watercan_splash*
|
||||
http://freesound.org/people/junggle/sounds/27361/
|
||||
http://profiles.google.com/jun66le
|
||||
|
@ -26,15 +37,13 @@ Sounds:
|
|||
- crops_watercan_entering.ogg
|
||||
http://freesound.org/people/Quistard/sounds/166824/
|
||||
CC-BY-3.0
|
||||
- crops_flies.ogg
|
||||
|
||||
- crops_flies.ogg --edited to shorten Jan 12, 2018
|
||||
http://www.freesound.org/people/galeku/sounds/46938/
|
||||
CC0-1.0
|
||||
|
||||
- crops_watercan_watering.ogg
|
||||
http://www.freesound.org/people/Eakoontz/sounds/151736/
|
||||
CC0-1.0
|
||||
|
||||
* Sounds edited with audacity
|
||||
|
||||
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
|
||||
|
||||
Peppers by Grizzly Adam
|
||||
|
|
51
README.md
51
README.md
|
@ -1,6 +1,6 @@
|
|||
## Crops Plus - by Grizzly Adam
|
||||
## Crops Plus 1.0 - by Grizzly Adam
|
||||
|
||||
Based on Crops by Auke Kok <sofar@foo-projects.org>
|
||||
An extension to the crops mod by Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
## Configuration
|
||||
|
||||
|
@ -43,20 +43,23 @@ are listed below.
|
|||
|
||||
## Plants
|
||||
|
||||
1. Melons and pumpkins
|
||||
1. Melons
|
||||
|
||||
Melon plants grow from melon seeds. Once a plant is mature (there
|
||||
are 5 stages) it will spawn a melon block adjacent to the plant.
|
||||
The melon block can be harvested by punching, and yields 3-5
|
||||
melon slices. The melon slice can be crafted to a melon seed.
|
||||
melon slices. The melon slice can be crafted into watermelon juice
|
||||
and watermelon slush (requires ice). Both recipeps return a melon
|
||||
seed.
|
||||
|
||||
2. Pumpkins
|
||||
Pumpkins grow from pumpkin seeds, and are harvested to yield a
|
||||
pumpkin block. Each block can be cooked to yield one or more
|
||||
roast pumpkin chunks, which can be eaten. You can also craft
|
||||
the blocks to seeds. A pumpkin plant will only yield limited amounts
|
||||
of pumpkins. After a while they automatically wither.
|
||||
|
||||
2. Corn.
|
||||
3. Corn.
|
||||
|
||||
Corn plants are 2 blocks high, and yield corn cobs. These can be
|
||||
cooked to corn-on-the-cob, or processed to make corn seed (corn
|
||||
|
@ -67,16 +70,16 @@ Digging a mature plant yields the corn cob. A harvested corn plant
|
|||
be left as ornamental 2-block plant. Digging either top or bottom
|
||||
block works in all cases.
|
||||
|
||||
3. Tomatoes.
|
||||
4. Tomatoes.
|
||||
|
||||
Tomatoes appear to work simple enough, until you harvest them
|
||||
the first time: The plant stays! However, after the 3rd to 5th
|
||||
harvest, the plant wilts and needs to be removed, since no more
|
||||
tomatoes will grow on the plant. Per harvest you can get 1-2
|
||||
tomatoes only. You can craft the tomatoes to tomato seeds, as
|
||||
expected.
|
||||
tomatoes only. You can craft the tomatoes into tomato sauce.
|
||||
Tomato seeds are a byproduct of tomato sauce.
|
||||
|
||||
4. Potatoes.
|
||||
5. Potatoes.
|
||||
|
||||
The plants themselves don't drop anything. Only if the plant matures
|
||||
can you dig potatoes from the soil. If you can reach the soil from the
|
||||
|
@ -89,7 +92,7 @@ which are the clones that can grow back to potatoes. Be careful not
|
|||
to dig the plant when there's flowers! You have to wait until the soil
|
||||
below shows potatoes. It's fairly easy to see the difference, though.
|
||||
|
||||
5. Green Beans
|
||||
6. Green Beans
|
||||
|
||||
These green beans are unnaturally green, but there's so many
|
||||
of them that grow on a vine! Sadly, these beans don't grow beans
|
||||
|
@ -110,15 +113,38 @@ so you salvage the beanpole's sticks after harvesting in order to
|
|||
make more beanpoles again. It's a bit of work, but worth it, these
|
||||
beans are delicious!
|
||||
|
||||
6. Peppers
|
||||
7. Peppers
|
||||
|
||||
Peppers work the same as tomatoes. The seeds are peppercorns, when can be crafted with a glass bottle to make ground pepper.
|
||||
Peppers work the same as tomatoes. The seeds are peppercorns, which
|
||||
can be crafted with a glass bottle to make ground pepper.
|
||||
|
||||
8. Onions
|
||||
|
||||
Onion seeds can be planted to produce onion plants. Once the plant
|
||||
matures, seed pods become visible on top of the plants and onions
|
||||
can be seen in the soil. Cut the top off the mature onion plant to
|
||||
receive 1-3 seeds. Dig the onions from the soil to harvest up to 4
|
||||
onions.
|
||||
|
||||
9. Garlic
|
||||
|
||||
Garlic is grown by planting garlic cloves. When the garlic plant
|
||||
reaches maturity, purple flowers appear on top and a garlic bulb can be
|
||||
seen emerging from the soil. The tops of the plant can then be cut
|
||||
away and the garlic bulb can be dug to harvest. Garlic bulbs can be
|
||||
divided into 9 garlic cloves. 9 garlic bulbs can be crafted into a
|
||||
garlic braid, which can then be placed for decoration or broken back
|
||||
down into 9 garlic bulbs.
|
||||
|
||||
## Cooking / Crafting
|
||||
|
||||
The corn cobs can be cooked directly to make Corn-on-the-Cob.
|
||||
|
||||
Tomatoes can be crafted into tomato sauce, which returns tomato sauce.
|
||||
|
||||
Melon slices can be crafted into watermelon juice, or combined with ice
|
||||
to make watermelon slush. Both recipes return melon seeds.
|
||||
|
||||
This mod includes a bowl recipe. The bowl is made from clay lumps,
|
||||
which results in an unbaked clay bowl that needs to be baked in an
|
||||
oven to be usable:
|
||||
|
@ -162,3 +188,4 @@ the humidity level of the plant: a dry plant will have 0% humidity
|
|||
and be a small red bar or no bar at all, and a soaked plant will
|
||||
have a full green bar. Be careful though! Some plants prefer to be
|
||||
at mid-level (yellow) instead of full wetness!
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
|
8
corn.lua
8
corn.lua
|
@ -1,9 +1,9 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
@ -57,7 +57,7 @@ minetest.register_craft({
|
|||
minetest.register_craftitem("crops:corn_on_the_cob", {
|
||||
description = S("Corn on the Cob"),
|
||||
inventory_image = "crops_corn_on_the_cob.png",
|
||||
on_use = minetest.item_eat(1)
|
||||
on_use = minetest.item_eat(3)
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
craft_guide?
|
||||
default
|
||||
farming
|
||||
intllib?
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
This mod expands the basic set of farming-related crops that minetest_game offers. It adds melons, potatoes, tomatoes, green beans and corn. The mod also implements plant humidity - you will have to water plants to make sure they're not dried out, or make sure they don't get over-watered.
|
||||
Crops Plus expands on the Crops mod and the basic set of farming-related crops that minetest_game offers. Crops added melons, potatoes, tomatoes, green beans and corn and implementd plant humidity - you will have to water plants to make sure they're not dried out, or make sure they don't get over-watered. Crops Plus adds Garlic, Onions, and Peppers.
|
||||
|
||||
Mod specific settings can be changed in the "crops_settings.txt" file in the world folder.
|
||||
|
||||
For more information, go to: http://goo.gl/wf0XLh
|
||||
|
|
|
@ -0,0 +1,236 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
||||
--]]
|
||||
|
||||
-- Intllib
|
||||
local S = crops.intllib
|
||||
|
||||
minetest.register_node("crops:garlic_clove", {
|
||||
description = S("Garlic Clove"),
|
||||
inventory_image = "crops_garlic_clove.png",
|
||||
wield_image = "crops_garlic_clove.png",
|
||||
tiles = { "crops_garlic_plant_1.png" },
|
||||
drawtype = "plantlike",
|
||||
paramtype2 = "meshoptions",
|
||||
waving = 1,
|
||||
sunlight_propagates = false,
|
||||
use_texture_alpha = true,
|
||||
walkable = false,
|
||||
paramtype = "light",
|
||||
node_placement_prediction = "crops:garlic_plant_1",
|
||||
groups = { snappy=3,flammable=3,flora=1,attached_node=1 },
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.45, -0.5, -0.45, 0.45, -0.4, 0.45}
|
||||
},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local under = minetest.get_node(pointed_thing.under)
|
||||
if minetest.get_item_group(under.name, "soil") <= 1 then
|
||||
return
|
||||
end
|
||||
crops.plant(pointed_thing.above, {name="crops:garlic_plant_1", param2 = 3})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
for stage = 1, 5 do
|
||||
minetest.register_node("crops:garlic_plant_" .. stage , {
|
||||
description = S("garlic plant"),
|
||||
tiles = { "crops_garlic_plant_" .. stage .. ".png" },
|
||||
drawtype = "plantlike",
|
||||
paramtype2 = "meshoptions",
|
||||
waving = 1,
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
walkable = false,
|
||||
paramtype = "light",
|
||||
groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 },
|
||||
drop = {},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.45, -0.5, -0.45, 0.45, -0.6 + (((math.min(stage, 4)) + 1) / 5), 0.45}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_node("crops:garlic_braid", {
|
||||
description = S("Garlic Braid"),
|
||||
inventory_image = "crops_garlic_braid.png",
|
||||
wield_image = "crops_garlic_braid.png",
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {
|
||||
"crops_garlic_braid_side.png","crops_garlic_braid.png",
|
||||
"crops_garlic_braid_side.png^[transformFx","crops_garlic_braid_side.png",
|
||||
"crops_garlic_braid.png","crops_garlic_braid.png"
|
||||
},
|
||||
groups = {vessel = 1, dig_immediate = 3},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.13, -0.45, 0.5, 0.13, 0.45, 0.24,
|
||||
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craftitem("crops:garlic", {
|
||||
description = S("Garlic"),
|
||||
inventory_image = "crops_garlic.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
groups = {garlic = 1},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "crops:garlic_clove 9",
|
||||
recipe = { "crops:garlic" }
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "crops:garlic_braid",
|
||||
recipe = {
|
||||
{"group:garlic", "group:garlic", "group:garlic"},
|
||||
{"group:garlic", "group:garlic", "group:garlic"},
|
||||
{"group:garlic", "group:garlic", "group:garlic"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "crops:garlic 9",
|
||||
recipe = { "crops:garlic_braid" }
|
||||
})
|
||||
|
||||
--
|
||||
-- the garlic "block"
|
||||
--
|
||||
minetest.register_node("crops:soil_with_garlic", {
|
||||
description = S("Soil with garlic"),
|
||||
tiles = { "default_dirt.png^crops_garlic_soil.png", "default_dirt.png" },
|
||||
sunlight_propagates = false,
|
||||
use_texture_alpha = false,
|
||||
walkable = true,
|
||||
groups = { snappy=3, flammable=3, oddly_breakable_by_hand=2, soil=1 },
|
||||
paramtype2 = "facedir",
|
||||
drop = {max_items = 5, items = {
|
||||
{ items = {'crops:garlic'}, rarity = 1 },
|
||||
{ items = {'crops:garlic'}, rarity = 1 },
|
||||
{ items = {'crops:garlic'}, rarity = 1 },
|
||||
{ items = {'crops:garlic'}, rarity = 2 },
|
||||
{ items = {'crops:garlic'}, rarity = 5 },
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
on_dig = function(pos, node, digger)
|
||||
local drops = {}
|
||||
-- damage 0 = drops 3-5
|
||||
-- damage 50 = drops 1-3
|
||||
-- damage 100 = drops 0-1
|
||||
local meta = minetest.get_meta(pos)
|
||||
local damage = meta:get_int("crops_damage")
|
||||
for i = 1, math.random(2 - (3 * damage / 100), 2 - (4 * (damage / 100))) do
|
||||
table.insert(drops, "crops:garlic")
|
||||
end
|
||||
core.handle_node_drops(pos, drops, digger)
|
||||
minetest.set_node(pos, { name = "farming:soil" })
|
||||
local above = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
if minetest.get_node(above).name == "crops:garlic_plant_4" then
|
||||
minetest.set_node(above, { name = "air" })
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
--
|
||||
-- grows a plant to mature size
|
||||
--
|
||||
minetest.register_abm({
|
||||
nodenames = { "crops:garlic_plant_1", "crops:garlic_plant_2", "crops:garlic_plant_3" },
|
||||
neighbors = { "group:soil" },
|
||||
interval = crops.settings.interval,
|
||||
chance = crops.settings.chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if not crops.can_grow(pos) then
|
||||
return
|
||||
end
|
||||
local below = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
if not minetest.registered_nodes[minetest.get_node(below).name].groups.soil then
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local damage = meta:get_int("crops_damage")
|
||||
if damage == 100 then
|
||||
crops.die(pos)
|
||||
return
|
||||
end
|
||||
local n = string.gsub(node.name, "3", "4")
|
||||
n = string.gsub(n, "2", "3")
|
||||
n = string.gsub(n, "1", "2")
|
||||
minetest.swap_node(pos, { name = n, param2 = 3 })
|
||||
end
|
||||
})
|
||||
|
||||
--
|
||||
-- grows the final garlic in the soil beneath
|
||||
--
|
||||
minetest.register_abm({
|
||||
nodenames = { "crops:garlic_plant_4" },
|
||||
neighbors = { "group:soil" },
|
||||
interval = crops.settings.interval,
|
||||
chance = crops.settings.chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if not crops.can_grow(pos) then
|
||||
return
|
||||
end
|
||||
local below = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
if not minetest.registered_nodes[minetest.get_node(below).name].groups.soil then
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local damage = meta:get_int("crops_damage")
|
||||
minetest.set_node(below, { name = "crops:soil_with_garlic" })
|
||||
meta = minetest.get_meta(below)
|
||||
meta:set_int("crops_damage", damage)
|
||||
end
|
||||
})
|
||||
|
||||
crops.garlic_die = function(pos)
|
||||
minetest.set_node(pos, { name = "crops:garlic_plant_5", param2 = 3 })
|
||||
local below = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
local node = minetest.get_node(below)
|
||||
if node.name == "crops:soil_with_garlic" then
|
||||
local meta = minetest.get_meta(below)
|
||||
meta:set_int("crops_damage", 100)
|
||||
end
|
||||
end
|
||||
|
||||
local properties = {
|
||||
die = crops.garlic_die,
|
||||
waterstart = 30,
|
||||
wateruse = 1,
|
||||
night = 5,
|
||||
soak = 80,
|
||||
soak_damage = 90,
|
||||
wither = 20,
|
||||
wither_damage = 10,
|
||||
}
|
||||
|
||||
crops.register({ name = "crops:garlic_plant_1", properties = properties })
|
||||
crops.register({ name = "crops:garlic_plant_2", properties = properties })
|
||||
crops.register({ name = "crops:garlic_plant_3", properties = properties })
|
||||
crops.register({ name = "crops:garlic_plant_4", properties = properties })
|
30
init.lua
30
init.lua
|
@ -1,9 +1,9 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
@ -17,13 +17,13 @@ crops.settings = {}
|
|||
local settings = {}
|
||||
settings.easy = {
|
||||
chance = 4,
|
||||
interval = 30,
|
||||
interval = 1,
|
||||
light = 8,
|
||||
watercan = 25,
|
||||
watercan_max = 90,
|
||||
watercan_uses = 20,
|
||||
damage_chance = 8,
|
||||
damage_interval = 30,
|
||||
damage_interval = 1,
|
||||
damage_tick_min = 0,
|
||||
damage_tick_max = 1,
|
||||
damage_max = 25,
|
||||
|
@ -31,13 +31,13 @@ settings.easy = {
|
|||
}
|
||||
settings.normal = {
|
||||
chance = 8,
|
||||
interval = 30,
|
||||
interval = 300,
|
||||
light = 10,
|
||||
watercan = 25,
|
||||
watercan_max = 90,
|
||||
watercan_uses = 20,
|
||||
damage_chance = 8,
|
||||
damage_interval = 30,
|
||||
damage_interval = 300,
|
||||
damage_tick_min = 0,
|
||||
damage_tick_max = 5,
|
||||
damage_max = 50,
|
||||
|
@ -45,13 +45,13 @@ settings.normal = {
|
|||
}
|
||||
settings.difficult = {
|
||||
chance = 16,
|
||||
interval = 30,
|
||||
interval = 300,
|
||||
light = 13,
|
||||
watercan = 25,
|
||||
watercan_max = 100,
|
||||
watercan_uses = 20,
|
||||
damage_chance = 4,
|
||||
damage_interval = 30,
|
||||
damage_interval = 300,
|
||||
damage_tick_min = 3,
|
||||
damage_tick_max = 7,
|
||||
damage_max = 100,
|
||||
|
@ -298,13 +298,15 @@ if crops.settings.hydration then
|
|||
end
|
||||
|
||||
-- crop nodes, crafts, craftitems
|
||||
dofile(modpath .. "/melon.lua")
|
||||
dofile(modpath .. "/pumpkin.lua")
|
||||
dofile(modpath .. "/corn.lua")
|
||||
dofile(modpath .. "/tomato.lua")
|
||||
dofile(modpath .. "/potato.lua")
|
||||
dofile(modpath .. "/polebean.lua")
|
||||
dofile(modpath .. "/garlic.lua")
|
||||
dofile(modpath .. "/melon.lua")
|
||||
dofile(modpath .. "/onion.lua")
|
||||
dofile(modpath .. "/pepper.lua")
|
||||
dofile(modpath .. "/polebean.lua")
|
||||
dofile(modpath .. "/potato.lua")
|
||||
dofile(modpath .. "/pumpkin.lua")
|
||||
dofile(modpath .. "/tomato.lua")
|
||||
|
||||
local nodenames = {}
|
||||
for i = 1,table.getn(crops.plants) do
|
||||
|
|
32
melon.lua
32
melon.lua
|
@ -1,9 +1,9 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
@ -87,13 +87,33 @@ minetest.register_node("crops:melon_plant_5_attached", {
|
|||
minetest.register_craftitem("crops:melon_slice", {
|
||||
description = S("Melon slice"),
|
||||
inventory_image = "crops_melon_slice.png",
|
||||
on_use = minetest.item_eat(1)
|
||||
on_use = minetest.item_eat(2)
|
||||
})
|
||||
|
||||
minetest.register_craftitem("crops:watermelon_juice", {
|
||||
description = S("Watermelon Juice"),
|
||||
inventory_image = "crops_watermelon_juice.png",
|
||||
on_use = minetest.item_eat(2)
|
||||
})
|
||||
|
||||
minetest.register_craftitem("crops:watermelon_slush", {
|
||||
description = S("Watermelon Slush"),
|
||||
inventory_image = "crops_watermelon_slush.png",
|
||||
on_use = minetest.item_eat(2)
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "crops:melon_seed",
|
||||
recipe = { "crops:melon_slice" }
|
||||
output = "crops:watermelon_juice",
|
||||
recipe = { "crops:melon_slice" },
|
||||
replacements = {{"crops:melon_slice","crops:melon_seed"}},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "crops:watermelon_slush",
|
||||
recipe = { "crops:melon_slice", "default:ice" },
|
||||
replacements = {{"crops:melon_slice","crops:melon_seed"}},
|
||||
})
|
||||
|
||||
--
|
||||
|
|
|
@ -0,0 +1,194 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
||||
--]]
|
||||
|
||||
-- Intllib
|
||||
local S = crops.intllib
|
||||
|
||||
minetest.register_node("crops:onion_seeds", {
|
||||
description = S("Onion Seeds"),
|
||||
inventory_image = "crops_onion_seeds.png",
|
||||
wield_image = "crops_onion_seeds.png",
|
||||
tiles = { "crops_onion_plant_1.png" },
|
||||
drawtype = "plantlike",
|
||||
paramtype2 = "meshoptions",
|
||||
waving = 1,
|
||||
sunlight_propagates = false,
|
||||
use_texture_alpha = true,
|
||||
walkable = false,
|
||||
paramtype = "light",
|
||||
node_placement_prediction = "crops:onion_plant_1",
|
||||
groups = { snappy=3,flammable=3,flora=1,attached_node=1 },
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.45, -0.5, -0.45, 0.45, -0.4, 0.45}
|
||||
},
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
local under = minetest.get_node(pointed_thing.under)
|
||||
if minetest.get_item_group(under.name, "soil") <= 1 then
|
||||
return
|
||||
end
|
||||
crops.plant(pointed_thing.above, {name="crops:onion_plant_1", param2 = 3})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
itemstack:take_item()
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
})
|
||||
|
||||
for stage = 1, 5 do
|
||||
minetest.register_node("crops:onion_plant_" .. stage , {
|
||||
description = S("Onion Plant"),
|
||||
tiles = { "crops_onion_plant_" .. stage .. ".png" },
|
||||
drawtype = "plantlike",
|
||||
paramtype2 = "meshoptions",
|
||||
waving = 1,
|
||||
sunlight_propagates = true,
|
||||
use_texture_alpha = true,
|
||||
walkable = false,
|
||||
paramtype = "light",
|
||||
groups = { snappy=3, flammable=3, flora=1, attached_node=1, not_in_creative_inventory=1 },
|
||||
drop = {},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-0.45, -0.5, -0.45, 0.45, -0.6 + (((math.min(stage, 4)) + 1) / 5), 0.45}
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craftitem("crops:onion", {
|
||||
description = S("Onion"),
|
||||
inventory_image = "crops_onion.png",
|
||||
on_use = minetest.item_eat(1)
|
||||
})
|
||||
|
||||
--
|
||||
-- the onions "block"
|
||||
--
|
||||
minetest.register_node("crops:soil_with_onions", {
|
||||
description = S("Soil with onions"),
|
||||
tiles = { "default_dirt.png^crops_onion_soil.png", "default_dirt.png" },
|
||||
sunlight_propagates = false,
|
||||
use_texture_alpha = false,
|
||||
walkable = true,
|
||||
groups = { snappy=3, flammable=3, oddly_breakable_by_hand=2, soil=1 },
|
||||
paramtype2 = "facedir",
|
||||
drop = {max_items = 5, items = {
|
||||
{ items = {'crops:onion'}, rarity = 1 },
|
||||
{ items = {'crops:onion'}, rarity = 1 },
|
||||
{ items = {'crops:onion'}, rarity = 1 },
|
||||
{ items = {'crops:onion'}, rarity = 2 },
|
||||
{ items = {'crops:onion'}, rarity = 5 },
|
||||
}},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
on_dig = function(pos, node, digger)
|
||||
local drops = {}
|
||||
local meta = minetest.get_meta(pos)
|
||||
local damage = meta:get_int("crops_damage")
|
||||
for i = 1, math.random(4 - (3 * damage / 100), 4 - (4 * (damage / 100))) do
|
||||
table.insert(drops, "crops:onion")
|
||||
end
|
||||
core.handle_node_drops(pos, drops, digger)
|
||||
minetest.set_node(pos, { name = "farming:soil" })
|
||||
local above = { x = pos.x, y = pos.y + 1, z = pos.z }
|
||||
if minetest.get_node(above).name == "crops:onion_plant_4" then
|
||||
minetest.set_node(above, { name = "air" })
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
--
|
||||
-- grows a plant to mature size
|
||||
--
|
||||
minetest.register_abm({
|
||||
nodenames = { "crops:onion_plant_1", "crops:onion_plant_2", "crops:onion_plant_3" },
|
||||
neighbors = { "group:soil" },
|
||||
interval = crops.settings.interval,
|
||||
chance = crops.settings.chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if not crops.can_grow(pos) then
|
||||
return
|
||||
end
|
||||
local below = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
if not minetest.registered_nodes[minetest.get_node(below).name].groups.soil then
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local damage = meta:get_int("crops_damage")
|
||||
if damage == 100 then
|
||||
crops.die(pos)
|
||||
return
|
||||
end
|
||||
local n = string.gsub(node.name, "3", "4")
|
||||
n = string.gsub(n, "2", "3")
|
||||
n = string.gsub(n, "1", "2")
|
||||
minetest.swap_node(pos, { name = n, param2 = 3 })
|
||||
end
|
||||
})
|
||||
|
||||
--
|
||||
-- grows the final onions in the soil beneath
|
||||
--
|
||||
minetest.register_abm({
|
||||
nodenames = { "crops:onion_plant_4" },
|
||||
neighbors = { "group:soil" },
|
||||
interval = crops.settings.interval,
|
||||
chance = crops.settings.chance,
|
||||
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||
if not crops.can_grow(pos) then
|
||||
return
|
||||
end
|
||||
local below = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
if not minetest.registered_nodes[minetest.get_node(below).name].groups.soil then
|
||||
return
|
||||
end
|
||||
local meta = minetest.get_meta(pos)
|
||||
local damage = meta:get_int("crops_damage")
|
||||
minetest.set_node(below, { name = "crops:soil_with_onions" })
|
||||
meta = minetest.get_meta(below)
|
||||
meta:set_int("crops_damage", damage)
|
||||
end
|
||||
})
|
||||
|
||||
crops.onion_die = function(pos)
|
||||
minetest.set_node(pos, { name = "crops:onion_plant_5", param2 = 3 })
|
||||
local below = { x = pos.x, y = pos.y - 1, z = pos.z }
|
||||
local node = minetest.get_node(below)
|
||||
if node.name == "crops:soil_with_onions" then
|
||||
local meta = minetest.get_meta(below)
|
||||
meta:set_int("crops_damage", 100)
|
||||
end
|
||||
end
|
||||
|
||||
local properties = {
|
||||
die = crops.onion_die,
|
||||
waterstart = 30,
|
||||
wateruse = 1,
|
||||
night = 5,
|
||||
soak = 80,
|
||||
soak_damage = 90,
|
||||
wither = 20,
|
||||
wither_damage = 10,
|
||||
}
|
||||
|
||||
minetest.override_item("crops:onion_plant_4", { drop = {max_items = 3, items = {
|
||||
{ items = {'crops:onion_seeds'}, rarity = 1 },
|
||||
{ items = {'crops:onion_seeds'}, rarity = 2 },
|
||||
{ items = {'crops:onion_seeds'}, rarity = 3 },
|
||||
}},
|
||||
})
|
||||
|
||||
crops.register({ name = "crops:onion_plant_1", properties = properties })
|
||||
crops.register({ name = "crops:onion_plant_2", properties = properties })
|
||||
crops.register({ name = "crops:onion_plant_3", properties = properties })
|
||||
crops.register({ name = "crops:onion_plant_4", properties = properties })
|
13
pepper.lua
13
pepper.lua
|
@ -1,14 +1,13 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2018 - Grizzly Adam
|
||||
|
||||
Based on Crops by Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
||||
--]]
|
||||
|
||||
minetest.register_node("crops:pepper_ground", {
|
||||
|
@ -47,7 +46,7 @@ minetest.register_node("crops:peppercorn", {
|
|||
walkable = false,
|
||||
paramtype = "light",
|
||||
node_placement_prediction = "crops:pepper_plant_1",
|
||||
groups = { peppercorn=1, snappy=3,flammable=3,flora=1,attached_node=1 },
|
||||
groups = { peppercorn = 1, vessel=1, snappy=3,flammable=3,flora=1,attached_node=1 },
|
||||
drop = {},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
|
||||
|
@ -158,7 +157,7 @@ minetest.register_node("crops:pepper_plant_6", {
|
|||
minetest.register_craftitem("crops:pepper", {
|
||||
description = S("Pepper"),
|
||||
inventory_image = "crops_pepper.png",
|
||||
on_use = minetest.item_eat(1),
|
||||
on_use = minetest.item_eat(2),
|
||||
groups = { pepper=1 },
|
||||
})
|
||||
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
|
BIN
screenshot.png
BIN
screenshot.png
Binary file not shown.
Before Width: | Height: | Size: 301 KiB After Width: | Height: | Size: 284 KiB |
21
tomato.lua
21
tomato.lua
|
@ -1,9 +1,9 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
@ -121,13 +121,22 @@ minetest.register_node("crops:tomato_plant_6", {
|
|||
minetest.register_craftitem("crops:tomato", {
|
||||
description = S("Tomato"),
|
||||
inventory_image = "crops_tomato.png",
|
||||
on_use = minetest.item_eat(1)
|
||||
on_use = minetest.item_eat(3)
|
||||
})
|
||||
|
||||
minetest.register_craftitem("crops:tomato_sauce", {
|
||||
description = S("Tomato Sauce"),
|
||||
inventory_image = "crops_tomato_sauce.png",
|
||||
groups = { vessel=1 },
|
||||
on_use = minetest.item_eat(2)
|
||||
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "crops:tomato_seed",
|
||||
recipe = { "crops:tomato" }
|
||||
output = "crops:tomato_sauce",
|
||||
recipe = { "group:tomato" },
|
||||
replacements = {{"group:tomato","crops:tomato_seed"}},
|
||||
})
|
||||
|
||||
--
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
|
||||
--[[
|
||||
Copyright (C) 2018 Grizzly Adam
|
||||
Copyright (C) 2015-2017 Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
Copyright (C) 2015 - Auke Kok <sofar@foo-projects.org>
|
||||
|
||||
"crops" is free software; you can redistribute it and/or modify
|
||||
"Crops Plus" is free software based on "Crops"; you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as
|
||||
published by the Free Software Foundation; either version 2.1
|
||||
of the license, or (at your option) any later version.
|
||||
|
|
Loading…
Reference in New Issue