diff options
author | Lane Kolbly <lane@rscheme.org> | 2017-07-12 12:13:27 +0200 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-07-12 12:13:27 +0200 |
commit | 793acd267f4a5801e2aa9e9dca7cf51c5a595a02 (patch) | |
tree | 0e2740c09bfbbff7fb297f990ecca1b0090ddcc3 /src/World.cpp | |
parent | If entity is a player, send relmove packets. (diff) | |
download | cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.gz cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.bz2 cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.lz cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.xz cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.tar.zst cuberite-793acd267f4a5801e2aa9e9dca7cf51c5a595a02.zip |
Diffstat (limited to '')
-rw-r--r-- | src/World.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/World.cpp b/src/World.cpp index fa2116597..da7d8fb2d 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -2223,6 +2223,22 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double +UInt32 cWorld::SpawnItemPickup(double a_PosX, double a_PosY, double a_PosZ, const cItem & a_Item, float a_SpeedX, float a_SpeedY, float a_SpeedZ, int a_LifetimeTicks, bool a_CanCombine) +{ + cPickup * Pickup = new cPickup(a_PosX, a_PosY, a_PosZ, a_Item, false, a_SpeedX, a_SpeedY, a_SpeedZ, a_LifetimeTicks, a_CanCombine); + if (!Pickup->Initialize(*this)) + { + delete Pickup; + Pickup = nullptr; + return cEntity::INVALID_ID; + } + return Pickup->GetUniqueID(); +} + + + + + UInt32 cWorld::SpawnFallingBlock(int a_X, int a_Y, int a_Z, BLOCKTYPE BlockType, NIBBLETYPE BlockMeta) { cFallingBlock * FallingBlock = new cFallingBlock(Vector3i(a_X, a_Y, a_Z), BlockType, BlockMeta); |