diff --git a/mods/CORE/voxelibre/init.lua b/mods/CORE/voxelibre/init.lua index 2963561a0..8fb876201 100644 --- a/mods/CORE/voxelibre/init.lua +++ b/mods/CORE/voxelibre/init.lua @@ -76,10 +76,10 @@ local function set_groups(definitions) end end -local function set_images(mod_name, identifier, definitions) +local function set_images(mod_name, identifier, definitions, is_item) local base_image_name = mod_name.."_"..identifier..".png" - if definitions.drawtype and definitions.drawtype:find("plantlike") then + if (definitions.drawtype and definitions.drawtype:find("plantlike")) or is_item then if not definitions.inventory_image then definitions.inventory_image = base_image_name end @@ -142,8 +142,25 @@ function voxelibre.register_block(identifier, definitions) set_description(mod_name, identifier, definitions) set_groups(definitions) - set_images(mod_name, identifier, definitions) + set_images(mod_name, identifier, definitions, false) set_tiles(mod_name, identifier, definitions) minetest.register_node(":blocks:"..identifier, definitions) end + +function voxelibre.register_item(identifier, definitions) + local mod_name = minetest.get_current_modname() + + if not mod_name then + return + end + + if not definitions.stack_max then + definitions.stack_max = 64 + end + + set_description(mod_name, identifier, definitions) + set_images(mod_name, identifier, definitions, true) + + minetest.register_craftitem(":items:"..identifier, definitions) +end diff --git a/mods/ITEMS/food/init.lua b/mods/ITEMS/food/init.lua new file mode 100644 index 000000000..e4096c162 --- /dev/null +++ b/mods/ITEMS/food/init.lua @@ -0,0 +1 @@ +voxelibre.load_mod_files() diff --git a/mods/ITEMS/food/mod.conf b/mods/ITEMS/food/mod.conf new file mode 100644 index 000000000..65a360cb3 --- /dev/null +++ b/mods/ITEMS/food/mod.conf @@ -0,0 +1,2 @@ +name = food +depends = voxelibre diff --git a/mods/ITEMS/food/natural.lua b/mods/ITEMS/food/natural.lua new file mode 100644 index 000000000..95f7d1a95 --- /dev/null +++ b/mods/ITEMS/food/natural.lua @@ -0,0 +1,17 @@ +local items = { + ["apple"] = {}, + ["baked_potato"] = {}, + ["beetroot"] = {}, + ["carrot"] = {}, + ["chorus_fruit"] = {}, + ["glow_berries"] = {}, + ["melon_slice"] = {}, + ["sweet_berries"] = {}, + ["poisonous_potato"] = {}, + ["potato"] = {}, + ["spider_eye"] = {} +} + +for identifier, definitions in pairs(items) do + voxelibre.register_item(identifier, definitions) +end diff --git a/textures/food/food_apple.png b/textures/food/food_apple.png new file mode 100644 index 000000000..138c5cc54 Binary files /dev/null and b/textures/food/food_apple.png differ diff --git a/textures/food/food_baked_potato.png b/textures/food/food_baked_potato.png new file mode 100644 index 000000000..3ba5ff74d Binary files /dev/null and b/textures/food/food_baked_potato.png differ diff --git a/textures/food/food_beef.png b/textures/food/food_beef.png new file mode 100644 index 000000000..34eb5b7bd Binary files /dev/null and b/textures/food/food_beef.png differ diff --git a/textures/food/food_beetroot.png b/textures/food/food_beetroot.png new file mode 100644 index 000000000..59ef653bb Binary files /dev/null and b/textures/food/food_beetroot.png differ diff --git a/textures/food/food_beetroot_soup.png b/textures/food/food_beetroot_soup.png new file mode 100644 index 000000000..96d4a0bb2 Binary files /dev/null and b/textures/food/food_beetroot_soup.png differ diff --git a/textures/food/food_bread.png b/textures/food/food_bread.png new file mode 100644 index 000000000..55ddd60c9 Binary files /dev/null and b/textures/food/food_bread.png differ diff --git a/textures/food/food_carrot.png b/textures/food/food_carrot.png new file mode 100644 index 000000000..1c66c2d9a Binary files /dev/null and b/textures/food/food_carrot.png differ diff --git a/textures/food/food_chicken.png b/textures/food/food_chicken.png new file mode 100644 index 000000000..b8317a538 Binary files /dev/null and b/textures/food/food_chicken.png differ diff --git a/textures/food/food_chorus_fruit.png b/textures/food/food_chorus_fruit.png new file mode 100644 index 000000000..ef7d50d02 Binary files /dev/null and b/textures/food/food_chorus_fruit.png differ diff --git a/textures/food/food_cod.png b/textures/food/food_cod.png new file mode 100644 index 000000000..be17046a5 Binary files /dev/null and b/textures/food/food_cod.png differ diff --git a/textures/food/food_cooked_beef.png b/textures/food/food_cooked_beef.png new file mode 100644 index 000000000..1e79b326b Binary files /dev/null and b/textures/food/food_cooked_beef.png differ diff --git a/textures/food/food_cooked_chicken.png b/textures/food/food_cooked_chicken.png new file mode 100644 index 000000000..33c4c624e Binary files /dev/null and b/textures/food/food_cooked_chicken.png differ diff --git a/textures/food/food_cooked_cod.png b/textures/food/food_cooked_cod.png new file mode 100644 index 000000000..9307a892a Binary files /dev/null and b/textures/food/food_cooked_cod.png differ diff --git a/textures/food/food_cooked_mutton.png b/textures/food/food_cooked_mutton.png new file mode 100644 index 000000000..cde727be4 Binary files /dev/null and b/textures/food/food_cooked_mutton.png differ diff --git a/textures/food/food_cooked_porkchop.png b/textures/food/food_cooked_porkchop.png new file mode 100644 index 000000000..dbd02c541 Binary files /dev/null and b/textures/food/food_cooked_porkchop.png differ diff --git a/textures/food/food_cooked_rabbit.png b/textures/food/food_cooked_rabbit.png new file mode 100644 index 000000000..ea8bf9ab8 Binary files /dev/null and b/textures/food/food_cooked_rabbit.png differ diff --git a/textures/food/food_cooked_salmon.png b/textures/food/food_cooked_salmon.png new file mode 100644 index 000000000..9c1ce5a35 Binary files /dev/null and b/textures/food/food_cooked_salmon.png differ diff --git a/textures/food/food_cookie.png b/textures/food/food_cookie.png new file mode 100644 index 000000000..156fe540b Binary files /dev/null and b/textures/food/food_cookie.png differ diff --git a/textures/food/food_dried_kelp.png b/textures/food/food_dried_kelp.png new file mode 100644 index 000000000..114869df4 Binary files /dev/null and b/textures/food/food_dried_kelp.png differ diff --git a/textures/food/food_glow_berries.png b/textures/food/food_glow_berries.png new file mode 100644 index 000000000..a1b4b949f Binary files /dev/null and b/textures/food/food_glow_berries.png differ diff --git a/textures/food/food_golden_apple.png b/textures/food/food_golden_apple.png new file mode 100644 index 000000000..4a4e91547 Binary files /dev/null and b/textures/food/food_golden_apple.png differ diff --git a/textures/food/food_golden_carrot.png b/textures/food/food_golden_carrot.png new file mode 100644 index 000000000..6a05e6d6a Binary files /dev/null and b/textures/food/food_golden_carrot.png differ diff --git a/textures/food/food_honey_bottle.png b/textures/food/food_honey_bottle.png new file mode 100644 index 000000000..28654e574 Binary files /dev/null and b/textures/food/food_honey_bottle.png differ diff --git a/textures/food/food_melon_slice.png b/textures/food/food_melon_slice.png new file mode 100644 index 000000000..96ba6b1db Binary files /dev/null and b/textures/food/food_melon_slice.png differ diff --git a/textures/food/food_mushroom_stew.png b/textures/food/food_mushroom_stew.png new file mode 100644 index 000000000..5a10b5ff6 Binary files /dev/null and b/textures/food/food_mushroom_stew.png differ diff --git a/textures/food/food_mutton.png b/textures/food/food_mutton.png new file mode 100644 index 000000000..506327cfe Binary files /dev/null and b/textures/food/food_mutton.png differ diff --git a/textures/food/food_poisonous_potato.png b/textures/food/food_poisonous_potato.png new file mode 100644 index 000000000..541fcfaff Binary files /dev/null and b/textures/food/food_poisonous_potato.png differ diff --git a/textures/food/food_porkchop.png b/textures/food/food_porkchop.png new file mode 100644 index 000000000..6c83dd030 Binary files /dev/null and b/textures/food/food_porkchop.png differ diff --git a/textures/food/food_potato.png b/textures/food/food_potato.png new file mode 100644 index 000000000..608cddde7 Binary files /dev/null and b/textures/food/food_potato.png differ diff --git a/textures/food/food_pufferfish.png b/textures/food/food_pufferfish.png new file mode 100644 index 000000000..5413f788b Binary files /dev/null and b/textures/food/food_pufferfish.png differ diff --git a/textures/food/food_pumpkin_pie.png b/textures/food/food_pumpkin_pie.png new file mode 100644 index 000000000..cfe381a19 Binary files /dev/null and b/textures/food/food_pumpkin_pie.png differ diff --git a/textures/food/food_rabbit.png b/textures/food/food_rabbit.png new file mode 100644 index 000000000..b364d8a6b Binary files /dev/null and b/textures/food/food_rabbit.png differ diff --git a/textures/food/food_rabbit_stew.png b/textures/food/food_rabbit_stew.png new file mode 100644 index 000000000..7eb52c5c9 Binary files /dev/null and b/textures/food/food_rabbit_stew.png differ diff --git a/textures/food/food_rotten_flesh.png b/textures/food/food_rotten_flesh.png new file mode 100644 index 000000000..3aa0247ba Binary files /dev/null and b/textures/food/food_rotten_flesh.png differ diff --git a/textures/food/food_salmon.png b/textures/food/food_salmon.png new file mode 100644 index 000000000..8c145f3f1 Binary files /dev/null and b/textures/food/food_salmon.png differ diff --git a/textures/food/food_spider_eye.png b/textures/food/food_spider_eye.png new file mode 100644 index 000000000..89217242a Binary files /dev/null and b/textures/food/food_spider_eye.png differ diff --git a/textures/food/food_suspicious_stew.png b/textures/food/food_suspicious_stew.png new file mode 100644 index 000000000..3580c35aa Binary files /dev/null and b/textures/food/food_suspicious_stew.png differ diff --git a/textures/food/food_sweet_berries.png b/textures/food/food_sweet_berries.png new file mode 100644 index 000000000..7e0b99ee3 Binary files /dev/null and b/textures/food/food_sweet_berries.png differ diff --git a/textures/food/food_tropical_fish.png b/textures/food/food_tropical_fish.png new file mode 100644 index 000000000..2c80a6674 Binary files /dev/null and b/textures/food/food_tropical_fish.png differ