init.lua 887 B

12345678910111213141516171819202122232425262728
  1. local cf={["farming:grain_coffee_cup_hot"]={drink_hp=10},
  2. ["farming:grain_milk"]={drink_hp=20},
  3. ["farming:smoothie"]={drink_hp=20},
  4. ["default:apple"]={drink_hp=4},
  5. ["ethereal:banana"]={drink_hp=4},
  6. ["farming:strawberry_seed"]={drink_hp=3},
  7. ["farming:blackberry_seed"]={drink_hp=3},
  8. ["farming:blueberry_seed"]={drink_hp=3},
  9. ["farming:raspberry_seed"]={drink_hp=3},
  10. ["farming:rhubarb_seed"]={drink_hp=2},
  11. ["default:potato"]={drink_hp=1},
  12. ["default:carrot"]={drink_hp=1},
  13. ["moretrees:coconut_milk"]={drink_hp=10},
  14. ["mtfoods:orange_juice"]={drink_hp=10},
  15. ["mtfoods:apple_juice"]={drink_hp=10},
  16. ["mtfoods:apple_cider"]={drink_hp=15},
  17. }
  18. for i,def in pairs(cf) do
  19. if minetest.registered_items[i]~=nil then
  20. local tgroup=minetest.registered_items[i].groups
  21. if tgroup.drinkable == nil then
  22. tgroup["drinkable"]=def.drink_hp
  23. end
  24. minetest.override_item(i,tgroup)
  25. end
  26. end