summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2014-08-31 17:40:35 +0100
committerrubenwardy <rubenwardy@gmail.com>2014-08-31 17:40:35 +0100
commita574323b568bef6f719c23b552f8c8cb8f33f7ea (patch)
tree0d9abe9cdc7a615092f068cbb61e3960f26c6f63
parentba7a432e0511e70d6bfba43de1b7a6fb61fe17a8 (diff)
Support farming redo
-rw-r--r--.gitignore1
-rw-r--r--api.lua14
-rw-r--r--support.lua20
3 files changed, 31 insertions, 4 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..a89a5c6
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+*~*
diff --git a/api.lua b/api.lua
index 874bc94..19d019f 100644
--- a/api.lua
+++ b/api.lua
@@ -70,10 +70,22 @@ function food.support(group, item)
minetest.override_item(item, {groups = g})
end
-function food.disable(name)
+function food.disable(name)
+ if type(name) == "table" then
+ for i = 1, #name do
+ food.disable(name[i])
+ end
+ return
+ end
food.disabled_modules[name] = true
end
+function food.disable_if(mod, name)
+ if minetest.get_modpath(mod) then
+ food.disable(name)
+ end
+end
+
-- Adds a module
function food.module(name, func, ingred)
if food.disabled_modules[name] then
diff --git a/support.lua b/support.lua
index 80cff2d..3f701a4 100644
--- a/support.lua
+++ b/support.lua
@@ -1,4 +1,4 @@
- -- FOOD MOD
+-- FOOD MOD
-- A mod written by rubenwardy that adds
-- food to the minetest game
-- =====================================
@@ -7,8 +7,6 @@
-- =====================================
-- Add support for other mods
-food.support("wheat", "farming:wheat")
-food.support("flour", "farming:flour")
food.support("cocoa", "farming_plus:cocoa_bean")
food.support("cup", "vessels:drinking_glass")
food.support("potato", {
@@ -50,3 +48,19 @@ food.support("sugar", {
"bushes:sugar"
})
+if farming and farming.mod == "redo" then
+ food.support("wheat", "farming:wheat")
+ food.support("flour", "farming:flour")
+ food.support("carrot", "farming:carrot")
+ food.support("potato", "farming:potato")
+ food.support("tomato", "farming:tomato")
+ food.support("cocoa", "farming:cocoa_beans")
+ food.support("dark_chocolate", "farming:chocolate_dark")
+ food.support("sugar", "farming:sugar")
+ food.support("cup", "farming:drinking_cup")
+ food.disable_if("farming", "baked_potato")
+else
+ food.support("wheat", "farming:wheat")
+ food.support("flour", "farming:flour")
+end
+