updated farming mod
This commit is contained in:
parent
1c892686c7
commit
cbb519ad0d
@ -48,6 +48,7 @@ farming.register_plant("wheat", 5, {
|
|||||||
minetest.override_item("default:plant_grass", {drop = {
|
minetest.override_item("default:plant_grass", {drop = {
|
||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
@ -57,6 +58,7 @@ minetest.override_item("default:plant_grass_2", {drop = {
|
|||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
@ -65,6 +67,7 @@ minetest.override_item("default:plant_grass_3", {drop = {
|
|||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
@ -73,6 +76,7 @@ minetest.override_item("default:plant_grass_4", {drop = {
|
|||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
@ -81,10 +85,36 @@ minetest.override_item("default:plant_grass_5", {drop = {
|
|||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
-- other plants
|
||||||
|
|
||||||
|
minetest.register_node("farming:sugarcane", {
|
||||||
|
description = "Sugarcane",
|
||||||
|
tiles = {"farming_sugarcane.png"},
|
||||||
|
drawtype = "plantlike",
|
||||||
|
paramtype = "light",
|
||||||
|
inventory_image = "farming_sugarcane.png",
|
||||||
|
groups = {crumbly=3, falling_node=1},
|
||||||
|
walkable = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"farming:sugarcane"},
|
||||||
|
neighbors = {"default:dirt", "default:grass"},
|
||||||
|
interval = 10.0,
|
||||||
|
chance = 5,
|
||||||
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
minetest.set_node(pos, {name = "farming:sugarcane"})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- items
|
||||||
|
|
||||||
minetest.register_craftitem("farming:flour", {
|
minetest.register_craftitem("farming:flour", {
|
||||||
description = "Flour",
|
description = "Flour",
|
||||||
inventory_image = "farming_flour.png",
|
inventory_image = "farming_flour.png",
|
||||||
@ -119,17 +149,37 @@ minetest.register_craftitem("farming:bowl_with_water", {
|
|||||||
minetest.register_craftitem("farming:slice_of_bread", {
|
minetest.register_craftitem("farming:slice_of_bread", {
|
||||||
description = "Slice of Bread",
|
description = "Slice of Bread",
|
||||||
inventory_image = "farming_slice_of_bread.png",
|
inventory_image = "farming_slice_of_bread.png",
|
||||||
|
on_use = minetest.item_eat(4),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("farming:cookie", {
|
||||||
|
description = "Cookie",
|
||||||
|
inventory_image = "farming_cookie.png",
|
||||||
on_use = minetest.item_eat(5),
|
on_use = minetest.item_eat(5),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "farming:flour",
|
output = "farming:flour",
|
||||||
recipe = {"farming:wheat_seeds", "farming:wheat_seeds", "farming:wheat_seeds"}
|
recipe = {"farming:wheat_seeds", "farming:wheat_seeds", "farming:wheat_seeds"}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "farming:cookie 5",
|
||||||
|
recipe = {"farming:sugar", "farming:flour", "farming:bowl_with_water"}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "farming:sugar 3",
|
||||||
|
recipe = {"farming:sugarcane"}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "farming:bowl",
|
output = "farming:bowl",
|
||||||
recipe = {
|
recipe = {
|
||||||
|
@ -48,6 +48,7 @@ farming.register_plant("wheat", 5, {
|
|||||||
minetest.override_item("default:plant_grass", {drop = {
|
minetest.override_item("default:plant_grass", {drop = {
|
||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
@ -57,6 +58,7 @@ minetest.override_item("default:plant_grass_2", {drop = {
|
|||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
@ -65,6 +67,7 @@ minetest.override_item("default:plant_grass_3", {drop = {
|
|||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
@ -73,6 +76,7 @@ minetest.override_item("default:plant_grass_4", {drop = {
|
|||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
@ -81,10 +85,36 @@ minetest.override_item("default:plant_grass_5", {drop = {
|
|||||||
max_items = 1,
|
max_items = 1,
|
||||||
items = {
|
items = {
|
||||||
{items = {'farming:wheat_seeds'},rarity = 5},
|
{items = {'farming:wheat_seeds'},rarity = 5},
|
||||||
|
{items = {'farming:sugarcane'},rarity = 20},
|
||||||
{items = {'default:plant_grass'}},
|
{items = {'default:plant_grass'}},
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
-- other plants
|
||||||
|
|
||||||
|
minetest.register_node("farming:sugarcane", {
|
||||||
|
description = "Sugarcane",
|
||||||
|
tiles = {"farming_sugarcane.png"},
|
||||||
|
drawtype = "plantlike",
|
||||||
|
paramtype = "light",
|
||||||
|
inventory_image = "farming_sugarcane.png",
|
||||||
|
groups = {crumbly=3, falling_node=1},
|
||||||
|
walkable = false,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_abm({
|
||||||
|
nodenames = {"farming:sugarcane"},
|
||||||
|
neighbors = {"default:dirt", "default:grass"},
|
||||||
|
interval = 10.0,
|
||||||
|
chance = 5,
|
||||||
|
action = function(pos, node, active_object_count, active_object_count_wider)
|
||||||
|
pos.y = pos.y + 1
|
||||||
|
minetest.set_node(pos, {name = "farming:sugarcane"})
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- items
|
||||||
|
|
||||||
minetest.register_craftitem("farming:flour", {
|
minetest.register_craftitem("farming:flour", {
|
||||||
description = "Flour",
|
description = "Flour",
|
||||||
inventory_image = "farming_flour.png",
|
inventory_image = "farming_flour.png",
|
||||||
@ -119,17 +149,37 @@ minetest.register_craftitem("farming:bowl_with_water", {
|
|||||||
minetest.register_craftitem("farming:slice_of_bread", {
|
minetest.register_craftitem("farming:slice_of_bread", {
|
||||||
description = "Slice of Bread",
|
description = "Slice of Bread",
|
||||||
inventory_image = "farming_slice_of_bread.png",
|
inventory_image = "farming_slice_of_bread.png",
|
||||||
|
on_use = minetest.item_eat(4),
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("farming:cookie", {
|
||||||
|
description = "Cookie",
|
||||||
|
inventory_image = "farming_cookie.png",
|
||||||
on_use = minetest.item_eat(5),
|
on_use = minetest.item_eat(5),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "shapeless",
|
type = "shapeless",
|
||||||
output = "farming:flour",
|
output = "farming:flour",
|
||||||
recipe = {"farming:wheat_seeds", "farming:wheat_seeds", "farming:wheat_seeds"}
|
recipe = {"farming:wheat_seeds", "farming:wheat_seeds", "farming:wheat_seeds"}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "farming:cookie 5",
|
||||||
|
recipe = {"farming:sugar", "farming:flour", "farming:bowl_with_water"}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "farming:sugar 3",
|
||||||
|
recipe = {"farming:sugarcane"}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "farming:bowl",
|
output = "farming:bowl",
|
||||||
recipe = {
|
recipe = {
|
||||||
|
BIN
mods/farming/textures/farming_cookie.png
Normal file
BIN
mods/farming/textures/farming_cookie.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 416 B |
BIN
mods/farming/textures/farming_sugarcane.png
Normal file
BIN
mods/farming/textures/farming_sugarcane.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 407 B |
@ -39,6 +39,9 @@ function quests.add_quest(player, quest)
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_dignode(function(pos, oldnode, digger)
|
minetest.register_on_dignode(function(pos, oldnode, digger)
|
||||||
|
if not digger or not digger:is_player() then
|
||||||
|
return
|
||||||
|
end
|
||||||
if not quests.player_quests[digger:get_player_name()] then
|
if not quests.player_quests[digger:get_player_name()] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -54,6 +57,9 @@ minetest.register_on_dignode(function(pos, oldnode, digger)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
|
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
|
||||||
|
if not placer or not placer:is_player() then
|
||||||
|
return
|
||||||
|
end
|
||||||
if not quests.player_quests[placer:get_player_name()] then
|
if not quests.player_quests[placer:get_player_name()] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -17,7 +17,7 @@ function quests.load_quests()
|
|||||||
end
|
end
|
||||||
io.close(input)
|
io.close(input)
|
||||||
else
|
else
|
||||||
print("[ERROR] couldnt find story file")
|
print("[ERROR] couldnt find quest file")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -39,6 +39,9 @@ function quests.add_quest(player, quest)
|
|||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_on_dignode(function(pos, oldnode, digger)
|
minetest.register_on_dignode(function(pos, oldnode, digger)
|
||||||
|
if not digger or not digger:is_player() then
|
||||||
|
return
|
||||||
|
end
|
||||||
if not quests.player_quests[digger:get_player_name()] then
|
if not quests.player_quests[digger:get_player_name()] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@ -54,6 +57,9 @@ minetest.register_on_dignode(function(pos, oldnode, digger)
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
|
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
|
||||||
|
if not placer or not placer:is_player() then
|
||||||
|
return
|
||||||
|
end
|
||||||
if not quests.player_quests[placer:get_player_name()] then
|
if not quests.player_quests[placer:get_player_name()] then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user