From c0f091b1a38d90870d369af8cb5ceabdb59fc52d Mon Sep 17 00:00:00 2001 From: STRWarrior Date: Sat, 7 Dec 2013 14:26:52 +0100 Subject: Added a SpawnFallingBlock function so plugins can make other blocks fall. --- src/World.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/World.cpp') diff --git a/src/World.cpp b/src/World.cpp index 7982924ae..29fa8f9e4 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -14,6 +14,7 @@ // Entities (except mobs): #include "Entities/ExpOrb.h" +#include "Entities/FallingBlock.h" #include "Entities/Pickup.h" #include "Entities/Player.h" #include "Entities/TNTEntity.h" @@ -1617,6 +1618,17 @@ void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double +int 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); + FallingBlock->Initialize(this); + return FallingBlock->GetUniqueID(); +} + + + + + int cWorld::SpawnExperienceOrb(double a_X, double a_Y, double a_Z, int a_Reward) { cExpOrb * ExpOrb = new cExpOrb(a_X, a_Y, a_Z, a_Reward); -- cgit v1.2.3