summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2020-10-09 18:25:34 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-10-09 19:39:20 +0200
commit6ddc03db0957f9654a9720a00937f3d2450c4868 (patch)
tree5bb606e74ae7b7740b0c53f83092ed3790e331c4
parentInclude sys/select.h on non-glibc Linux platforms (#4977) (diff)
downloadcuberite-6ddc03db0957f9654a9720a00937f3d2450c4868.tar
cuberite-6ddc03db0957f9654a9720a00937f3d2450c4868.tar.gz
cuberite-6ddc03db0957f9654a9720a00937f3d2450c4868.tar.bz2
cuberite-6ddc03db0957f9654a9720a00937f3d2450c4868.tar.lz
cuberite-6ddc03db0957f9654a9720a00937f3d2450c4868.tar.xz
cuberite-6ddc03db0957f9654a9720a00937f3d2450c4868.tar.zst
cuberite-6ddc03db0957f9654a9720a00937f3d2450c4868.zip
Diffstat (limited to '')
-rw-r--r--Server/Plugins/APIDump/Classes/World.lua52
-rw-r--r--src/World.h4
2 files changed, 42 insertions, 14 deletions
diff --git a/Server/Plugins/APIDump/Classes/World.lua b/Server/Plugins/APIDump/Classes/World.lua
index b86a84e71..acfa05727 100644
--- a/Server/Plugins/APIDump/Classes/World.lua
+++ b/Server/Plugins/APIDump/Classes/World.lua
@@ -541,28 +541,56 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
},
DigBlock =
{
- Params =
{
+ Params =
{
- Name = "X",
- Type = "number",
- },
- {
- Name = "Y",
- Type = "number",
+ {
+ Name = "X",
+ Type = "number",
+ },
+ {
+ Name = "Y",
+ Type = "number",
+ },
+ {
+ Name = "Z",
+ Type = "number",
+ },
+ {
+ Name = "Digger",
+ Type = "cEntity",
+ IsOptional = true,
+ },
},
+ Returns =
{
- Name = "Z",
- Type = "number",
+ {
+ Type = "boolean",
+ },
},
+ Notes = "Replaces the specified block with air, without dropping the usual pickups for the block. Wakes up the simulators for the block and its neighbors. The optional Digger parameter specifies the entity who dug the block, usually a player. Returns true on success, or false if the chunk is not loaded or invalid coords. See also DropBlockAsPickups() for the version that drops pickups.",
},
- Returns =
{
+ Params =
{
- Type = "boolean",
+ {
+ Name = "BlockPos",
+ Type = "Vector3i",
+ },
+ {
+ Name = "Digger",
+ Type = "cEntity",
+ IsOptional = true,
+ },
+ },
+ Returns =
+ {
+ {
+ Type = "boolean",
+ },
},
+ Notes = "Replaces the specified block with air, without dropping the usual pickups for the block. Wakes up the simulators for the block and its neighbors. The optional Digger parameter specifies the entity who dug the block, usually a player. Returns true on success, or false if the chunk is not loaded or invalid coords. See also DropBlockAsPickups() for the version that drops pickups.",
},
- Notes = "Replaces the specified block with air, without dropping the usual pickups for the block. Wakes up the simulators for the block and its neighbors. Returns true on success, or false if the chunk is not loaded or invalid coords. See also DropBlockAsPickups() for the version that drops pickups.",
},
DoExplosionAt =
{
diff --git a/src/World.h b/src/World.h
index a0e2d0dbc..2ff8fbe29 100644
--- a/src/World.h
+++ b/src/World.h
@@ -667,14 +667,14 @@ public:
/** Replaces the specified block with air, and calls the OnBroken block handler.
Wakes up the simulators. Doesn't produce pickups, use DropBlockAsPickups() for that instead.
Returns true on success, false if the chunk is not loaded. */
- bool DigBlock(Vector3i a_BlockPos, const cEntity * a_Digger);
+ bool DigBlock(Vector3i a_BlockPos, const cEntity * a_Digger = nullptr);
/** OBSOLETE, use the Vector3-based overload instead.
Replaces the specified block with air, and calls the apropriate block handlers (OnBreaking(), OnBroken()).
Wakes up the simulators.
Doesn't produce pickups, use DropBlockAsPickups() for that instead.
Returns true on success, false if the chunk is not loaded. */
- bool DigBlock(int a_X, int a_Y, int a_Z, cEntity * a_Digger)
+ bool DigBlock(int a_X, int a_Y, int a_Z, cEntity * a_Digger = nullptr)
{
return DigBlock({a_X, a_Y, a_Z}, a_Digger);
}