Merge branch 'master' of https://github.com/acmgit/aqua_farming
This commit is contained in:
commit
18c7128021
4
alga.lua
4
alga.lua
@ -19,7 +19,7 @@ local def = {
|
||||
{items = {name .. "_item 1"}},
|
||||
{items = {name .. "_seed 2"}},
|
||||
{items = {name .. "_item 2", rarity = 10}},
|
||||
|
||||
|
||||
},-- items
|
||||
}, -- drop
|
||||
|
||||
@ -39,7 +39,7 @@ dofile(aqua_farming.modpath .. "/mapgen_" .. name:split(":")[2] .. ".lua")
|
||||
if(signs_bot) then
|
||||
local fs = signs_bot.register_farming_seed
|
||||
local fc = signs_bot.register_farming_crop
|
||||
|
||||
|
||||
fs(name .. "_seed", name .. "_1")
|
||||
fc(name .. "_" .. step, name .. "_item", name .. "_seed")
|
||||
|
||||
|
5
init.lua
5
init.lua
@ -34,7 +34,8 @@ aqua_farming.S = S
|
||||
|
||||
minetest.register_node("aqua_farming:water_soil", {
|
||||
description = S("Water Soil"),
|
||||
tiles = {minetest.registered_nodes["default:silver_sand"].tiles[1] .. "^aqua_farming_water_soil.png", minetest.registered_nodes["default:silver_sand"].tiles[1]},
|
||||
tiles = {minetest.registered_nodes["default:silver_sand"].tiles[1] .. "^aqua_farming_water_soil.png",
|
||||
minetest.registered_nodes["default:silver_sand"].tiles[1]},
|
||||
drop = "default:silver_sand",
|
||||
groups = {crumbly = 3, falling_node = 1, sand = 1},
|
||||
sounds = default.node_sound_sand_defaults(),
|
||||
@ -47,7 +48,7 @@ minetest.register_craft({
|
||||
},
|
||||
})
|
||||
|
||||
aqua_farming.plants = {
|
||||
aqua_farming.plants = {
|
||||
"alga",
|
||||
"sea_strawberry",
|
||||
"sea_grass",
|
||||
|
29
lib.lua
29
lib.lua
@ -68,19 +68,19 @@ end -- function aqua_farming.register_abm
|
||||
|
||||
function aqua_farming.plant_seed(node_def, pointed_thing)
|
||||
if(pointed_thing.type == "node") then
|
||||
local node = minetest.get_node(minetest.get_pointed_thing_position(pointed_thing, under))
|
||||
local node = minetest.get_node(minetest.get_pointed_thing_position(pointed_thing, false)) -- pointed_thing.under
|
||||
if(node.name == "aqua_farming:water_soil") then
|
||||
minetest.set_node(pointed_thing.under, {name = node_def.nodename .. "_seed"})
|
||||
return true
|
||||
end -- if(node.name
|
||||
|
||||
|
||||
return false
|
||||
|
||||
|
||||
end -- if(pointed_thing.type
|
||||
|
||||
end
|
||||
|
||||
function aqua_farming.register_plant(node_def)
|
||||
function aqua_farming.register_plant(node_def)
|
||||
|
||||
local modname = node_def.nodename:split(":")[1]
|
||||
local nodename = node_def.nodename:split(":")[2]
|
||||
@ -114,21 +114,21 @@ function aqua_farming.register_plant(node_def)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_int("lightlevel", min_light)
|
||||
end,
|
||||
|
||||
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if(aqua_farming.plant_seed(node_def, pointed_thing)) then
|
||||
itemstack:take_item()
|
||||
return itemstack
|
||||
end
|
||||
|
||||
|
||||
return itemstack
|
||||
end,
|
||||
|
||||
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
minetest.set_node(pos, {name = "aqua_farming:water_soil"})
|
||||
|
||||
|
||||
end, -- function
|
||||
|
||||
|
||||
})
|
||||
|
||||
local abm_name, next_abm
|
||||
@ -148,7 +148,8 @@ function aqua_farming.register_plant(node_def)
|
||||
{name = modname .. "_" .. nodename .. "_" .. step .. ".png",
|
||||
tileable_vertical = false},
|
||||
},
|
||||
groups = {not_in_creative_inventory=1, snappy = 3, growing = 1, attached_node = 1, plant = 1, dig_immediate = 1},
|
||||
groups = {not_in_creative_inventory=1, snappy = 3, growing = 1,
|
||||
attached_node = 1, plant = 1, dig_immediate = 1},
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
drop = {},
|
||||
selection_box = {
|
||||
@ -168,7 +169,7 @@ function aqua_farming.register_plant(node_def)
|
||||
aqua_farming.register_abm(abm_name, next_abm, node_def.delay, node_def.chance)
|
||||
|
||||
end -- for step
|
||||
|
||||
|
||||
-- Last Plantnode
|
||||
minetest.register_node(":" .. modname .. ":" .. nodename .. "_" .. node_def.steps,{
|
||||
description = node_def.description .. "_" .. node_def.steps,
|
||||
@ -192,10 +193,10 @@ function aqua_farming.register_plant(node_def)
|
||||
},
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
minetest.set_node(pos, {name = "aqua_farming:water_soil"})
|
||||
|
||||
|
||||
end, -- function
|
||||
})
|
||||
|
||||
|
||||
-- Wild Plantnode
|
||||
minetest.register_node(":" .. modname .. ":" .. nodename .. "_wild",{
|
||||
description = S("Wild") .. " " .. node_def.description,
|
||||
@ -219,7 +220,7 @@ function aqua_farming.register_plant(node_def)
|
||||
},
|
||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||
minetest.set_node(pos, {name = node_def.basenode})
|
||||
|
||||
|
||||
end, -- function
|
||||
})
|
||||
|
||||
|
@ -41,7 +41,7 @@ dofile(aqua_farming.modpath .. "/mapgen_" .. name:split(":")[2] .. ".lua")
|
||||
if(signs_bot) then
|
||||
local fs = signs_bot.register_farming_seed
|
||||
local fc = signs_bot.register_farming_crop
|
||||
|
||||
|
||||
fs(name .. "_seed", name .. "_1")
|
||||
fc(name .. "_" .. step, name .. "_item", name .. "_seed")
|
||||
|
||||
|
@ -37,7 +37,7 @@ dofile(aqua_farming.modpath .. "/mapgen_" .. name:split(":")[2] .. ".lua")
|
||||
if(signs_bot) then
|
||||
local fs = signs_bot.register_farming_seed
|
||||
local fc = signs_bot.register_farming_crop
|
||||
|
||||
|
||||
fs(name .. "_seed", name .. "_1")
|
||||
fc(name .. "_" .. step, name .. "_item", name .. "_seed")
|
||||
|
||||
|
@ -44,7 +44,7 @@ minetest.register_craftitem("aqua_farming:salt", {
|
||||
groups = {food = 1, food_vegan = 1, food_salt = 1},
|
||||
inventory_image = "aqua_farming_salt.png",
|
||||
})
|
||||
|
||||
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
cooktime = 10,
|
||||
@ -64,7 +64,7 @@ dofile(aqua_farming.modpath .. "/mapgen_" .. name:split(":")[2] .. ".lua")
|
||||
if(signs_bot) then
|
||||
local fs = signs_bot.register_farming_seed
|
||||
local fc = signs_bot.register_farming_crop
|
||||
|
||||
|
||||
fs(name .. "_seed", name .. "_1")
|
||||
fc(name .. "_" .. step, name .. "_item", name .. "_seed")
|
||||
|
||||
|
@ -37,7 +37,7 @@ dofile(aqua_farming.modpath .. "/mapgen_" .. name:split(":")[2] .. ".lua")
|
||||
if(signs_bot) then
|
||||
local fs = signs_bot.register_farming_seed
|
||||
local fc = signs_bot.register_farming_crop
|
||||
|
||||
|
||||
fs(name .. "_seed", name .. "_1")
|
||||
fc(name .. "_" .. step, name .. "_item", name .. "_seed")
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
local af_items = {
|
||||
-- Name Saturation Replace with Poison Heal Sound
|
||||
-- Name Saturation Replace with Poison Heal Sound
|
||||
-- crops
|
||||
{'aqua_farming:alga_items', 1, nil, nil, nil, nil},
|
||||
{'aqua_farming:sea_strawberry_item', 3, nil, nil, nil, nil},
|
||||
{'aqua_farming:sea_anemone_item', 3, nil, nil, 1, nil},
|
||||
{'aqua_farming:sea_cucumber_item', 4, nil, nil, nil, nil},
|
||||
{'aqua_farming:sea_strawberry_cake_piece', 4, nil, nil, nil, nil},
|
||||
|
||||
{'aqua_farming:alga_items', 1, nil, nil, nil, nil},
|
||||
{'aqua_farming:sea_strawberry_item', 3, nil, nil, nil, nil},
|
||||
{'aqua_farming:sea_anemone_item', 3, nil, nil, 1, nil},
|
||||
{'aqua_farming:sea_cucumber_item', 4, nil, nil, nil, nil},
|
||||
{'aqua_farming:sea_strawberry_cake_piece', 4, nil, nil, nil, nil},
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
-- *******************************************
|
||||
-- ***** Hunger-Support *****
|
||||
|
Loading…
x
Reference in New Issue
Block a user