aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_item.cpp
diff options
context:
space:
mode:
authorDániel Juhász <juhdanad@gmail.com>2018-02-10 22:04:16 +0200
committerSmallJoker <SmallJoker@users.noreply.github.com>2018-02-10 21:04:16 +0100
commit3face01a202040e4feff3b0936b4aa89c051c98d (patch)
treeccdad6773aa9705cc07fdc9f71f28bae395f353e /src/script/lua_api/l_item.cpp
parent617d94c8038e3ff035eaeef7ccdfa4f442feb873 (diff)
downloadminetest-3face01a202040e4feff3b0936b4aa89c051c98d.tar.gz
minetest-3face01a202040e4feff3b0936b4aa89c051c98d.tar.bz2
minetest-3face01a202040e4feff3b0936b4aa89c051c98d.zip
Node definition manager refactor (#7016)
* Rename IWritableNodeDefManager to NodeDefManager * Make INodeDefManager functions const * Use "const *NodeDefManager" instead of "*INodeDefManager" * Remove unused INodeDefManager class * Merge NodeDefManager and CNodeDefManager * Document NodeDefManager
Diffstat (limited to 'src/script/lua_api/l_item.cpp')
-rw-r--r--src/script/lua_api/l_item.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/script/lua_api/l_item.cpp b/src/script/lua_api/l_item.cpp
index 207a04c6c..d7e9f0a5b 100644
--- a/src/script/lua_api/l_item.cpp
+++ b/src/script/lua_api/l_item.cpp
@@ -501,7 +501,7 @@ int ModApiItemMod::l_register_item_raw(lua_State *L)
// Get the writable item and node definition managers from the server
IWritableItemDefManager *idef =
getServer(L)->getWritableItemDefManager();
- IWritableNodeDefManager *ndef =
+ NodeDefManager *ndef =
getServer(L)->getWritableNodeDefManager();
// Check if name is defined
@@ -561,7 +561,7 @@ int ModApiItemMod::l_unregister_item_raw(lua_State *L)
// Unregister the node
if (idef->get(name).type == ITEM_NODE) {
- IWritableNodeDefManager *ndef =
+ NodeDefManager *ndef =
getServer(L)->getWritableNodeDefManager();
ndef->removeNode(name);
}
@@ -593,7 +593,7 @@ int ModApiItemMod::l_get_content_id(lua_State *L)
NO_MAP_LOCK_REQUIRED;
std::string name = luaL_checkstring(L, 1);
- INodeDefManager *ndef = getGameDef(L)->getNodeDefManager();
+ const NodeDefManager *ndef = getGameDef(L)->getNodeDefManager();
content_t c = ndef->getId(name);
lua_pushinteger(L, c);
@@ -606,7 +606,7 @@ int ModApiItemMod::l_get_name_from_content_id(lua_State *L)
NO_MAP_LOCK_REQUIRED;
content_t c = luaL_checkint(L, 1);
- INodeDefManager *ndef = getGameDef(L)->getNodeDefManager();
+ const NodeDefManager *ndef = getGameDef(L)->getNodeDefManager();
const char *name = ndef->get(c).name.c_str();
lua_pushstring(L, name);