Juices, potato, meat and more
							
								
								
									
										13
									
								
								README.md
									
									
									
									
									
								
							
							
						
						| @@ -21,17 +21,22 @@ Other mods | |||||||
|  |  | ||||||
| There are expansion mods avaliable. Just install them in a mod folder, and everything should be fine. | There are expansion mods avaliable. Just install them in a mod folder, and everything should be fine. | ||||||
|  |  | ||||||
| * Modern food (Needs updating) | * Modern food (Needs updating) - burgers, soft drinks, pop corn, coffee, etc | ||||||
| * English food (Coming Soon) | * English food (Coming Soon) - breakfast, pastries, pasties, buns, muffins, teas, cheese | ||||||
| * Asian food (Coming Soon) | * Asian food (Coming Soon) - indian, chinese, thai | ||||||
|  |  | ||||||
| Licensing | Licensing | ||||||
| --------- | --------- | ||||||
|  |  | ||||||
| This mod, its code, images and nodeboxes, are licensed under: | The code, textures and nodeboxes in this mod are, unless otherwise notified, licensed under CC BY SA. | ||||||
|  |  | ||||||
| ANDREW "RUBENWARDY" WARD | ANDREW "RUBENWARDY" WARD | ||||||
| Creative Commons BY-SA 3.0 | Creative Commons BY-SA 3.0 | ||||||
| (or similar) | (or similar) | ||||||
|  |  | ||||||
| http://creativecommons.org/licenses/by-sa/3.0/ | http://creativecommons.org/licenses/by-sa/3.0/ | ||||||
|  |  | ||||||
|  | Baked potato texture by Doc, WTFPL | ||||||
|  | Dough, flour and wheat textures from default farming mod, WTFPL | ||||||
|  | Egg and milk textures from Mobf, CC BY SA | ||||||
|  | Have I missed out credit? Please tell me. | ||||||
| @@ -6,3 +6,4 @@ docfarming? | |||||||
| animalmaterials? | animalmaterials? | ||||||
| my_mobs? | my_mobs? | ||||||
| hud? | hud? | ||||||
|  | vessels? | ||||||
|   | |||||||
							
								
								
									
										111
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						| @@ -7,10 +7,17 @@ | |||||||
| -- basic foods | -- basic foods | ||||||
| -- ===================================== | -- ===================================== | ||||||
|  |  | ||||||
| food = { supported={} } | food = { | ||||||
|  | 	supported={}, | ||||||
|  | 	atsup={}, | ||||||
|  | 	df={}, | ||||||
|  | 	debug=true | ||||||
|  | } | ||||||
|  |  | ||||||
| function food.support(group,mod,item) | function food.support(group,mod,item) | ||||||
|  | 	food.atsup[group] = true | ||||||
| 	if not minetest.get_modpath(mod) then | 	if not minetest.get_modpath(mod) then | ||||||
| 		print("'"..mod.."' is not installed") | 		print("mod '"..mod.."' is not installed") | ||||||
| 		return | 		return | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
| @@ -23,7 +30,7 @@ function food.support(group,mod,item) | |||||||
| 	local data = minetest.registered_items[item] | 	local data = minetest.registered_items[item] | ||||||
|  |  | ||||||
| 	if not data then | 	if not data then | ||||||
| 		print(item.." not found") | 		print("item '",item.."' not found") | ||||||
| 		return | 		return | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
| @@ -37,6 +44,7 @@ function food.support(group,mod,item) | |||||||
| 	food.supported[group] = true | 	food.supported[group] = true | ||||||
| end | end | ||||||
| function food.asupport(group,add) | function food.asupport(group,add) | ||||||
|  | 	food.df[group] = true | ||||||
| 	if food.supported[group] then | 	if food.supported[group] then | ||||||
| 		return | 		return | ||||||
| 	end | 	end | ||||||
| @@ -60,9 +68,29 @@ function food.item_eat(amt) | |||||||
| 	end | 	end | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- Debug to check all supports have inbuilt | ||||||
|  | if food.debug then | ||||||
|  | minetest.after(0, function() | ||||||
|  | 	for name, val in pairs(food.atsup) do | ||||||
|  | 		if not food.df[name] then | ||||||
|  | 			print("[FOOD DEBUG] Ingredient "..name.." has no built in equiv") | ||||||
|  | 		 | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  | 	 | ||||||
|  | 	for name, val in pairs(food.df) do | ||||||
|  | 		if not food.atsup[name] then | ||||||
|  | 			print("[FOOD DEBUG] Inbuilt ingredient "..name.." has no supported external equiv") | ||||||
|  |  | ||||||
|  | 		end | ||||||
|  | 	end | ||||||
|  | end) | ||||||
|  | end | ||||||
|  |  | ||||||
| -- Add support for other mods | -- Add support for other mods | ||||||
| food.support("wheat","farming","farming:wheat") | food.support("wheat","farming","farming:wheat") | ||||||
| food.support("flour","farming","farming:flour") | food.support("flour","farming","farming:flour") | ||||||
|  | food.support("potato","docfarming","docfarming:potato") | ||||||
| food.support("tomato","farming_plus","farming_plus:tomato_item") | food.support("tomato","farming_plus","farming_plus:tomato_item") | ||||||
| food.support("tomato","plantlib","plantlib:tomato") | food.support("tomato","plantlib","plantlib:tomato") | ||||||
| food.support("strawberry","farming_plus","farming_plus:strawberry_item") | food.support("strawberry","farming_plus","farming_plus:strawberry_item") | ||||||
| @@ -77,6 +105,8 @@ food.support("egg","animalmaterials","animalmaterials:egg") | |||||||
| --food.support("meat_raw","mobs","mobs:meat_raw") | --food.support("meat_raw","mobs","mobs:meat_raw") | ||||||
| food.support("meat_raw","animalmaterials","animalmaterials:meat_raw") | food.support("meat_raw","animalmaterials","animalmaterials:meat_raw") | ||||||
| food.support("meat","mobs","mobs:meat") | food.support("meat","mobs","mobs:meat") | ||||||
|  | food.support("cup","vessels","vessels:drinking_glass") | ||||||
|  | food.support("cup","animalmaterials","animalmaterials:glass") | ||||||
|  |  | ||||||
| -- Default inbuilt ingrediants | -- Default inbuilt ingrediants | ||||||
| food.asupport("wheat",function() | food.asupport("wheat",function() | ||||||
| @@ -114,6 +144,20 @@ food.asupport("flour",function() | |||||||
| 		} | 		} | ||||||
| 	}) | 	}) | ||||||
| end) | end) | ||||||
|  | food.asupport("potato",function() | ||||||
|  | 	minetest.register_craftitem("food:potato", { | ||||||
|  | 		description = "Potato", | ||||||
|  | 		inventory_image = "food_potato.png", | ||||||
|  | 	}) | ||||||
|  | 	minetest.register_craft({ | ||||||
|  | 		output = "food:potato", | ||||||
|  | 		recipe = { | ||||||
|  | 			{"default:dirt"}, | ||||||
|  | 			{"default:apple"} | ||||||
|  |  | ||||||
|  | 		} | ||||||
|  | 	}) | ||||||
|  | end) | ||||||
| food.asupport("tomato",function() | food.asupport("tomato",function() | ||||||
| 	minetest.register_craftitem("food:tomato", { | 	minetest.register_craftitem("food:tomato", { | ||||||
| 		description = "Tomato", | 		description = "Tomato", | ||||||
| @@ -220,7 +264,7 @@ food.asupport("meat_raw",function() | |||||||
| 		} | 		} | ||||||
| 	}) | 	}) | ||||||
| end) | end) | ||||||
| food.asupport("food:meat",function() | food.asupport("meat",function() | ||||||
| 	minetest.register_craftitem("food:meat", { | 	minetest.register_craftitem("food:meat", { | ||||||
| 		description = "Venison", | 		description = "Venison", | ||||||
| 		inventory_image = "food_meat.png", | 		inventory_image = "food_meat.png", | ||||||
| @@ -235,6 +279,16 @@ food.asupport("food:meat",function() | |||||||
| 	}) | 	}) | ||||||
| end) | end) | ||||||
|  |  | ||||||
|  | if minetest.get_modpath("animalmaterials") then | ||||||
|  | 	minetest.register_craft({ | ||||||
|  | 		type = "cooking", | ||||||
|  | 		output = "group:food_meat", | ||||||
|  | 		recipe = "group:food_meat_raw", | ||||||
|  | 		cooktime = 30 | ||||||
|  | 	}) | ||||||
|  |  | ||||||
|  | end | ||||||
|  |  | ||||||
| -- Register sugar | -- Register sugar | ||||||
| minetest.register_craftitem("food:sugar", { | minetest.register_craftitem("food:sugar", { | ||||||
| 	description = "Sugar", | 	description = "Sugar", | ||||||
| @@ -342,6 +396,18 @@ minetest.register_craft({ | |||||||
| 	} | 	} | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- Register baked potato | ||||||
|  | minetest.register_craftitem("food:baked_potato", { | ||||||
|  | 	description = "Baked Potato", | ||||||
|  | 	inventory_image = "food_baked_potato.png", | ||||||
|  | 	on_use = food.item_eat(6), | ||||||
|  | }) | ||||||
|  | minetest.register_craft({ | ||||||
|  | 	type = "cooking", | ||||||
|  | 	output = "food:baked_potato", | ||||||
|  | 	recipe = "group:food_potato", | ||||||
|  | }) | ||||||
|  |  | ||||||
| -- Register pasta bake | -- Register pasta bake | ||||||
| minetest.register_craftitem("food:pasta_bake",{ | minetest.register_craftitem("food:pasta_bake",{ | ||||||
| 	description = "Pasta Bake", | 	description = "Pasta Bake", | ||||||
| @@ -367,7 +433,7 @@ minetest.register_craft({ | |||||||
| 	} | 	} | ||||||
| }) | }) | ||||||
|  |  | ||||||
| -- Soups | -- Register Soups | ||||||
| local soups = {"tomato","chicken"} | local soups = {"tomato","chicken"} | ||||||
| for i=1, #soups do | for i=1, #soups do | ||||||
| 	local flav = soups[i] | 	local flav = soups[i] | ||||||
| @@ -398,6 +464,41 @@ for i=1, #soups do | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- Juices | ||||||
|  | local juices = {"apple","cactus"} | ||||||
|  | for i=1, #juices do | ||||||
|  | 	local flav = juices[i] | ||||||
|  | 	minetest.register_craftitem("food:"..flav.."_juice", { | ||||||
|  | 		description = flav.." Juice", | ||||||
|  | 		inventory_image = "food_"..flav.."_juice.png", | ||||||
|  | 		on_use = minetest.item_eat(2), | ||||||
|  | 	}) | ||||||
|  | 		 | ||||||
|  | 	minetest.register_craft({ | ||||||
|  | 		output = "food:"..flav.."_juice 4", | ||||||
|  | 		recipe = { | ||||||
|  | 			{"","",""}, | ||||||
|  | 			{"","default:"..flav,""}, | ||||||
|  | 			{"","group:food_cup",""}, | ||||||
|  | 		} | ||||||
|  | 	}) | ||||||
|  | end | ||||||
|  |  | ||||||
|  | minetest.register_craftitem("food:rainbow_juice", { | ||||||
|  | 	description = "Rainbow Juice", | ||||||
|  | 	inventory_image = "food_rainbow_juice.png", | ||||||
|  | 	on_use = minetest.item_eat(20), | ||||||
|  | }) | ||||||
|  |  | ||||||
|  | minetest.register_craft({ | ||||||
|  | 	output = "food:rainbow_juice 99", | ||||||
|  | 	recipe = { | ||||||
|  | 		{"","",""}, | ||||||
|  | 		{"","default:nyancat_rainbow",""}, | ||||||
|  | 		{"","group:food_cup",""}, | ||||||
|  | 	} | ||||||
|  | }) | ||||||
|  |  | ||||||
| -- Register cakes | -- Register cakes | ||||||
| minetest.register_node("food:cake", { | minetest.register_node("food:cake", { | ||||||
| 	description = "Cake", | 	description = "Cake", | ||||||
|   | |||||||
							
								
								
									
										
											BIN
										
									
								
								textures/food_apple_juice.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 729 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/food_baked_potato.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 321 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/food_cactus_juice.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 867 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/food_meat.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 624 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/food_meat_raw.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 426 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/food_potato.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 252 B | 
							
								
								
									
										
											BIN
										
									
								
								textures/food_rainbow_juice.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| After Width: | Height: | Size: 396 B |