summaryrefslogtreecommitdiffstats
path: root/src/World.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2020-04-09 22:25:20 +0200
committerGitHub <noreply@github.com>2020-04-09 22:25:20 +0200
commitbdedab15c94956cbc74045ab242fd300d25f39e7 (patch)
tree900c4e7f662388e29405ccf059fcab767bbd8046 /src/World.h
parentWolves and mooshrooms are passive mobs (diff)
downloadcuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.gz
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.bz2
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.lz
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.xz
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.tar.zst
cuberite-bdedab15c94956cbc74045ab242fd300d25f39e7.zip
Diffstat (limited to '')
-rw-r--r--src/World.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/World.h b/src/World.h
index b46440410..4b0947003 100644
--- a/src/World.h
+++ b/src/World.h
@@ -564,14 +564,22 @@ public:
/** Spawns an falling block entity at the given position.
Returns the UniqueID of the spawned falling block, or cEntity::INVALID_ID on failure. */
- UInt32 SpawnFallingBlock(Vector3i a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
+ UInt32 SpawnFallingBlock(Vector3d a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
- /** OBSOLETE, use the Vector3i-based overload instead.
+ /** Spawns an falling block entity at the given position.
+ Returns the UniqueID of the spawned falling block, or cEntity::INVALID_ID on failure. */
+ UInt32 SpawnFallingBlock(Vector3i a_BlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
+ {
+ // When creating from a block position (Vector3i), move the spawn point to the middle of the block by adding (0.5, 0, 0.5)
+ return SpawnFallingBlock(Vector3d(0.5, 0, 0.5) + a_BlockPos, a_BlockType, a_BlockMeta);
+ }
+
+ /** OBSOLETE, use the Vector3-based overload instead.
Spawns an falling block entity at the given position.
Returns the UniqueID of the spawned falling block, or cEntity::INVALID_ID on failure. */
UInt32 SpawnFallingBlock(int a_X, int a_Y, int a_Z, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
- return SpawnFallingBlock({a_X, a_Y, a_Z}, a_BlockType, a_BlockMeta);
+ return SpawnFallingBlock(Vector3i{a_X, a_Y, a_Z}, a_BlockType, a_BlockMeta);
}
/** Spawns an minecart at the given coordinates.