Add potato and improve mod structure
This commit is contained in:
parent
dce00ba128
commit
66a161d59c
@ -48,3 +48,7 @@ Gambit (WTFPL):
|
|||||||
farming_flour.png
|
farming_flour.png
|
||||||
farming_cotton_seed.png
|
farming_cotton_seed.png
|
||||||
farming_wheat_seed.png
|
farming_wheat_seed.png
|
||||||
|
|
||||||
|
LNJ (CC BY-SA 3.0):
|
||||||
|
farming_potato.png
|
||||||
|
farming_potato_*.png
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
-- Global farming namespace
|
|
||||||
farming = {}
|
farming = {}
|
||||||
farming.path = minetest.get_modpath("farming")
|
farming.path = minetest.get_modpath("farming")
|
||||||
|
|
||||||
@ -6,73 +5,5 @@ farming.path = minetest.get_modpath("farming")
|
|||||||
dofile(farming.path .. "/api.lua")
|
dofile(farming.path .. "/api.lua")
|
||||||
dofile(farming.path .. "/nodes.lua")
|
dofile(farming.path .. "/nodes.lua")
|
||||||
dofile(farming.path .. "/hoes.lua")
|
dofile(farming.path .. "/hoes.lua")
|
||||||
|
dofile(farming.path .. "/plants.lua")
|
||||||
-- WHEAT
|
dofile(farming.path .. "/misc.lua")
|
||||||
farming.register_plant("farming:wheat", {
|
|
||||||
description = "Wheat seed",
|
|
||||||
inventory_image = "farming_wheat_seed.png",
|
|
||||||
steps = 8,
|
|
||||||
minlight = 13,
|
|
||||||
maxlight = default.LIGHT_MAX,
|
|
||||||
fertility = {"grassland"}
|
|
||||||
})
|
|
||||||
minetest.register_craftitem("farming:flour", {
|
|
||||||
description = "Flour",
|
|
||||||
inventory_image = "farming_flour.png",
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craftitem("farming:bread", {
|
|
||||||
description = "Bread",
|
|
||||||
inventory_image = "farming_bread.png",
|
|
||||||
on_use = minetest.item_eat(5),
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "shapeless",
|
|
||||||
output = "farming:flour",
|
|
||||||
recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
type = "cooking",
|
|
||||||
cooktime = 15,
|
|
||||||
output = "farming:bread",
|
|
||||||
recipe = "farming:flour"
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Cotton
|
|
||||||
farming.register_plant("farming:cotton", {
|
|
||||||
description = "Cotton seed",
|
|
||||||
inventory_image = "farming_cotton_seed.png",
|
|
||||||
steps = 8,
|
|
||||||
minlight = 13,
|
|
||||||
maxlight = default.LIGHT_MAX,
|
|
||||||
fertility = {"grassland", "desert"}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_alias("farming:string", "farming:cotton")
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "wool:white",
|
|
||||||
recipe = {
|
|
||||||
{"farming:cotton", "farming:cotton"},
|
|
||||||
{"farming:cotton", "farming:cotton"},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Straw
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "farming:straw 3",
|
|
||||||
recipe = {
|
|
||||||
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
|
||||||
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
|
||||||
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
minetest.register_craft({
|
|
||||||
output = "farming:wheat 3",
|
|
||||||
recipe = {
|
|
||||||
{"farming:straw"},
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
55
mods/farming/misc.lua
Normal file
55
mods/farming/misc.lua
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
minetest.register_craftitem("farming:flour", {
|
||||||
|
description = "Flour",
|
||||||
|
inventory_image = "farming_flour.png",
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("farming:bread", {
|
||||||
|
description = "Bread",
|
||||||
|
inventory_image = "farming_bread.png",
|
||||||
|
on_use = minetest.item_eat(5),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_alias("farming:string", "farming:cotton")
|
||||||
|
|
||||||
|
|
||||||
|
-- Crafting recipes
|
||||||
|
|
||||||
|
-- Bread
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "farming:flour",
|
||||||
|
recipe = {"farming:wheat", "farming:wheat", "farming:wheat", "farming:wheat"}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "cooking",
|
||||||
|
cooktime = 15,
|
||||||
|
output = "farming:bread",
|
||||||
|
recipe = "farming:flour"
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Wool
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "wool:white",
|
||||||
|
recipe = {
|
||||||
|
{"farming:cotton", "farming:cotton"},
|
||||||
|
{"farming:cotton", "farming:cotton"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Straw
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:straw 3",
|
||||||
|
recipe = {
|
||||||
|
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
||||||
|
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
||||||
|
{"farming:wheat", "farming:wheat", "farming:wheat"},
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
output = "farming:wheat 3",
|
||||||
|
recipe = {
|
||||||
|
{"farming:straw"},
|
||||||
|
}
|
||||||
|
})
|
31
mods/farming/plants.lua
Normal file
31
mods/farming/plants.lua
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
-- Wheat
|
||||||
|
farming.register_plant("farming:wheat", {
|
||||||
|
description = "Wheat seed",
|
||||||
|
inventory_image = "farming_wheat_seed.png",
|
||||||
|
steps = 8,
|
||||||
|
minlight = 13,
|
||||||
|
maxlight = default.LIGHT_MAX,
|
||||||
|
fertility = {"grassland"}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Cotton
|
||||||
|
farming.register_plant("farming:cotton", {
|
||||||
|
description = "Cotton seed",
|
||||||
|
inventory_image = "farming_cotton_seed.png",
|
||||||
|
steps = 8,
|
||||||
|
minlight = 13,
|
||||||
|
maxlight = default.LIGHT_MAX,
|
||||||
|
fertility = {"grassland", "desert"}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Potato
|
||||||
|
farming.register_plant("farming:potato", {
|
||||||
|
description = "Potato",
|
||||||
|
inventory_image = "farming_potato.png",
|
||||||
|
steps = 3,
|
||||||
|
has_seed = false,
|
||||||
|
minlight = 13,
|
||||||
|
maxlight = default.LIGHT_MAX,
|
||||||
|
fertility = {"grassland"},
|
||||||
|
on_use = minetest.item_eat(1)
|
||||||
|
})
|
BIN
mods/farming/textures/farming_potato.png
Normal file
BIN
mods/farming/textures/farming_potato.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 502 B |
BIN
mods/farming/textures/farming_potato_1.png
Normal file
BIN
mods/farming/textures/farming_potato_1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 209 B |
BIN
mods/farming/textures/farming_potato_2.png
Normal file
BIN
mods/farming/textures/farming_potato_2.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 262 B |
BIN
mods/farming/textures/farming_potato_3.png
Normal file
BIN
mods/farming/textures/farming_potato_3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 415 B |
Loading…
x
Reference in New Issue
Block a user