]> git.lizzy.rs Git - dragonblocks.git/commitdiff
Added more detailed info about some methods to the documentation
authorHimbeerserverDE <lpaschek@icloud.com>
Tue, 19 May 2020 13:36:36 +0000 (15:36 +0200)
committerHimbeerserverDE <lpaschek@icloud.com>
Tue, 19 May 2020 13:36:36 +0000 (15:36 +0200)
doc/API.md

index 6a0d10988a4b3093665031ac76698e8f0459b8e4..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,6 +48,7 @@ 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
@@ -50,11 +58,13 @@ TODO: This Documentation is unfull and partly deprecated!
                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
@@ -100,36 +110,3 @@ TODO: This Documentation is unfull and partly deprecated!
                        List of saved worlds of logged-in user
 ##     Classes
        
-## Modding tutorial
-###    dragonblocks.register method
-####   dragonblocks.registerEntity
-               dragonblocks.registerEntity({
-                       name: "mod_tutorial:entity", // Entitystring
-                       desc: "Tutorial entity", // Entity description
-                       texture: "entity.png", // Entity texture
-                       width: 1, // Entity width
-                       height: 2, // Entity height
-                       verticalSpeed: 6.5, // Entity jump speed (affects height)
-                       horizontalSpeed: 4, // Entity walk speed
-                       gravity: true, // Enable or disable gravity
-                       onspawn: self => {
-                               alert("Entity spawned!");
-                       }
-                       onpunch: self => {
-                               alert("Entity punched!");
-                               self.despawn(); // Let entity despawn
-                       }
-                       onclick: self => {
-                               alert("Entity clicked!");
-                               self.jumpOnce(); // Make entity jump once
-                       }
-               });
-####   dragonblocks.registerItem
-               dragonblocks.registerItem({
-                       name: "mod_tutorial:item", // Itemstring
-                       desc: "Tutorial entity spawner", // Item description
-                       texture: "item.png", // Item texture
-                       onuse: (x, y) => {
-                               let entity = dragonblocks.spawnEntity("mod_tutorial:entity", x, y); // Spawn entity and save it to a variable (for later access)
-                       }
-               });