项目作者: srifqi

项目描述 :
Plant culture mod for Minetest
高级语言: Lua
项目地址: git://github.com/srifqi/plantculture.git
创建时间: 2014-12-07T16:38:01Z
项目社区:https://github.com/srifqi/plantculture

开源协议:Other

下载


plantculture

Plant culture mod for Minetest

License

For code: CC0 1.0 Universal (http://creativecommons.org/publicdomain/zero/1.0/)

For texture: CC BY-SA 4.0 (http://creativecommons.org/licenses/by-sa/4.0/)

plantculture API

This mod includes an API

plantculture.register()

Register a sapling

Syntax

  1. plantculture.register(param)

Where param is a table:

  • name : an itemstring ("plantculture:name")
  • desc : the description text of the node
  • image : the texture of the node (will be drawed 'plantlike')
  • interval : abm’s interval
  • chance : chance per interval
  • sapling : the sapling that this node will grows up to
  • crafting : a table that consist of sapling, trunk, leaf that consist of:
    • amount : amount of result
    • recipe : crafting recipe
    • type : crafting recipe type

Example

  1. --Register small sapling
  2. plantculture.register({
  3. name = "small_sapling",
  4. desc = "Small Sapling",
  5. image = "plantculture_small_sapling.png",
  6. interval = 10,
  7. chance = 50,
  8. sapling = "default:sapling",
  9. crafting = {
  10. sapling = {
  11. amount = 4,
  12. recipe = {"default:sapling"},
  13. type = "shapeless"
  14. },
  15. trunk = {
  16. amount = 2,
  17. recipe = {
  18. "default:tree","default:tree","default:tree","default:tree",
  19. "default:tree","default:tree","default:tree","default:tree"
  20. },
  21. type = "shapeless"
  22. },
  23. leaf = {
  24. amount = 1,
  25. recipe = {
  26. "default:leaves","default:leaves","default:leaves","default:leaves",
  27. "default:leaves","default:leaves","default:leaves","default:leaves"
  28. },
  29. type = "shapeless"
  30. },
  31. },
  32. })