diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 933bec1..0000000 --- a/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: lua -before_install: sh travis_install.sh -script: cd minetest && ./bin/minetestserver --gameid minetest_game --worldname world --port 31234 -notifications: - email: false diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 1d9fe29..2aabaaa --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ Food ==== -[![Build Status](https://travis-ci.org/rubenwardy/food.svg?branch=master)](https://travis-ci.org/rubenwardy/food) - This is the main mod in the food mod collection. Version 2.3 diff --git a/description.txt b/description.txt old mode 100644 new mode 100755 diff --git a/food/depends.txt b/food/depends.txt old mode 100644 new mode 100755 diff --git a/food/description.txt b/food/description.txt old mode 100644 new mode 100755 diff --git a/food/init.lua b/food/init.lua old mode 100644 new mode 100755 index 9d37f11..0106f3d --- a/food/init.lua +++ b/food/init.lua @@ -10,9 +10,7 @@ food = { modules = {}, disabled_modules = {}, debug = false, - version = 2.3, - disable_fallbacks = - minetest.setting_getbool("food.disable_fallbacks") + version = 2.3 } -- Checks for external content, and adds support @@ -79,108 +77,42 @@ function food.disable_if(mod, name) end end -local mtreg_item = minetest.register_item -function minetest.register_item(name, def) - if food._reg_items then - local iname = food.strip_name(name) - food._reg_items[iname] = true - end - return mtreg_item(name, def) -end - -local mtreg_node = minetest.register_node -function minetest.register_node(name, def) - if food._reg_items then - local iname = food.strip_name(name) - food._reg_items[iname] = true - end - return mtreg_node(name, def) -end - -function food.strip_name(name) - res = name:gsub('%"', '') - if res:sub(1, 1) == ":" then - res = res:sub(2, #res) - --table.concat{res:sub(1, 1-1), "", res:sub(1+1)} - end - for str in string.gmatch(res, "([^ ]+)") do - if str ~= " " and str ~= nil then - res = str - break - end - end - if not res then - res = "" - end - return res -end - -local mtreg_craft = minetest.register_craft -function minetest.register_craft(def) - if food._reg_items and food._cur_module and def.output then - local name = food.strip_name(def.output) - if not food._reg_items[name] then - print("[Food] (Error) Modules should only define recipes for the items they create!") - print("Output: " .. name .. " in module " .. food._cur_module) - end - end - - return mtreg_craft(def) -end - -- Adds a module function food.module(name, func, ingred) if food.disabled_modules[name] then return end - if ingred then for name, def in pairs(minetest.registered_items) do local g = def.groups and def.groups["food_"..name] or 0 if g > 0 then + print("cancelled") return end end - if food.disable_fallbacks then - print("Warning: Fallbacks are disabled, and no item for " .. name .. " registered!") - return - end - if food.debug then print("[Food Debug] Registering " .. name .. " fallback definition") end elseif food.debug then print("[Food Debug] Module " .. name) end - - food._cur_module = name - food._reg_items = {} - func() - - food._reg_items = nil - food._cur_module = nil -end - -local global_exists = minetest.global_exists or function(name) - return (_G[name] ~= nil) end -- Checks for hunger mods to register food on function food.item_eat(amt) - if minetest.get_modpath("diet") and global_exists("diet") and diet.item_eat then + if minetest.get_modpath("diet") and diet and diet.item_eat then return diet.item_eat(amt) - elseif minetest.get_modpath("hud") and global_exists("hud") and hud.item_eat then + elseif minetest.get_modpath("hud") and hud and hud.item_eat then return hud.item_eat(amt) elseif minetest.get_modpath("hbhunger") then - if global_exists("hbhunger") then + if hbhunger and hbhunger.item_eat then -- hbhunger is nil when world is loaded with damage disabled return hbhunger.item_eat(amt) - elseif global_exists("hunger") then - -- For backwards compatibility - -- It used to be called `hunger` rather than `hbhunger` - return hunger.item_eat(amt) end + return function(...) end + elseif minetest.get_modpath("hunger") and hunger and hunger.item_eat then + return hunger.item_eat(amt) else return minetest.item_eat(amt) end @@ -218,3 +150,4 @@ end function food.craft(craft) minetest.register_craft(craft) end + diff --git a/food_basic/README.md b/food_basic/README.md old mode 100644 new mode 100755 diff --git a/food_basic/depends.txt b/food_basic/depends.txt old mode 100644 new mode 100755 diff --git a/food_basic/description.txt b/food_basic/description.txt old mode 100644 new mode 100755 diff --git a/food_basic/ingredients.lua b/food_basic/ingredients.lua old mode 100644 new mode 100755 index 27c5feb..61f2065 --- a/food_basic/ingredients.lua +++ b/food_basic/ingredients.lua @@ -43,13 +43,6 @@ food.module("flour", function() {"group:food_wheat"} } }) - food.craft({ - output = "food:flour", - recipe = { - {"default:sand"}, - {"default:sand"} - } - }) end, true) food.module("potato", function() diff --git a/food_basic/init.lua b/food_basic/init.lua old mode 100644 new mode 100755 index 9f035d4..453d287 --- a/food_basic/init.lua +++ b/food_basic/init.lua @@ -6,7 +6,7 @@ -- Some basic foods -- ===================================== -print("Food Mod - Version 2.3") +minetest.log("action", "Food Mod - Version 2.3") dofile(minetest.get_modpath("food_basic").."/support.lua") dofile(minetest.get_modpath("food_basic").."/ingredients.lua") diff --git a/food_basic/locale/de.txt b/food_basic/locale/de.txt old mode 100644 new mode 100755 diff --git a/food_basic/locale/fr.txt b/food_basic/locale/fr.txt old mode 100644 new mode 100755 diff --git a/food_basic/locale/template.txt b/food_basic/locale/template.txt old mode 100644 new mode 100755 diff --git a/food_basic/support.lua b/food_basic/support.lua old mode 100644 new mode 100755 diff --git a/food_basic/textures/food_apple_juice.png b/food_basic/textures/food_apple_juice.png old mode 100644 new mode 100755 index fc2b8ef..d191517 Binary files a/food_basic/textures/food_apple_juice.png and b/food_basic/textures/food_apple_juice.png differ diff --git a/food_basic/textures/food_baked_potato.png b/food_basic/textures/food_baked_potato.png old mode 100644 new mode 100755 index 425c4ae..fa06937 Binary files a/food_basic/textures/food_baked_potato.png and b/food_basic/textures/food_baked_potato.png differ diff --git a/food_basic/textures/food_baking_bread_slice.png b/food_basic/textures/food_baking_bread_slice.png old mode 100644 new mode 100755 index 174c900..dea3a64 Binary files a/food_basic/textures/food_baking_bread_slice.png and b/food_basic/textures/food_baking_bread_slice.png differ diff --git a/food_basic/textures/food_baking_bun_mix.png b/food_basic/textures/food_baking_bun_mix.png old mode 100644 new mode 100755 index ac2e7f4..e97ad81 Binary files a/food_basic/textures/food_baking_bun_mix.png and b/food_basic/textures/food_baking_bun_mix.png differ diff --git a/food_basic/textures/food_baking_dough.png b/food_basic/textures/food_baking_dough.png old mode 100644 new mode 100755 index 5c4b197..86fa669 Binary files a/food_basic/textures/food_baking_dough.png and b/food_basic/textures/food_baking_dough.png differ diff --git a/food_basic/textures/food_bowl.png b/food_basic/textures/food_bowl.png old mode 100644 new mode 100755 index b1d2b09..c5bf9e8 Binary files a/food_basic/textures/food_bowl.png and b/food_basic/textures/food_bowl.png differ diff --git a/food_basic/textures/food_butter.png b/food_basic/textures/food_butter.png old mode 100644 new mode 100755 index cb6f054..645c057 Binary files a/food_basic/textures/food_butter.png and b/food_basic/textures/food_butter.png differ diff --git a/food_basic/textures/food_cactus_juice.png b/food_basic/textures/food_cactus_juice.png old mode 100644 new mode 100755 index 6180eed..7d6cd67 Binary files a/food_basic/textures/food_cactus_juice.png and b/food_basic/textures/food_cactus_juice.png differ diff --git a/food_basic/textures/food_cake_carrot_texture.png b/food_basic/textures/food_cake_carrot_texture.png old mode 100644 new mode 100755 diff --git a/food_basic/textures/food_cake_carrot_texture_side.png b/food_basic/textures/food_cake_carrot_texture_side.png old mode 100644 new mode 100755 diff --git a/food_basic/textures/food_cake_choco_texture.png b/food_basic/textures/food_cake_choco_texture.png old mode 100644 new mode 100755 diff --git a/food_basic/textures/food_cake_choco_texture_side.png b/food_basic/textures/food_cake_choco_texture_side.png old mode 100644 new mode 100755 index 4f7a8b4..35aa9bf Binary files a/food_basic/textures/food_cake_choco_texture_side.png and b/food_basic/textures/food_cake_choco_texture_side.png differ diff --git a/food_basic/textures/food_cake_texture.png b/food_basic/textures/food_cake_texture.png old mode 100644 new mode 100755 diff --git a/food_basic/textures/food_cake_texture_side.png b/food_basic/textures/food_cake_texture_side.png old mode 100644 new mode 100755 diff --git a/food_basic/textures/food_cakemix_carrot.png b/food_basic/textures/food_cakemix_carrot.png old mode 100644 new mode 100755 index 30dd002..eaddc47 Binary files a/food_basic/textures/food_cakemix_carrot.png and b/food_basic/textures/food_cakemix_carrot.png differ diff --git a/food_basic/textures/food_cakemix_choco.png b/food_basic/textures/food_cakemix_choco.png old mode 100644 new mode 100755 index cd88169..b34d552 Binary files a/food_basic/textures/food_cakemix_choco.png and b/food_basic/textures/food_cakemix_choco.png differ diff --git a/food_basic/textures/food_cakemix_plain.png b/food_basic/textures/food_cakemix_plain.png old mode 100644 new mode 100755 index 7b9f392..6df78dd Binary files a/food_basic/textures/food_cakemix_plain.png and b/food_basic/textures/food_cakemix_plain.png differ diff --git a/food_basic/textures/food_carrot.png b/food_basic/textures/food_carrot.png old mode 100644 new mode 100755 index 5ed61ac..4d3a8fd Binary files a/food_basic/textures/food_carrot.png and b/food_basic/textures/food_carrot.png differ diff --git a/food_basic/textures/food_cheese.png b/food_basic/textures/food_cheese.png old mode 100644 new mode 100755 diff --git a/food_basic/textures/food_chocolate_powder.png b/food_basic/textures/food_chocolate_powder.png old mode 100644 new mode 100755 index 49840ed..5573835 Binary files a/food_basic/textures/food_chocolate_powder.png and b/food_basic/textures/food_chocolate_powder.png differ diff --git a/food_basic/textures/food_cocoa.png b/food_basic/textures/food_cocoa.png old mode 100644 new mode 100755 index 4ad6b35..8860b4b Binary files a/food_basic/textures/food_cocoa.png and b/food_basic/textures/food_cocoa.png differ diff --git a/food_basic/textures/food_dark_chocolate.png b/food_basic/textures/food_dark_chocolate.png old mode 100644 new mode 100755 index 3e1df7b..07b82e6 Binary files a/food_basic/textures/food_dark_chocolate.png and b/food_basic/textures/food_dark_chocolate.png differ diff --git a/food_basic/textures/food_egg.png b/food_basic/textures/food_egg.png old mode 100644 new mode 100755 diff --git a/food_basic/textures/food_flour.png b/food_basic/textures/food_flour.png old mode 100644 new mode 100755 index a526b20..e6160c4 Binary files a/food_basic/textures/food_flour.png and b/food_basic/textures/food_flour.png differ diff --git a/food_basic/textures/food_meat.png b/food_basic/textures/food_meat.png old mode 100644 new mode 100755 index d4e4abb..4251e29 Binary files a/food_basic/textures/food_meat.png and b/food_basic/textures/food_meat.png differ diff --git a/food_basic/textures/food_meat_raw.png b/food_basic/textures/food_meat_raw.png old mode 100644 new mode 100755 index 0dea4ec..b18d1be Binary files a/food_basic/textures/food_meat_raw.png and b/food_basic/textures/food_meat_raw.png differ diff --git a/food_basic/textures/food_milk.png b/food_basic/textures/food_milk.png old mode 100644 new mode 100755 diff --git a/food_basic/textures/food_milk_chocolate.png b/food_basic/textures/food_milk_chocolate.png old mode 100644 new mode 100755 index bbfa37e..f1c07a5 Binary files a/food_basic/textures/food_milk_chocolate.png and b/food_basic/textures/food_milk_chocolate.png differ diff --git a/food_basic/textures/food_orange.png b/food_basic/textures/food_orange.png old mode 100644 new mode 100755 index 4c5e045..ac74d84 Binary files a/food_basic/textures/food_orange.png and b/food_basic/textures/food_orange.png differ diff --git a/food_basic/textures/food_orange_juice.png b/food_basic/textures/food_orange_juice.png old mode 100644 new mode 100755 index 62834ab..7616531 Binary files a/food_basic/textures/food_orange_juice.png and b/food_basic/textures/food_orange_juice.png differ diff --git a/food_basic/textures/food_pasta.png b/food_basic/textures/food_pasta.png old mode 100644 new mode 100755 index 9fa194b..53a0bb2 Binary files a/food_basic/textures/food_pasta.png and b/food_basic/textures/food_pasta.png differ diff --git a/food_basic/textures/food_pasta_bake.png b/food_basic/textures/food_pasta_bake.png old mode 100644 new mode 100755 index 81221a6..b06da41 Binary files a/food_basic/textures/food_pasta_bake.png and b/food_basic/textures/food_pasta_bake.png differ diff --git a/food_basic/textures/food_pasta_bake_raw.png b/food_basic/textures/food_pasta_bake_raw.png old mode 100644 new mode 100755 index 2a6294a..7d02ea8 Binary files a/food_basic/textures/food_pasta_bake_raw.png and b/food_basic/textures/food_pasta_bake_raw.png differ diff --git a/food_basic/textures/food_potato.png b/food_basic/textures/food_potato.png old mode 100644 new mode 100755 index 6e91d6a..9fe2970 Binary files a/food_basic/textures/food_potato.png and b/food_basic/textures/food_potato.png differ diff --git a/food_basic/textures/food_rainbow_juice.png b/food_basic/textures/food_rainbow_juice.png old mode 100644 new mode 100755 index 7eb97cf..159f020 Binary files a/food_basic/textures/food_rainbow_juice.png and b/food_basic/textures/food_rainbow_juice.png differ diff --git a/food_basic/textures/food_soup_chicken.png b/food_basic/textures/food_soup_chicken.png old mode 100644 new mode 100755 index db9f10d..b1c1dda Binary files a/food_basic/textures/food_soup_chicken.png and b/food_basic/textures/food_soup_chicken.png differ diff --git a/food_basic/textures/food_soup_chicken_raw.png b/food_basic/textures/food_soup_chicken_raw.png old mode 100644 new mode 100755 index 0cf6b21..2bb8871 Binary files a/food_basic/textures/food_soup_chicken_raw.png and b/food_basic/textures/food_soup_chicken_raw.png differ diff --git a/food_basic/textures/food_soup_tomato.png b/food_basic/textures/food_soup_tomato.png old mode 100644 new mode 100755 index 5cc23be..3eeb431 Binary files a/food_basic/textures/food_soup_tomato.png and b/food_basic/textures/food_soup_tomato.png differ diff --git a/food_basic/textures/food_soup_tomato_raw.png b/food_basic/textures/food_soup_tomato_raw.png old mode 100644 new mode 100755 index 1eac22c..81f8fed Binary files a/food_basic/textures/food_soup_tomato_raw.png and b/food_basic/textures/food_soup_tomato_raw.png differ diff --git a/food_basic/textures/food_strawberry.png b/food_basic/textures/food_strawberry.png old mode 100644 new mode 100755 index 0a80f45..11118cd Binary files a/food_basic/textures/food_strawberry.png and b/food_basic/textures/food_strawberry.png differ diff --git a/food_basic/textures/food_sugar.png b/food_basic/textures/food_sugar.png old mode 100644 new mode 100755 index 10ecf70..ceda6a0 Binary files a/food_basic/textures/food_sugar.png and b/food_basic/textures/food_sugar.png differ diff --git a/food_basic/textures/food_tomato.png b/food_basic/textures/food_tomato.png old mode 100644 new mode 100755 index c998b60..d44037d Binary files a/food_basic/textures/food_tomato.png and b/food_basic/textures/food_tomato.png differ diff --git a/food_basic/textures/food_wheat.png b/food_basic/textures/food_wheat.png old mode 100644 new mode 100755 index 8ecd735..a2f0dc0 Binary files a/food_basic/textures/food_wheat.png and b/food_basic/textures/food_wheat.png differ diff --git a/modpack.txt b/modpack.txt old mode 100644 new mode 100755 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index b7631ee..0000000 --- a/requirements.txt +++ /dev/null @@ -1,7 +0,0 @@ -docfarming? -PilzAdam/farming_plus@github? -JKMurray/JKFarming@github? -my_mobs? -PilzAdam/mobs@github -sapier/animals_modpack@github? -hawkril/mobfcooking@github? diff --git a/travis_install.sh b/travis_install.sh deleted file mode 100755 index 856e625..0000000 --- a/travis_install.sh +++ /dev/null @@ -1,56 +0,0 @@ -# Move the food modpack to a subfolder -mkdir tmp1 && mv * tmp1 -mv tmp1 food - -# Install dependancies -sudo apt-get update -sudo apt-get install -y libirrlicht-dev libbz2-dev \ - libpng12-dev libjpeg-dev libxxf86vm-dev libgl1-mesa-dev libsqlite3-dev \ - libogg-dev libvorbis-dev libopenal-dev libcurl4-gnutls-dev \ - libfreetype6-dev zlib1g-dev libgmp-dev libjsoncpp-dev wget \ - lua5.1 luarocks libzzip-dev luajit -sudo luarocks install luazip -sudo luarocks install luafilesystem -sudo luarocks install luajson - -# Get minetest -wget https://www.dropbox.com/s/wtub256856vdclf/minetestserver.zip?dl=1 -O minetestserver.zip -unzip minetestserver.zip -d minetest - -# Install the food modpack -cp food minetest/mods -rf - -# Install and configure mtpm -git clone https://github.com/rubenwardy/mtpm -cd mtpm -mkdir tmp -./mtpm.lua config mod_location ../minetest/mods/ - -# Install the food modpack's supported mods -./mtpm.lua install -r ../food/requirements.txt -y - -# Configure Minetest -echo "Configuring Minetest" -cd ../minetest -mkdir worlds/world -echo "gameid = minetest" > worlds/world/world.mt -echo "backend = sqlite3" >> worlds/world/world.mt -echo "creative_mode = true" >> worlds/world/world.mt -echo "enable_damage = true" >> worlds/world/world.mt -cd mods -for f in * - do - echo "load_mod_$f = true" >> ../worlds/world/world.mt -done - -# Install test worldmod -cd ../ -mkdir worlds/world/worldmods/ -mkdir worlds/world/worldmods/food_test/ -echo "minetest.after(0, function()" > worlds/world/worldmods/food_test/init.lua -echo " print(\"tests complete\")" >> worlds/world/worldmods/food_test/init.lua -echo " minetest.request_shutdown()" >> worlds/world/worldmods/food_test/init.lua -echo "end)" >> worlds/world/worldmods/food_test/init.lua - -# Go pack to the right directory -cd ../food