Version MFF.
0
.gitignore
vendored
Normal file → Executable file
@ -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
|
2
README.md
Normal file → Executable file
@ -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
|
||||
|
0
description.txt
Normal file → Executable file
0
food/depends.txt
Normal file → Executable file
0
food/description.txt
Normal file → Executable file
85
food/init.lua
Normal file → Executable file
@ -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
|
||||
|
||||
|
0
food_basic/README.md
Normal file → Executable file
0
food_basic/depends.txt
Normal file → Executable file
0
food_basic/description.txt
Normal file → Executable file
7
food_basic/ingredients.lua
Normal file → Executable file
@ -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()
|
||||
|
2
food_basic/init.lua
Normal file → Executable file
@ -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")
|
||||
|
0
food_basic/locale/de.txt
Normal file → Executable file
0
food_basic/locale/fr.txt
Normal file → Executable file
0
food_basic/locale/template.txt
Normal file → Executable file
0
food_basic/support.lua
Normal file → Executable file
BIN
food_basic/textures/food_apple_juice.png
Normal file → Executable file
Before Width: | Height: | Size: 729 B After Width: | Height: | Size: 469 B |
BIN
food_basic/textures/food_baked_potato.png
Normal file → Executable file
Before Width: | Height: | Size: 321 B After Width: | Height: | Size: 318 B |
BIN
food_basic/textures/food_baking_bread_slice.png
Normal file → Executable file
Before Width: | Height: | Size: 437 B After Width: | Height: | Size: 389 B |
BIN
food_basic/textures/food_baking_bun_mix.png
Normal file → Executable file
Before Width: | Height: | Size: 474 B After Width: | Height: | Size: 124 B |
BIN
food_basic/textures/food_baking_dough.png
Normal file → Executable file
Before Width: | Height: | Size: 343 B After Width: | Height: | Size: 178 B |
BIN
food_basic/textures/food_bowl.png
Normal file → Executable file
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 195 B |
BIN
food_basic/textures/food_butter.png
Normal file → Executable file
Before Width: | Height: | Size: 476 B After Width: | Height: | Size: 471 B |
BIN
food_basic/textures/food_cactus_juice.png
Normal file → Executable file
Before Width: | Height: | Size: 867 B After Width: | Height: | Size: 615 B |
0
food_basic/textures/food_cake_carrot_texture.png
Normal file → Executable file
Before Width: | Height: | Size: 786 B After Width: | Height: | Size: 786 B |
0
food_basic/textures/food_cake_carrot_texture_side.png
Normal file → Executable file
Before Width: | Height: | Size: 780 B After Width: | Height: | Size: 780 B |
0
food_basic/textures/food_cake_choco_texture.png
Normal file → Executable file
Before Width: | Height: | Size: 712 B After Width: | Height: | Size: 712 B |
BIN
food_basic/textures/food_cake_choco_texture_side.png
Normal file → Executable file
Before Width: | Height: | Size: 709 B After Width: | Height: | Size: 707 B |
0
food_basic/textures/food_cake_texture.png
Normal file → Executable file
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 758 B |
0
food_basic/textures/food_cake_texture_side.png
Normal file → Executable file
Before Width: | Height: | Size: 758 B After Width: | Height: | Size: 758 B |
BIN
food_basic/textures/food_cakemix_carrot.png
Normal file → Executable file
Before Width: | Height: | Size: 335 B After Width: | Height: | Size: 216 B |
BIN
food_basic/textures/food_cakemix_choco.png
Normal file → Executable file
Before Width: | Height: | Size: 331 B After Width: | Height: | Size: 213 B |
BIN
food_basic/textures/food_cakemix_plain.png
Normal file → Executable file
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 213 B |
BIN
food_basic/textures/food_carrot.png
Normal file → Executable file
Before Width: | Height: | Size: 575 B After Width: | Height: | Size: 151 B |
0
food_basic/textures/food_cheese.png
Normal file → Executable file
Before Width: | Height: | Size: 487 B After Width: | Height: | Size: 487 B |
BIN
food_basic/textures/food_chocolate_powder.png
Normal file → Executable file
Before Width: | Height: | Size: 510 B After Width: | Height: | Size: 137 B |
BIN
food_basic/textures/food_cocoa.png
Normal file → Executable file
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 108 B |
BIN
food_basic/textures/food_dark_chocolate.png
Normal file → Executable file
Before Width: | Height: | Size: 480 B After Width: | Height: | Size: 144 B |
0
food_basic/textures/food_egg.png
Normal file → Executable file
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 672 B |
BIN
food_basic/textures/food_flour.png
Normal file → Executable file
Before Width: | Height: | Size: 378 B After Width: | Height: | Size: 204 B |
BIN
food_basic/textures/food_meat.png
Normal file → Executable file
Before Width: | Height: | Size: 624 B After Width: | Height: | Size: 158 B |
BIN
food_basic/textures/food_meat_raw.png
Normal file → Executable file
Before Width: | Height: | Size: 426 B After Width: | Height: | Size: 174 B |
0
food_basic/textures/food_milk.png
Normal file → Executable file
Before Width: | Height: | Size: 559 B After Width: | Height: | Size: 559 B |
BIN
food_basic/textures/food_milk_chocolate.png
Normal file → Executable file
Before Width: | Height: | Size: 479 B After Width: | Height: | Size: 144 B |
BIN
food_basic/textures/food_orange.png
Normal file → Executable file
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 487 B |
BIN
food_basic/textures/food_orange_juice.png
Normal file → Executable file
Before Width: | Height: | Size: 620 B After Width: | Height: | Size: 560 B |
BIN
food_basic/textures/food_pasta.png
Normal file → Executable file
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 176 B |
BIN
food_basic/textures/food_pasta_bake.png
Normal file → Executable file
Before Width: | Height: | Size: 366 B After Width: | Height: | Size: 239 B |
BIN
food_basic/textures/food_pasta_bake_raw.png
Normal file → Executable file
Before Width: | Height: | Size: 324 B After Width: | Height: | Size: 214 B |
BIN
food_basic/textures/food_potato.png
Normal file → Executable file
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 236 B |
BIN
food_basic/textures/food_rainbow_juice.png
Normal file → Executable file
Before Width: | Height: | Size: 396 B After Width: | Height: | Size: 347 B |
BIN
food_basic/textures/food_soup_chicken.png
Normal file → Executable file
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 198 B |
BIN
food_basic/textures/food_soup_chicken_raw.png
Normal file → Executable file
Before Width: | Height: | Size: 325 B After Width: | Height: | Size: 183 B |
BIN
food_basic/textures/food_soup_tomato.png
Normal file → Executable file
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 195 B |
BIN
food_basic/textures/food_soup_tomato_raw.png
Normal file → Executable file
Before Width: | Height: | Size: 321 B After Width: | Height: | Size: 183 B |
BIN
food_basic/textures/food_strawberry.png
Normal file → Executable file
Before Width: | Height: | Size: 250 B After Width: | Height: | Size: 176 B |
BIN
food_basic/textures/food_sugar.png
Normal file → Executable file
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 2.0 KiB |
BIN
food_basic/textures/food_tomato.png
Normal file → Executable file
Before Width: | Height: | Size: 338 B After Width: | Height: | Size: 201 B |
BIN
food_basic/textures/food_wheat.png
Normal file → Executable file
Before Width: | Height: | Size: 566 B After Width: | Height: | Size: 563 B |
0
modpack.txt
Normal file → Executable file
@ -1,7 +0,0 @@
|
||||
docfarming?
|
||||
PilzAdam/farming_plus@github?
|
||||
JKMurray/JKFarming@github?
|
||||
my_mobs?
|
||||
PilzAdam/mobs@github
|
||||
sapier/animals_modpack@github?
|
||||
hawkril/mobfcooking@github?
|
@ -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
|