summaryrefslogtreecommitdiffstats
path: root/src/World.cpp
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2014-11-02 21:01:23 +0100
committerLukas Pioch <lukas@zgow.de>2014-11-02 21:01:23 +0100
commit9f71a4e7aec04c4c7fa57ac4b82f27a21044f798 (patch)
tree25761b6d78453e356cab4debd1db8348e50c0a7c /src/World.cpp
parentMerge pull request #1569 from mc-server/GrownBiomes (diff)
downloadcuberite-9f71a4e7aec04c4c7fa57ac4b82f27a21044f798.tar
cuberite-9f71a4e7aec04c4c7fa57ac4b82f27a21044f798.tar.gz
cuberite-9f71a4e7aec04c4c7fa57ac4b82f27a21044f798.tar.bz2
cuberite-9f71a4e7aec04c4c7fa57ac4b82f27a21044f798.tar.lz
cuberite-9f71a4e7aec04c4c7fa57ac4b82f27a21044f798.tar.xz
cuberite-9f71a4e7aec04c4c7fa57ac4b82f27a21044f798.tar.zst
cuberite-9f71a4e7aec04c4c7fa57ac4b82f27a21044f798.zip
Diffstat (limited to 'src/World.cpp')
-rw-r--r--src/World.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/World.cpp b/src/World.cpp
index 2e079d447..212566194 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -2729,6 +2729,28 @@ bool cWorld::FindAndDoWithPlayer(const AString & a_PlayerNameHint, cPlayerListCa
+bool cWorld::FindAndDoWithUUID(const AString & a_PlayerUUID, cPlayerListCallback & a_Callback)
+{
+ cPlayer * FoundPlayer = nullptr;
+ cCSLock Lock(m_CSPlayers);
+ for (cPlayerList::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
+ {
+ if ((*itr)->GetUUID() == a_PlayerUUID) { // Match found and exit
+ FoundPlayer = *itr;
+ break;
+ }
+ }
+ if (FoundPlayer != nullptr)
+ {
+ return a_Callback.Item (FoundPlayer);
+ }
+ return false;
+}
+
+
+
+
+
// TODO: This interface is dangerous!
cPlayer * cWorld::FindClosestPlayer(const Vector3d & a_Pos, float a_SightLimit, bool a_CheckLineOfSight)
{