added food groups to make items more compatible with other mods

This commit is contained in:
TenPlus1 2018-03-12 16:45:15 +00:00
parent bb208f8d5b
commit 77198100f3
24 changed files with 44 additions and 15 deletions

View File

@ -13,7 +13,7 @@ This mod works by adding your new plant to the {growing=1} group and numbering t
Changelog:
1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water
1.31 - Added Pineapple which can be found growing in savannah areas (place pineapple in crafting to obtain 5x rings to eat and a top for re-planting), also Salt which is made from cooking a bucket of water, added food groups so it's more compatible with Ruben's food mods.
1.30 - Added Garlic, Pepper and Onions thanks to Grizzly Adam for sharing textures
1.29 - Updating functions so requires Minetest 0.4.16 and above to run
1.28 - Added chili peppers and bowl of chili, optimized code and fixed a few bugs, added porridge

View File

@ -23,6 +23,7 @@ minetest.register_node("farming:seed_barley", {
minetest.register_craftitem("farming:barley", {
description = S("Barley"),
inventory_image = "farming_barley.png",
groups = {food_barley = 1, flammable = 2},
})
-- flour

View File

@ -64,6 +64,7 @@ end
minetest.register_craftitem("farming:beans", {
description = S("Green Beans"),
inventory_image = "farming_beans.png",
groups = {food_beans = 1, flammable = 2},
on_use = minetest.item_eat(1),
on_place = function(itemstack, placer, pointed_thing)

View File

@ -5,6 +5,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:blueberries", {
description = S("Blueberries"),
inventory_image = "farming_blueberries.png",
groups = {food_blueberries = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:blueberry_1")
end,

View File

@ -10,6 +10,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:carrot", {
description = S("Carrot"),
inventory_image = "farming_carrot.png",
groups = {food_carrot = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:carrot_1")
end,

View File

@ -5,6 +5,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:chili_pepper", {
description = S("Chili Pepper"),
inventory_image = "farming_chili_pepper.png",
groups = {food_chili_pepper = 1, flammable = 4},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:chili_1")
end,

View File

@ -59,6 +59,7 @@ end
minetest.register_craftitem("farming:cocoa_beans", {
description = S("Cocoa Beans"),
inventory_image = "farming_cocoa_beans.png",
groups = {food_cocoa_beans = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return place_cocoa(itemstack, placer, pointed_thing, "farming:cocoa_1")
end,

View File

@ -5,6 +5,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:coffee_beans", {
description = S("Coffee Beans"),
inventory_image = "farming_coffee_beans.png",
groups = {food_coffee_beans = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:coffee_1")
end,

View File

@ -20,7 +20,7 @@ else
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0.2, 0.2}
},
groups = {fleshy = 3, dig_immediate = 3, flammable = 2},
groups = {food_banana = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
on_use = minetest.item_eat(2),
sounds = default.node_sound_leaves_defaults(),
})
@ -68,7 +68,7 @@ else
type = "fixed",
fixed = {-0.2, -0.3, -0.2, 0.2, 0.2, 0.2}
},
groups = {fleshy = 3, dig_immediate = 3, flammable = 2},
groups = {food_orange = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
on_use = minetest.item_eat(4),
sounds = default.node_sound_leaves_defaults(),
})
@ -118,6 +118,7 @@ else
description = "Strawberry",
inventory_image = "strawberry.png",
wield_image = "strawberry.png",
groups = {food_strawberry = 1, flammable = 2},
on_use = minetest.item_eat(1),
})

View File

@ -10,6 +10,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:corn", {
description = S("Corn"),
inventory_image = "farming_corn.png",
groups = {food_corn = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:corn_1")
end,

View File

@ -10,6 +10,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:cucumber", {
description = S("Cucumber"),
inventory_image = "farming_cucumber.png",
groups = {food_cucumber = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:cucumber_1")
end,

View File

@ -11,6 +11,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:garlic_clove", {
description = S("Garlic clove"),
inventory_image = "crops_garlic_clove.png",
groups = {food_garlic_clove = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:garlic_1")
end,
@ -21,7 +22,7 @@ minetest.register_craftitem("farming:garlic", {
description = S("Garlic"),
inventory_image = "crops_garlic.png",
on_use = minetest.item_eat(1),
groups = {garlic = 1},
groups = {food_garlic = 1, garlic = 1, flammable = 3},
})
minetest.register_craft({
@ -52,7 +53,7 @@ minetest.register_node("farming:garlic_braid", {
"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},
groups = {vessel = 1, dig_immediate = 3, flammable = 3},
sounds = default.node_sound_leaves_defaults(),
node_box = {
type = "fixed",

View File

@ -60,6 +60,7 @@ minetest.register_craftitem("farming:grapes", {
description = S("Grapes"),
inventory_image = "farming_grapes.png",
on_use = minetest.item_eat(2),
groups = {food_grapes = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return place_grapes(itemstack, placer, pointed_thing, "farming:grapes_1")

View File

@ -5,6 +5,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:melon_slice", {
description = S("Melon Slice"),
inventory_image = "farming_melon_slice.png",
groups = {food_melon_slice = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:melon_1")
end,
@ -77,6 +78,9 @@ 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.groups = {
food_melon = 1, 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))

View File

@ -11,6 +11,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:onion", {
description = S("Onion"),
inventory_image = "crops_onion.png",
groups = {food_onion = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:onion_1")
end,
@ -59,7 +60,7 @@ crop_def.drop = {
max_items = 5, items = {
{items = {'farming:onion'}, rarity = 1},
{items = {'farming:onion'}, rarity = 1},
{items = {'farming:onion'}, rarity = 1},
{items = {'farming:onion'}, rarity = 2},
{items = {'farming:onion'}, rarity = 2},
{items = {'farming:onion'}, rarity = 5},
}

View File

@ -11,6 +11,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:peppercorn", {
description = S("Peppercorn"),
inventory_image = "crops_peppercorn.png",
groups = {food_peppercorn = 1, flammable = 3},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pepper_1")
end,
@ -21,7 +22,7 @@ minetest.register_craftitem("farming:pepper", {
description = S("Pepper"),
inventory_image = "crops_pepper.png",
on_use = minetest.item_eat(2),
groups = {pepper = 1},
groups = {food_pepper = 1, pepper = 1, flammable = 3},
})
minetest.register_craft({
@ -38,7 +39,10 @@ minetest.register_node("farming:pepper_ground", {
drawtype = "plantlike",
paramtype = "light",
tiles = {"crops_pepper_ground.png"},
groups = {vessel = 1, pepper_ground = 1, dig_immediate = 3, attached_node = 1},
groups = {
vessel = 1, food_pepper_ground = 1, pepper_ground = 1,
dig_immediate = 3, attached_node = 1
},
sounds = default.node_sound_glass_defaults(),
selection_box = {
type = "fixed",

View File

@ -24,13 +24,14 @@ minetest.register_node("farming:pineapple", {
type = "fixed",
fixed = {-0.27, -0.37, -0.27, 0.27, 0.44, 0.27}
},
groups = {fleshy = 3, dig_immediate = 3, flammable = 2},
groups = {food_pineapple = 1, fleshy = 3, dig_immediate = 3, flammable = 2},
})
-- pineapple
minetest.register_craftitem("farming:pineapple_ring", {
description = S("Pineapple Ring"),
inventory_image = "farming_pineapple_ring.png",
groups = {food_pineapple_ring = 1, flammable = 2},
on_use = minetest.item_eat(1),
})

View File

@ -10,6 +10,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:potato", {
description = S("Potato"),
inventory_image = "farming_potato.png",
groups = {food_potato = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:potato_1")
end,

View File

@ -14,7 +14,7 @@ minetest.register_node("farming:pumpkin", {
"farming_pumpkin_side.png"
},
groups = {
choppy = 1, oddly_breakable_by_hand = 1,
food_pumpkin = 1, choppy = 1, oddly_breakable_by_hand = 1,
flammable = 2, plant = 1
},
drop = {
@ -29,6 +29,7 @@ minetest.register_node("farming:pumpkin", {
minetest.register_craftitem("farming:pumpkin_slice", {
description = S("Pumpkin Slice"),
inventory_image = "farming_pumpkin_slice.png",
groups = {food_pumpkin_slice = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:pumpkin_1")
end,

View File

@ -5,6 +5,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:raspberries", {
description = S("Raspberries"),
inventory_image = "farming_raspberries.png",
groups = {food_raspberries = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:raspberry_1")
end,

View File

@ -5,6 +5,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:rhubarb", {
description = S("Rhubarb"),
inventory_image = "farming_rhubarb.png",
groups = {food_rhubarb = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:rhubarb_1")
end,

View File

@ -6,6 +6,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:sugar", {
description = S("Sugar"),
inventory_image = "farming_sugar.png",
groups = {food_sugar = 1, flammable = 3},
})
minetest.register_craft({
@ -25,7 +26,8 @@ minetest.register_node("farming:salt", {
drawtype = "plantlike",
paramtype = "light",
tiles = {"farming_salt.png"},
groups = {vessel = 1, salt = 1, dig_immediate = 3, attached_node = 1},
groups = {food_salt = 1, salt = 1, vessel = 1, dig_immediate = 3,
attached_node = 1},
sounds = default.node_sound_glass_defaults(),
selection_box = {
type = "fixed",

View File

@ -10,6 +10,7 @@ local S = farming.intllib
minetest.register_craftitem("farming:tomato", {
description = S("Tomato"),
inventory_image = "farming_tomato.png",
groups = {food_tomato = 1, flammable = 2},
on_place = function(itemstack, placer, pointed_thing)
return farming.place_seed(itemstack, placer, pointed_thing, "farming:tomato_1")
end,

View File

@ -23,7 +23,7 @@ minetest.register_node("farming:seed_wheat", {
minetest.register_craftitem("farming:wheat", {
description = S("Wheat"),
inventory_image = "farming_wheat.png",
groups = {flammable = 4},
groups = {food_wheat = 1, flammable = 4},
})
-- straw
@ -55,7 +55,7 @@ minetest.register_craft({
minetest.register_craftitem("farming:flour", {
description = S("Flour"),
inventory_image = "farming_flour.png",
groups = {flammable = 1},
groups = {food_flour = 1, flammable = 1},
})
minetest.register_craft({
@ -69,7 +69,7 @@ minetest.register_craftitem("farming:bread", {
description = S("Bread"),
inventory_image = "farming_bread.png",
on_use = minetest.item_eat(5),
groups = {flammable = 2},
groups = {food_bread = 1, flammable = 2},
})
minetest.register_craft({