summaryrefslogtreecommitdiffstats
path: root/source/Player.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-08-14 10:24:34 +0200
committermadmaxoft <github@xoft.cz>2013-08-14 10:24:34 +0200
commit8c3837987bd5f74563790c15a1d52755383135ae (patch)
treeb91188a05d3a3053d5ad08cd7bb550c9d4b5518b /source/Player.cpp
parentExported cWorld:BroadcastChat() to the Lua API; used in the Core. (diff)
downloadcuberite-8c3837987bd5f74563790c15a1d52755383135ae.tar
cuberite-8c3837987bd5f74563790c15a1d52755383135ae.tar.gz
cuberite-8c3837987bd5f74563790c15a1d52755383135ae.tar.bz2
cuberite-8c3837987bd5f74563790c15a1d52755383135ae.tar.lz
cuberite-8c3837987bd5f74563790c15a1d52755383135ae.tar.xz
cuberite-8c3837987bd5f74563790c15a1d52755383135ae.tar.zst
cuberite-8c3837987bd5f74563790c15a1d52755383135ae.zip
Diffstat (limited to 'source/Player.cpp')
-rw-r--r--source/Player.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/source/Player.cpp b/source/Player.cpp
index 365a0396f..34980d2f6 100644
--- a/source/Player.cpp
+++ b/source/Player.cpp
@@ -100,6 +100,8 @@ cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
m_LastJumpHeight = (float)(GetPosY());
m_LastGroundHeight = (float)(GetPosY());
m_Stance = GetPosY() + 1.62;
+
+ cRoot::Get()->GetServer()->PlayerCreated(this);
}
@@ -1120,20 +1122,15 @@ bool cPlayer::MoveToWorld(const char * a_WorldName)
m_ClientHandle->RemoveFromAllChunks();
m_World->RemoveEntity(this);
+ // If the dimension is different, we can send the respawn packet
+ // http://wiki.vg/Protocol#0x09 says "don't send if dimension is the same" as of 2013_07_02
+ m_ClientHandle->MoveToWorld(*World, (OldDimension != World->GetDimension()));
+
// Add player to all the necessary parts of the new world
SetWorld(World);
World->AddEntity(this);
World->AddPlayer(this);
- // If the dimension is different, we can send the respawn packet
- // http://wiki.vg/Protocol#0x09 says "don't send if dimension is the same" as of 2013_07_02
- if (OldDimension != World->GetDimension())
- {
- m_ClientHandle->SendRespawn();
- }
-
- // Stream the new chunks:
- m_ClientHandle->StreamChunks();
return true;
}