mirror of
https://github.com/rubenwardy/food.git
synced 2024-12-22 07:50:19 +01:00
Support farming redo
This commit is contained in:
parent
ba7a432e05
commit
a574323b56
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*~*
|
12
api.lua
12
api.lua
@ -71,9 +71,21 @@ function food.support(group, item)
|
||||
end
|
||||
|
||||
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
|
||||
|
20
support.lua
20
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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user