summaryrefslogtreecommitdiffstats
path: root/source/cWorld.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-24 09:58:26 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-24 09:58:26 +0200
commite92b9e7ecbdf2918aab59d4eeb7bb5966430b264 (patch)
tree1a998d44e5faab91c54ea8517dd9fa02b3732ef7 /source/cWorld.cpp
parentAdded plugin name to deprecation messages (diff)
downloadcuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.gz
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.bz2
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.lz
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.xz
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.tar.zst
cuberite-e92b9e7ecbdf2918aab59d4eeb7bb5966430b264.zip
Diffstat (limited to '')
-rw-r--r--source/cWorld.cpp35
1 files changed, 31 insertions, 4 deletions
diff --git a/source/cWorld.cpp b/source/cWorld.cpp
index f12f9f1a8..691d41889 100644
--- a/source/cWorld.cpp
+++ b/source/cWorld.cpp
@@ -723,9 +723,9 @@ void cWorld::TickSpawnMobs(float a_Dt)
if( Monster )
{
- Monster->Initialize( this );
- Monster->TeleportTo( SpawnPos.x, (double)(Height) + 2, SpawnPos.z );
- Monster->SpawnOn(0);
+ Monster->Initialize(this);
+ Monster->TeleportTo(SpawnPos.x, (double)(Height) + 2, SpawnPos.z);
+ BroadcastSpawn(*Monster);
}
}
@@ -1134,7 +1134,7 @@ void cWorld::GetBlockTypeMeta(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYP
void cWorld::SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed)
{
MTRand r1;
- a_FlyAwaySpeed /= 1000; // Pre-divide, so that we can don't have to divide each time inside the loop
+ a_FlyAwaySpeed /= 1000; // Pre-divide, so that we don't have to divide each time inside the loop
for (cItems::const_iterator itr = a_Pickups.begin(); itr != a_Pickups.end(); ++itr)
{
float SpeedX = (float)(a_FlyAwaySpeed * (r1.randInt(1000) - 500));
@@ -1390,6 +1390,33 @@ void cWorld::BroadcastMetadata(const cPawn & a_Pawn, const cClientHandle * a_Exc
+void cWorld::BroadcastSpawn(cEntity & a_Entity, const cClientHandle * a_Exclude)
+{
+ m_ChunkMap->BroadcastSpawn(a_Entity, a_Exclude);
+}
+
+
+
+
+
+void cWorld::BroadcastBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, const cClientHandle * a_Exclude)
+{
+ m_ChunkMap->BroadcastBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Exclude);
+}
+
+
+
+
+
+void cWorld::SendBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cClientHandle & a_Client)
+{
+ m_ChunkMap->SendBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Client);
+}
+
+
+
+
+
void cWorld::MarkChunkDirty (int a_ChunkX, int a_ChunkY, int a_ChunkZ)
{
m_ChunkMap->MarkChunkDirty (a_ChunkX, a_ChunkY, a_ChunkZ);