Go to file
Andrew Ward e84a4cff49 Update README.md 2013-02-20 13:12:39 +00:00
.gitattributes Initial Commit 2013-02-16 17:02:21 +00:00
.gitignore Initial Commit 2013-02-16 17:02:21 +00:00
README.md Update README.md 2013-02-20 13:12:39 +00:00
init.lua add player exists function 2013-02-20 13:10:09 +00:00
mod.lua Changes 2013-02-17 13:45:47 +00:00
player.lua add player exists function 2013-02-20 13:10:09 +00:00
vector.lua seperate v3 into modules 2013-02-17 19:16:47 +00:00
vector_calc.lua seperate v3 into modules 2013-02-17 19:16:47 +00:00
vector_cmp.lua seperate v3 into modules 2013-02-17 19:16:47 +00:00
world.lua Add node ownership checker 2013-02-17 18:14:09 +00:00

README.md

CommonLib by Rubenwardy

Adds common functions that help minetest modders achieve perfection in both their mod, and in interacting with other mods too.

You can include the whole library as a mod (recommended) or just include some modules in your mod.

License

Code: CC-BY-SA

  • These conditions apply to the Commonlib code, and not to any mods using the library.
  • Commonlib is counted as a seperate library rather than part of the mod using it.
  • This means you can use Commonlib in a mod with a different license to this.

Contained Functions

  • mod [mod.lua] - namespace
    • node_implement( modname,n_ext,n_int,resultfunc ) - A soft depend ingredient adder - uses aliases (by Rubenwardy)
    • soft_depend( modname,func ) - Runs a function if a mod is present, and after it loads (by Rubenwardy)
    • assert_backtrace( item ) - A debug function for backtracing (by Sapier)
  • player [player.lua] - namespace
    • player_exists( name ) - sees if a player exists (by Sokomine)
  • v3 - namespace
    • core module [vector.lua]
      • new( x, y, z ) - creates new vector from integers, floats, or tables (by celeron55)
      • copy( v ) - copies a vector (by PilzAdam)
      • floor( v ) - rounds a vector to integers (by celeron55)
      • len( v ) - returns length of the vector (by celeron55)
      • norm( v )_ - normalise the vector (by celeron55)
    • compare module [vector_cmp.lua]
      • cmp( v, u ) - compares vectors (by celeron55)
      • equal( v, u ) - checks if two vectors are equal (by PilzAdam)
      • distance( v, u ) - the distance between two vectors (by celeron55)
      • rotate_y( v, u ) - rotate y (by celeron55)
      • get_direction( pos1, pos2 __) - get the direction of a point from enougher (by Sapier)
    • calculation module [vector_calc.lua]
      • add( v, u ) - adds two vectors together (by celeron55)
      • sub( v, u ) - subtracts two vectors (by celeron55)
      • mul( v, u ) - multiples two vectors (by celeron55)
  • world [world.lua] - namespace
    • get_surface( x, z ) - get surface of terrain for x/z coordinates (by Sapier)
    • node_owner( pos ) - get the name of that node's owner (by VanessaE)