]> git.lizzy.rs Git - dragonblocks.git/blobdiff - doc/API.md
Added more detailed info about some methods to the documentation
[dragonblocks.git] / doc / API.md
index b6afb802eac7e760494f0b61555dbd5fc3848c11..7f21f956b8714f294172ee541a84744bbf036d07 100644 (file)
@@ -6,13 +6,15 @@ TODO: This Documentation is unfull and partly deprecated!
                dragonblocks.chatMessage(message : String) : void
                        Write something into the chatconsole. (alias for dragonblocks.chat.write)
                dragonblocks.checkWorldExistance(worldname : String) : Boolean
-                       Check if a world exists or not
+                       Check if a world exists or not (secure check)
                dragonblocks.checkWorldOwnership(worldname : String) : Boolean
-                       Check if a world is owned by the user
+                       Check if a world is owned by the current user (secure check)
                dragonblocks.checkWorldSpelling(worldname : String) : Boolean
                        Check if a worldname is OK (e.g. does not contain special chacters)
                dragonblocks.clearTimer(name : String, meta : Object) : void
                        Clear a timer set using  dragonblocks.setTimer
+                       meta is the variable the timer is stored in
+                       name is the timer's name (also stored in meta[name] while the timer is running)
                dragonblocks.createItemstack(itemstring : String) : dragonblocks.Itemstack
                        Create an Itemstack object and immediately parse the provided itemstring.
                dragonblocks.createWorld(properties : Object) : void
@@ -23,6 +25,8 @@ TODO: This Documentation is unfull and partly deprecated!
                        Execute the final steps added using dragonblocks.addFinalStep. Not to be used!
                dragonblocks.finishTimer(name : String, meta : Object) : void
                        Immediately finish a timer set using dragonblocks.setTimer
+                       meta is the variable the timer is stored in
+                       name is the timer's name (also stored in meta[name] while the timer is running)
                dragonblocks.generateMap() : void
                        Run the Mapgen selected in the mainmenu. Not to be used.
                dragonblocks.getEmptyWorld() : Object
@@ -31,8 +35,11 @@ TODO: This Documentation is unfull and partly deprecated!
                        Returns the path of an Mod or Gamemod. Use this instead of e.g. "mods/" + modname + "/" + ...
                dragonblocks.getNode(x, y) : dragonblocks.MapNode
                        Returns the MapNode at x, y.
+                       You can use the object to read its properties.
                dragonblocks.getPixelManipulator(manip : Array) : dragonblocks.PixelManipulator
                        Returns an Pixel Manipulator. Same as new dragonblocks.PixelManipulator(manip)
+                       You have to provide a Pixel Manipulator which is then made usable by this function.
+                       For further information on how to use Pixel Manipulators, consult Pixel_Manipulator.md
                dragonblocks.getSavestring() : String
                        Return the save string for the world
                dragonblocks.getSound(filename : String) : String
@@ -41,18 +48,23 @@ TODO: This Documentation is unfull and partly deprecated!
                        Same as dragonblocks.getSound, exept for Textures and, if the file is found, it will surrond it with url() so you can do elem.style.background = dragonblocks.getTexture(...)
                dragonblocks.getToken() : String
                        Returns a unique string starting with #
+                       Useful when working with entities as they all need an ID
                dragonblocks.getTool(name : String) : dragonblocks.Tool
                        Returns the tool with the id "name".
                dragonblocks.getVersion() : String
                        Returns the version string (something like "Dragonblocks 3.0")
                dragonblocks.isValidItemstring(itemstring : String)
                        Check if an Itemstring is OK
+               dragonblocks.log(message : String) : void
+                       Add a message to the backlog.
                dragonblocks.gui.toggleLayer() : void
-                       Toggle the Layer. 
+                       Toggle (show or hide) the Layer. 
                dragonblocks.gui.openLayer() : void
+                       Not implemented yet
                dragonblocks.gui.showLayer() : void
-                       Open the Layer
+                       Show the Layer
                dragonblocks.gui.closeLayer() : void
+                       Not implemented yet
                dragonblocks.gui.hideLayer() : void
                        Hide the Layer
                dragonblocks.gui.createBox(properties : Object) : Element
@@ -80,5 +92,21 @@ TODO: This Documentation is unfull and partly deprecated!
                        Contains all created Itemstacks
                dragonblocks.keyHandler: dragonblocks.KeyHandler
                        The Keyhandler
-       Classes
-        
+               dragonblocks.mods : Array
+                       Contains all loaded mods
+               dragonblocks.nodes : Object
+                       Contains all registered nodes
+               dragonblocks.recipes : Array
+                       Contains all registered recipes
+               dragonblocks.settings : Object
+                       Contains all dragonblocks settings
+               dragonblocks.skins : Object
+                       Contains all registered skins
+               dragonblocks.spawnedEntities : Array
+                       Contains all spawned entities
+               dragonblocks.tools : Object
+                       Contains all registered tools
+               dragonblocks.worlds : Array
+                       List of saved worlds of logged-in user
+##     Classes
+