diff options
author | Mattes D <github@xoft.cz> | 2017-06-24 11:58:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-24 11:58:06 +0200 |
commit | fe4253834919d6c742c59c701d3d5ce8285f4504 (patch) | |
tree | c201ca7a02344029679d4addffb695a3d20c4bec /Server/Plugins/APIDump/Classes/World.lua | |
parent | Load entities from old and new names (diff) | |
download | cuberite-fe4253834919d6c742c59c701d3d5ce8285f4504.tar cuberite-fe4253834919d6c742c59c701d3d5ce8285f4504.tar.gz cuberite-fe4253834919d6c742c59c701d3d5ce8285f4504.tar.bz2 cuberite-fe4253834919d6c742c59c701d3d5ce8285f4504.tar.lz cuberite-fe4253834919d6c742c59c701d3d5ce8285f4504.tar.xz cuberite-fe4253834919d6c742c59c701d3d5ce8285f4504.tar.zst cuberite-fe4253834919d6c742c59c701d3d5ce8285f4504.zip |
Diffstat (limited to 'Server/Plugins/APIDump/Classes/World.lua')
-rw-r--r-- | Server/Plugins/APIDump/Classes/World.lua | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Server/Plugins/APIDump/Classes/World.lua b/Server/Plugins/APIDump/Classes/World.lua index 3ba2d82ca..1614886fd 100644 --- a/Server/Plugins/APIDump/Classes/World.lua +++ b/Server/Plugins/APIDump/Classes/World.lua @@ -532,7 +532,7 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i Type = "boolean", }, }, - Notes = "If there is a block entity at the specified coords, calls the CallbackFunction with the {{cBlockEntity}} parameter representing the block entity. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}})</pre> The function returns false if there is no block entity, or if there is, it returns the bool value that the callback has returned. Use {{tolua}}.cast() to cast the Callback's BlockEntity parameter to the correct {{cBlockEntity}} descendant.", + Notes = "If there is a block entity at the specified coords, calls the CallbackFunction with the {{cBlockEntity}} parameter representing the block entity. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}})</pre> The function returns false if there is no block entity, or if there is, it returns the bool value that the callback has returned.", }, DoWithBrewingstandAt = { @@ -978,7 +978,7 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i Type = "boolean", }, }, - Notes = "Calls the specified callback for each block entity in the chunk. Returns true if all block entities in the chunk have been processed (including when there are zero block entities), or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}})</pre> The callback should return false or no value to continue with the next block entity, or true to abort the enumeration. Use {{tolua}}.cast() to cast the Callback's BlockEntity parameter to the correct {{cBlockEntity}} descendant.", + Notes = "Calls the specified callback for each block entity in the chunk. Returns true if all block entities in the chunk have been processed (including when there are zero block entities), or false if the callback has aborted the enumeration by returning true. The CallbackFunction has the following signature: <pre class=\"prettyprint lang-lua\">function Callback({{cBlockEntity|BlockEntity}})</pre> The callback should return false or no value to continue with the next block entity, or true to abort the enumeration.", }, ForEachBrewingstandInChunk = { @@ -3364,10 +3364,9 @@ World:ForEachEntity( return; end - -- Get the cMonster out of cEntity, now that we know the entity represents one. - local Monster = tolua.cast(a_Entity, "cMonster"); - if (Monster:GetMobType() == mtSpider) then - Monster:TeleportToCoords(Monster:GetPosX(), Monster:GetPosY() + 100, Monster:GetPosZ()); + -- Now that we know the entity represents a mob, we can use cMonster functions: + if (a_Entity:GetMobType() == mtSpider) then + a_Entity:TeleportToCoords(a_Entity:GetPosX(), a_Entity:GetPosY() + 100, a_Entity:GetPosZ()); end end ); |