print(dump(itemstack:get_count()))
print(dump(itemstack:get_wear()))
print(dump(itemstack:get_meta()))
- print(dump(itemstack:get_metadata()))
+ print(dump(itemstack:get_metadata()
print(dump(itemstack:is_known()))
--print(dump(itemstack:get_definition()))
print(dump(itemstack:get_tool_capabilities()))
print("node:" .. dump(node))
return false
end)
+
+-- This is an example function to ensure it's working properly, should be removed before merge
+core.register_chatcommand("list_players", {
+ func = function(param)
+ core.display_chat_message(dump(core.get_player_names()))
+ end
+})
* `minetest.get_wielded_item()`
* Returns the itemstack the local player is holding
+### Client Environment
+* `minetest.get_player_names()`
+ * Returns list of player names on server
+
### Misc.
* `minetest.parse_json(string[, nullvalue])`: returns something
* Convert a string containing JSON data into the Lua equivalent
[CSS Color Module Level 4](http://dev.w3.org/csswg/css-color/#named-colors).
To specify the value of the alpha channel, append `#AA` to the end of the color name
(e.g. `colorname#08`). For named colors the hexadecimal string representing the alpha
-value must (always) be two hexadecima
\ No newline at end of file
+value must (always) be two hexadecima
return 1;
}
+// get_player_names()
+int ModApiClient::l_get_player_names(lua_State *L)
+{
+ const std::list<std::string> &plist = getClient(L)->getConnectedPlayerNames();
+ lua_createtable(L, plist.size(), 0);
+ int newTable = lua_gettop(L);
+ int index = 1;
+ std::list<std::string>::const_iterator iter;
+ for (iter = plist.begin(); iter != plist.end(); iter++) {
+ lua_pushstring(L, (*iter).c_str());
+ lua_rawseti(L, newTable, index);
+ index++;
+ }
+ return 1;
+}
+
// show_formspec(formspec)
int ModApiClient::l_show_formspec(lua_State *L)
{
{
API_FCT(get_current_modname);
API_FCT(display_chat_message);
+ API_FCT(get_player_names);
API_FCT(set_last_run_mod);
API_FCT(get_last_run_mod);
API_FCT(show_formspec);
// display_chat_message(message)
static int l_display_chat_message(lua_State *L);
+
+ // get_player_names()
+ static int l_get_player_names(lua_State *L);
// show_formspec(name, fornspec)
static int l_show_formspec(lua_State *L);