summaryrefslogtreecommitdiffstats
path: root/Server/Plugins/APIDump/Hooks
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-12-16 15:04:47 +0100
committerMattes D <github@xoft.cz>2015-12-18 12:40:34 +0100
commit086c8b1834bfca6a4af912abbd13fd570f7b0b33 (patch)
tree7e95f9e8102c3cc7910c7a513e4cc77bce764aed /Server/Plugins/APIDump/Hooks
parentMerge pull request #2770 from cuberite/RemoveChunkDataCollector (diff)
downloadcuberite-086c8b1834bfca6a4af912abbd13fd570f7b0b33.tar
cuberite-086c8b1834bfca6a4af912abbd13fd570f7b0b33.tar.gz
cuberite-086c8b1834bfca6a4af912abbd13fd570f7b0b33.tar.bz2
cuberite-086c8b1834bfca6a4af912abbd13fd570f7b0b33.tar.lz
cuberite-086c8b1834bfca6a4af912abbd13fd570f7b0b33.tar.xz
cuberite-086c8b1834bfca6a4af912abbd13fd570f7b0b33.tar.zst
cuberite-086c8b1834bfca6a4af912abbd13fd570f7b0b33.zip
Diffstat (limited to 'Server/Plugins/APIDump/Hooks')
-rw-r--r--Server/Plugins/APIDump/Hooks/OnExploded.lua17
-rw-r--r--Server/Plugins/APIDump/Hooks/OnExploding.lua23
2 files changed, 9 insertions, 31 deletions
diff --git a/Server/Plugins/APIDump/Hooks/OnExploded.lua b/Server/Plugins/APIDump/Hooks/OnExploded.lua
index 6a01542ab..daca31237 100644
--- a/Server/Plugins/APIDump/Hooks/OnExploded.lua
+++ b/Server/Plugins/APIDump/Hooks/OnExploded.lua
@@ -11,20 +11,7 @@ return
<p>
The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT,
etc. It also carries the identification of the actual source. The exact type of the identification
- depends on the source kind:
- <table>
- <tr><th>Source</th><th>SourceData Type</th><th>Notes</th></tr>
- <tr><td>esPrimedTNT</td><td>{{cTNTEntity}}</td><td>An exploding primed TNT entity</td></tr>
- <tr><td>esCreeper</td><td>{{cCreeper}}</td><td>An exploding creeper or charged creeper</td></tr>
- <tr><td>esBed</td><td>{{Vector3i}}</td><td>A bed exploding in the Nether or in the End. The bed coords are given.</td></tr>
- <tr><td>esEnderCrystal</td><td>{{Vector3i}}</td><td>An ender crystal exploding upon hit. The block coords are given.</td></tr>
- <tr><td>esGhastFireball</td><td>{{cGhastFireballEntity}}</td><td>A ghast fireball hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherSkullBlack</td><td><i>TBD</i></td><td>A black wither skull hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherSkullBlue</td><td><i>TBD</i></td><td>A blue wither skull hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherBirth</td><td><i>TBD</i></td><td>A wither boss being created</td></tr>
- <tr><td>esOther</td><td><i>TBD</i></td><td>Any other previously unspecified type.</td></tr>
- <tr><td>esPlugin</td><td>object</td><td>An explosion created by a plugin. The plugin may specify any kind of data.</td></tr>
- </table></p>
+ depends on the source kind, see the {{Globals#ExplosionSource|esXXX}} constants' descriptions for details.
]],
Params =
{
@@ -35,7 +22,7 @@ return
{ Name = "Y", Type = "number", Notes = "Y-coord of the explosion center" },
{ Name = "Z", Type = "number", Notes = "Z-coord of the explosion center" },
{ Name = "Source", Type = "eExplosionSource", Notes = "Source of the explosion. See the table above." },
- { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the table above." },
+ { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the {{Globals#ExplosionSource|esXXX}} constants' descriptions." },
},
Returns = [[
If the function returns false or no value, the next plugin's callback is called. If the function
diff --git a/Server/Plugins/APIDump/Hooks/OnExploding.lua b/Server/Plugins/APIDump/Hooks/OnExploding.lua
index e21b41be0..873202dc3 100644
--- a/Server/Plugins/APIDump/Hooks/OnExploding.lua
+++ b/Server/Plugins/APIDump/Hooks/OnExploding.lua
@@ -11,20 +11,7 @@ return
<p>
The explosion carries with it the type of its source - whether it's a creeper exploding, or TNT,
etc. It also carries the identification of the actual source. The exact type of the identification
- depends on the source kind:
- <table>
- <tr><th>Source</th><th>SourceData Type</th><th>Notes</th></tr>
- <tr><td>esPrimedTNT</td><td>{{cTNTEntity}}</td><td>An exploding primed TNT entity</td></tr>
- <tr><td>esCreeper</td><td>{{cCreeper}}</td><td>An exploding creeper or charged creeper</td></tr>
- <tr><td>esBed</td><td>{{Vector3i}}</td><td>A bed exploding in the Nether or in the End. The bed coords are given.</td></tr>
- <tr><td>esEnderCrystal</td><td>{{Vector3i}}</td><td>An ender crystal exploding upon hit. The block coords are given.</td></tr>
- <tr><td>esGhastFireball</td><td>{{cGhastFireballEntity}}</td><td>A ghast fireball hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherSkullBlack</td><td><i>TBD</i></td><td>A black wither skull hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherSkullBlue</td><td><i>TBD</i></td><td>A blue wither skull hitting ground or an {{cEntity|entity}}.</td></tr>
- <tr><td>esWitherBirth</td><td><i>TBD</i></td><td>A wither boss being created</td></tr>
- <tr><td>esOther</td><td><i>TBD</i></td><td>Any other previously unspecified type.</td></tr>
- <tr><td>esPlugin</td><td>object</td><td>An explosion created by a plugin. The plugin may specify any kind of data.</td></tr>
- </table></p>
+ depends on the source kind, see the {{Globals#ExplosionSource|esXXX}} constants' descriptions for details
]],
Params =
{
@@ -35,12 +22,16 @@ return
{ Name = "Y", Type = "number", Notes = "Y-coord of the explosion center" },
{ Name = "Z", Type = "number", Notes = "Z-coord of the explosion center" },
{ Name = "Source", Type = "eExplosionSource", Notes = "Source of the explosion. See the table above." },
- { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the table above." },
+ { Name = "SourceData", Type = "varies", Notes = "Additional data for the source. The exact type varies by the source. See the {{Globals#ExplosionSource|esXXX}} constants' description." },
},
Returns = [[
If the function returns false or no value, the next plugin's callback is called, and finally
Cuberite will process the explosion - destroy blocks and push + hurt entities. If the function
- returns true, no other callback is called for this event and the explosion will not occur.
+ returns true, no other callback is called for this event and the explosion will not occur.</p>
+ <p>
+ The hook handler may return up to two more values after the initial bool. The second returned value
+ overrides the CanCauseFire parameter for subsequent hook calls and the final explosion, the third
+ returned value overrides the ExplosionSize parameter for subsequent hook calls and the final explosion.
]],
}, -- HOOK_EXPLODING
}