summaryrefslogtreecommitdiffstats
path: root/src/World.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-07-29 20:30:38 +0200
committerTiger Wang <ziwei.tiger@outlook.com>2020-08-04 19:15:18 +0200
commit6bdd130aab51b630918ed664c4389cf33bcb2e06 (patch)
treeeed35c8716f9ea18afe8fd909c09e8595928a671 /src/World.h
parentDo not GetBlock individually in simulators (diff)
downloadcuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar
cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.gz
cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.bz2
cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.lz
cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.xz
cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.tar.zst
cuberite-6bdd130aab51b630918ed664c4389cf33bcb2e06.zip
Diffstat (limited to '')
-rw-r--r--src/World.h14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/World.h b/src/World.h
index 76c0fa3c9..b6936a9d5 100644
--- a/src/World.h
+++ b/src/World.h
@@ -661,22 +661,18 @@ public:
// tolua_end
- /** Performs the specified single-block set operations simultaneously, as if SetBlock() was called for each item.
- Is more efficient than calling SetBlock() multiple times.
+ /** Replaces the specified block with another, and calls the OnPlaced block handler.
+ Callers MUST ensure the replaced block was destroyed or can handle replacement correctly. Wakes up the simulators.
If the chunk for any of the blocks is not loaded, the set operation is ignored silently. */
- void SetBlocks(const sSetBlockVector & a_Blocks);
-
- /** Replaces world blocks with a_Blocks, if they are of type a_FilterBlockType */
- void ReplaceBlocks(const sSetBlockVector & a_Blocks, BLOCKTYPE a_FilterBlockType);
+ void PlaceBlock(const Vector3i a_Position, const BLOCKTYPE a_BlockType, const NIBBLETYPE a_BlockMeta);
/** Retrieves block types of the specified blocks. If a chunk is not loaded, doesn't modify the block. Returns true if all blocks were read. */
bool GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure);
// tolua_begin
- /** 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.
+ /** 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);