summaryrefslogtreecommitdiffstats
path: root/src/Bindings
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-08-21 15:19:30 +0200
committerMattes D <github@xoft.cz>2014-08-21 15:19:30 +0200
commit936604ca95d8e639a6783f9931093b689ce103d9 (patch)
tree20d829009cd4e6146ee716fc67a70069c514c2a7 /src/Bindings
parentUpdated the Core. (diff)
downloadcuberite-936604ca95d8e639a6783f9931093b689ce103d9.tar
cuberite-936604ca95d8e639a6783f9931093b689ce103d9.tar.gz
cuberite-936604ca95d8e639a6783f9931093b689ce103d9.tar.bz2
cuberite-936604ca95d8e639a6783f9931093b689ce103d9.tar.lz
cuberite-936604ca95d8e639a6783f9931093b689ce103d9.tar.xz
cuberite-936604ca95d8e639a6783f9931093b689ce103d9.tar.zst
cuberite-936604ca95d8e639a6783f9931093b689ce103d9.zip
Diffstat (limited to 'src/Bindings')
-rw-r--r--src/Bindings/ManualBindings.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index a60408910..834f6e073 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -2414,6 +2414,62 @@ static int tolua_cMojangAPI_GetUUIDsFromPlayerNames(lua_State * L)
+static int tolua_cMojangAPI_MakeUUIDDashed(lua_State * L)
+{
+ // Function signature: cMojangAPI:MakeUUIDDashed(UUID) -> string
+
+ // Check params:
+ cLuaState S(L);
+ if (
+ !S.CheckParamUserTable(1, "cMojangAPI") ||
+ !S.CheckParamString(2) ||
+ !S.CheckParamEnd(3)
+ )
+ {
+ return 0;
+ }
+
+ // Get the params:
+ AString UUID;
+ S.GetStackValue(2, UUID);
+
+ // Push the result:
+ S.Push(cRoot::Get()->GetMojangAPI().MakeUUIDDashed(UUID));
+ return 1;
+}
+
+
+
+
+
+static int tolua_cMojangAPI_MakeUUIDShort(lua_State * L)
+{
+ // Function signature: cMojangAPI:MakeUUIDShort(UUID) -> string
+
+ // Check params:
+ cLuaState S(L);
+ if (
+ !S.CheckParamUserTable(1, "cMojangAPI") ||
+ !S.CheckParamString(2) ||
+ !S.CheckParamEnd(3)
+ )
+ {
+ return 0;
+ }
+
+ // Get the params:
+ AString UUID;
+ S.GetStackValue(2, UUID);
+
+ // Push the result:
+ S.Push(cRoot::Get()->GetMojangAPI().MakeUUIDShort(UUID));
+ return 1;
+}
+
+
+
+
+
static int Lua_ItemGrid_GetSlotCoords(lua_State * L)
{
tolua_Error tolua_err;
@@ -3355,6 +3411,8 @@ void ManualBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "GetPlayerNameFromUUID", tolua_cMojangAPI_GetPlayerNameFromUUID);
tolua_function(tolua_S, "GetUUIDFromPlayerName", tolua_cMojangAPI_GetUUIDFromPlayerName);
tolua_function(tolua_S, "GetUUIDsFromPlayerNames", tolua_cMojangAPI_GetUUIDsFromPlayerNames);
+ tolua_function(tolua_S, "MakeUUIDDashed", tolua_cMojangAPI_MakeUUIDDashed);
+ tolua_function(tolua_S, "MakeUUIDShort", tolua_cMojangAPI_MakeUUIDShort);
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S, "cItemGrid");