summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2016-07-21 13:00:30 +0200
committerMattes D <github@xoft.cz>2016-07-21 13:00:30 +0200
commita2a9341c24609e45e563427eecc1a927ee2b657a (patch)
tree47bb2d183d541d5f9611260c12eb3f002a07d6f9 /src/Root.cpp
parentCMake: Fix system Lua usage for non-5.1 versions. (#3271) (diff)
downloadcuberite-a2a9341c24609e45e563427eecc1a927ee2b657a.tar
cuberite-a2a9341c24609e45e563427eecc1a927ee2b657a.tar.gz
cuberite-a2a9341c24609e45e563427eecc1a927ee2b657a.tar.bz2
cuberite-a2a9341c24609e45e563427eecc1a927ee2b657a.tar.lz
cuberite-a2a9341c24609e45e563427eecc1a927ee2b657a.tar.xz
cuberite-a2a9341c24609e45e563427eecc1a927ee2b657a.tar.zst
cuberite-a2a9341c24609e45e563427eecc1a927ee2b657a.zip
Diffstat (limited to '')
-rw-r--r--src/Root.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/Root.cpp b/src/Root.cpp
index 1eca73cb2..09c91bc72 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -1006,3 +1006,33 @@ int cRoot::GetFurnaceFuelBurnTime(const cItem & a_Fuel)
cFurnaceRecipe * FR = Get()->GetFurnaceRecipe();
return FR->GetBurnTime(a_Fuel);
}
+
+
+
+
+
+AStringVector cRoot::GetPlayerTabCompletionMultiWorld(const AString & a_Text)
+{
+ AStringVector Results;
+ class cWorldCallback : public cWorldListCallback
+ {
+ public:
+ cWorldCallback(AStringVector & a_Results, const AString & a_Search) :
+ m_Results(a_Results),
+ m_Search(a_Search)
+ {
+ }
+
+ virtual bool Item(cWorld * a_World) override
+ {
+ a_World->TabCompleteUserName(m_Search, m_Results);
+ return true;
+ }
+ private:
+ AStringVector & m_Results;
+ const AString & m_Search;
+ } WC(Results, a_Text);
+
+ Get()->ForEachWorld(WC);
+ return Results;
+}