diff --git a/docs/API-Reference.md b/docs/API-Reference.md index 2c51379..95b3af8 100644 --- a/docs/API-Reference.md +++ b/docs/API-Reference.md @@ -114,6 +114,7 @@ Walter Higgins * [events.itemPickup()](#eventsitempickup) * [events.bedExit()](#eventsbedexit) * [events.blockPlace()](#eventsblockplace) + * [events.heldItemChange()](#eventshelditemchange) * [events.toolBroken()](#eventstoolbroken) * [events.kick()](#eventskick) * [events.playerDeath()](#eventsplayerdeath) @@ -1542,6 +1543,14 @@ The crucial difference is that the events module now has functions for each of t * priority - optional - see events.on() for more information. +### events.heldItemChange() + +#### Parameters + + * callback - A function which is called whenever the [player.HeldItemChangeHook event](https://ci.visualillusionsent.net/job/CanaryLib/javadoc/net/canarymod/hook/player/HeldItemChangeHook.html) is fired + + * priority - optional - see events.on() for more information. + ### events.toolBroken() #### Parameters @@ -5298,6 +5307,7 @@ See http://minecraft.gamepedia.com/Day-night_cycle#Conversions #### Parameters * world : the name of the world or world object for which you want to get time + ### utils.find() function The utils.find() function will return a list of all files starting at @@ -5318,7 +5328,6 @@ var jsFiles = utils.find('./', function(dir,name){ return name.match(/\.js$/); }); ``` - ### utils.serverAddress() function The utils.serverAddress() function returns the IP(v4) address of the server. diff --git a/src/main/js/modules/utils/utils.js b/src/main/js/modules/utils/utils.js index b7a36f4..8952e40 100644 --- a/src/main/js/modules/utils/utils.js +++ b/src/main/js/modules/utils/utils.js @@ -469,6 +469,7 @@ See http://minecraft.gamepedia.com/Day-night_cycle#Conversions #### Parameters * world : the name of the world or world object for which you want to get time + ***/ function getTime24( world ){ world = _world(world); // accept world name or object or undeifned @@ -499,7 +500,6 @@ var jsFiles = utils.find('./', function(dir,name){ return name.match(/\.js$/); }); ``` - ***/ exports.find = function( dir , filter ) { var result = []; @@ -564,7 +564,7 @@ all of Javascript's Array goodness. #### Example var utils = require('utils'); - var worlds = utils.array(server.worlds); + var worlds = utils.array(server.worldManager.getAllWorlds()); ***/ function toArray( ){