diff options
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/common/c_content.cpp | 4 | ||||
-rw-r--r-- | src/script/common/c_content.h | 6 | ||||
-rw-r--r-- | src/script/cpp_api/s_client.cpp | 4 | ||||
-rw-r--r-- | src/script/cpp_api/s_node.cpp | 16 | ||||
-rw-r--r-- | src/script/cpp_api/s_nodemeta.cpp | 12 | ||||
-rw-r--r-- | src/script/lua_api/l_client.cpp | 2 | ||||
-rw-r--r-- | src/script/lua_api/l_env.cpp | 18 | ||||
-rw-r--r-- | src/script/lua_api/l_item.cpp | 8 | ||||
-rw-r--r-- | src/script/lua_api/l_mapgen.cpp | 20 | ||||
-rw-r--r-- | src/script/lua_api/l_vmanip.cpp | 8 |
10 files changed, 49 insertions, 49 deletions
diff --git a/src/script/common/c_content.cpp b/src/script/common/c_content.cpp index 38e9411af..5229572f1 100644 --- a/src/script/common/c_content.cpp +++ b/src/script/common/c_content.cpp @@ -1075,7 +1075,7 @@ NodeBox read_nodebox(lua_State *L, int index) } /******************************************************************************/ -MapNode readnode(lua_State *L, int index, INodeDefManager *ndef) +MapNode readnode(lua_State *L, int index, const NodeDefManager *ndef) { lua_getfield(L, index, "name"); if (!lua_isstring(L, -1)) @@ -1099,7 +1099,7 @@ MapNode readnode(lua_State *L, int index, INodeDefManager *ndef) } /******************************************************************************/ -void pushnode(lua_State *L, const MapNode &n, INodeDefManager *ndef) +void pushnode(lua_State *L, const MapNode &n, const NodeDefManager *ndef) { lua_newtable(L); lua_pushstring(L, ndef->get(n).name.c_str()); diff --git a/src/script/common/c_content.h b/src/script/common/c_content.h index d5c375a8f..723253559 100644 --- a/src/script/common/c_content.h +++ b/src/script/common/c_content.h @@ -44,7 +44,7 @@ extern "C" { namespace Json { class Value; } struct MapNode; -class INodeDefManager; +class NodeDefManager; struct PointedThing; struct ItemStack; struct ItemDefinition; @@ -120,9 +120,9 @@ void read_inventory_list (lua_State *L, int tableindex, Server *srv, int forcesize=-1); MapNode readnode (lua_State *L, int index, - INodeDefManager *ndef); + const NodeDefManager *ndef); void pushnode (lua_State *L, const MapNode &n, - INodeDefManager *ndef); + const NodeDefManager *ndef); void read_groups (lua_State *L, int index, diff --git a/src/script/cpp_api/s_client.cpp b/src/script/cpp_api/s_client.cpp index 457dabfa7..a8d8c2de4 100644 --- a/src/script/cpp_api/s_client.cpp +++ b/src/script/cpp_api/s_client.cpp @@ -144,7 +144,7 @@ bool ScriptApiClient::on_dignode(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER - INodeDefManager *ndef = getClient()->ndef(); + const NodeDefManager *ndef = getClient()->ndef(); // Get core.registered_on_dignode lua_getglobal(L, "core"); @@ -163,7 +163,7 @@ bool ScriptApiClient::on_punchnode(v3s16 p, MapNode node) { SCRIPTAPI_PRECHECKHEADER - INodeDefManager *ndef = getClient()->ndef(); + const NodeDefManager *ndef = getClient()->ndef(); // Get core.registered_on_punchgnode lua_getglobal(L, "core"); diff --git a/src/script/cpp_api/s_node.cpp b/src/script/cpp_api/s_node.cpp index f7ba95075..11c08811f 100644 --- a/src/script/cpp_api/s_node.cpp +++ b/src/script/cpp_api/s_node.cpp @@ -100,7 +100,7 @@ bool ScriptApiNode::node_on_punch(v3s16 p, MapNode node, int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack if (!getItemCallback(ndef->get(node).name.c_str(), "on_punch", &p)) @@ -123,7 +123,7 @@ bool ScriptApiNode::node_on_dig(v3s16 p, MapNode node, int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack if (!getItemCallback(ndef->get(node).name.c_str(), "on_dig", &p)) @@ -144,7 +144,7 @@ void ScriptApiNode::node_on_construct(v3s16 p, MapNode node) int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack if (!getItemCallback(ndef->get(node).name.c_str(), "on_construct", &p)) @@ -162,7 +162,7 @@ void ScriptApiNode::node_on_destruct(v3s16 p, MapNode node) int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack if (!getItemCallback(ndef->get(node).name.c_str(), "on_destruct", &p)) @@ -180,7 +180,7 @@ bool ScriptApiNode::node_on_flood(v3s16 p, MapNode node, MapNode newnode) int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack if (!getItemCallback(ndef->get(node).name.c_str(), "on_flood", &p)) @@ -201,7 +201,7 @@ void ScriptApiNode::node_after_destruct(v3s16 p, MapNode node) int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack if (!getItemCallback(ndef->get(node).name.c_str(), "after_destruct", &p)) @@ -220,7 +220,7 @@ bool ScriptApiNode::node_on_timer(v3s16 p, MapNode node, f32 dtime) int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // Push callback function on stack if (!getItemCallback(ndef->get(node).name.c_str(), "on_timer", &p)) @@ -243,7 +243,7 @@ void ScriptApiNode::node_on_receive_fields(v3s16 p, int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call MapNode node = getEnv()->getMap().getNodeNoEx(p); diff --git a/src/script/cpp_api/s_nodemeta.cpp b/src/script/cpp_api/s_nodemeta.cpp index 9c3bfcc8e..5a95d208a 100644 --- a/src/script/cpp_api/s_nodemeta.cpp +++ b/src/script/cpp_api/s_nodemeta.cpp @@ -36,7 +36,7 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowMove(v3s16 p, int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call MapNode node = getEnv()->getMap().getNodeNoEx(p); @@ -74,7 +74,7 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowPut(v3s16 p, int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call MapNode node = getEnv()->getMap().getNodeNoEx(p); @@ -110,7 +110,7 @@ int ScriptApiNodemeta::nodemeta_inventory_AllowTake(v3s16 p, int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call MapNode node = getEnv()->getMap().getNodeNoEx(p); @@ -147,7 +147,7 @@ void ScriptApiNodemeta::nodemeta_inventory_OnMove(v3s16 p, int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call MapNode node = getEnv()->getMap().getNodeNoEx(p); @@ -180,7 +180,7 @@ void ScriptApiNodemeta::nodemeta_inventory_OnPut(v3s16 p, int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call MapNode node = getEnv()->getMap().getNodeNoEx(p); @@ -211,7 +211,7 @@ void ScriptApiNodemeta::nodemeta_inventory_OnTake(v3s16 p, int error_handler = PUSH_ERROR_HANDLER(L); - INodeDefManager *ndef = getServer()->ndef(); + const NodeDefManager *ndef = getServer()->ndef(); // If node doesn't exist, we don't know what callback to call MapNode node = getEnv()->getMap().getNodeNoEx(p); diff --git a/src/script/lua_api/l_client.cpp b/src/script/lua_api/l_client.cpp index 230cbe7a2..2d36e977c 100644 --- a/src/script/lua_api/l_client.cpp +++ b/src/script/lua_api/l_client.cpp @@ -311,7 +311,7 @@ int ModApiClient::l_get_node_def(lua_State *L) IGameDef *gdef = getGameDef(L); assert(gdef); - INodeDefManager *ndef = gdef->ndef(); + const NodeDefManager *ndef = gdef->ndef(); assert(ndef); if (!lua_isstring(L, 1)) diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp index 684885341..7ea8b64b5 100644 --- a/src/script/lua_api/l_env.cpp +++ b/src/script/lua_api/l_env.cpp @@ -263,7 +263,7 @@ int ModApiEnvMod::l_set_node(lua_State *L) { GET_ENV_PTR; - INodeDefManager *ndef = env->getGameDef()->ndef(); + const NodeDefManager *ndef = env->getGameDef()->ndef(); // parameters v3s16 pos = read_v3s16(L, 1); MapNode n = readnode(L, 2, ndef); @@ -279,7 +279,7 @@ int ModApiEnvMod::l_bulk_set_node(lua_State *L) { GET_ENV_PTR; - INodeDefManager *ndef = env->getGameDef()->ndef(); + const NodeDefManager *ndef = env->getGameDef()->ndef(); // parameters if (!lua_istable(L, 1)) { return 0; @@ -331,7 +331,7 @@ int ModApiEnvMod::l_swap_node(lua_State *L) { GET_ENV_PTR; - INodeDefManager *ndef = env->getGameDef()->ndef(); + const NodeDefManager *ndef = env->getGameDef()->ndef(); // parameters v3s16 pos = read_v3s16(L, 1); MapNode n = readnode(L, 2, ndef); @@ -394,7 +394,7 @@ int ModApiEnvMod::l_get_node_light(lua_State *L) bool is_position_ok; MapNode n = env->getMap().getNodeNoEx(pos, &is_position_ok); if (is_position_ok) { - INodeDefManager *ndef = env->getGameDef()->ndef(); + const NodeDefManager *ndef = env->getGameDef()->ndef(); lua_pushinteger(L, n.getLightBlend(dnr, ndef)); } else { lua_pushnil(L); @@ -410,7 +410,7 @@ int ModApiEnvMod::l_place_node(lua_State *L) ScriptApiItem *scriptIfaceItem = getScriptApi<ScriptApiItem>(L); Server *server = getServer(L); - INodeDefManager *ndef = server->ndef(); + const NodeDefManager *ndef = server->ndef(); IItemDefManager *idef = server->idef(); v3s16 pos = read_v3s16(L, 1); @@ -748,7 +748,7 @@ int ModApiEnvMod::l_find_node_near(lua_State *L) return 0; } - INodeDefManager *ndef = getGameDef(L)->ndef(); + const NodeDefManager *ndef = getGameDef(L)->ndef(); v3s16 pos = read_v3s16(L, 1); int radius = luaL_checkinteger(L, 2); std::vector<content_t> filter; @@ -795,7 +795,7 @@ int ModApiEnvMod::l_find_nodes_in_area(lua_State *L) { GET_ENV_PTR; - INodeDefManager *ndef = getServer(L)->ndef(); + const NodeDefManager *ndef = getServer(L)->ndef(); v3s16 minp = read_v3s16(L, 1); v3s16 maxp = read_v3s16(L, 2); sortBoxVerticies(minp, maxp); @@ -867,7 +867,7 @@ int ModApiEnvMod::l_find_nodes_in_area_under_air(lua_State *L) GET_ENV_PTR; - INodeDefManager *ndef = getServer(L)->ndef(); + const NodeDefManager *ndef = getServer(L)->ndef(); v3s16 minp = read_v3s16(L, 1); v3s16 maxp = read_v3s16(L, 2); sortBoxVerticies(minp, maxp); @@ -1182,7 +1182,7 @@ int ModApiEnvMod::l_spawn_tree(lua_State *L) treegen::TreeDef tree_def; std::string trunk,leaves,fruit; - INodeDefManager *ndef = env->getGameDef()->ndef(); + const NodeDefManager *ndef = env->getGameDef()->ndef(); if(lua_istable(L, 2)) { 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); diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index db517b942..775f4a76d 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -99,16 +99,16 @@ ObjDef *get_objdef(lua_State *L, int index, ObjDefManager *objmgr); Biome *get_or_load_biome(lua_State *L, int index, BiomeManager *biomemgr); -Biome *read_biome_def(lua_State *L, int index, INodeDefManager *ndef); +Biome *read_biome_def(lua_State *L, int index, const NodeDefManager *ndef); size_t get_biome_list(lua_State *L, int index, BiomeManager *biomemgr, std::unordered_set<u8> *biome_id_list); Schematic *get_or_load_schematic(lua_State *L, int index, SchematicManager *schemmgr, StringMap *replace_names); -Schematic *load_schematic(lua_State *L, int index, INodeDefManager *ndef, +Schematic *load_schematic(lua_State *L, int index, const NodeDefManager *ndef, StringMap *replace_names); Schematic *load_schematic_from_def(lua_State *L, int index, - INodeDefManager *ndef, StringMap *replace_names); + const NodeDefManager *ndef, StringMap *replace_names); bool read_schematic_def(lua_State *L, int index, Schematic *schem, std::vector<std::string> *names); @@ -160,7 +160,7 @@ Schematic *get_or_load_schematic(lua_State *L, int index, } -Schematic *load_schematic(lua_State *L, int index, INodeDefManager *ndef, +Schematic *load_schematic(lua_State *L, int index, const NodeDefManager *ndef, StringMap *replace_names) { if (index < 0) @@ -196,7 +196,7 @@ Schematic *load_schematic(lua_State *L, int index, INodeDefManager *ndef, Schematic *load_schematic_from_def(lua_State *L, int index, - INodeDefManager *ndef, StringMap *replace_names) + const NodeDefManager *ndef, StringMap *replace_names) { Schematic *schem = SchematicManager::create(SCHEMATIC_NORMAL); @@ -374,7 +374,7 @@ Biome *get_or_load_biome(lua_State *L, int index, BiomeManager *biomemgr) } -Biome *read_biome_def(lua_State *L, int index, INodeDefManager *ndef) +Biome *read_biome_def(lua_State *L, int index, const NodeDefManager *ndef) { if (!lua_istable(L, index)) return NULL; @@ -1014,7 +1014,7 @@ int ModApiMapgen::l_register_biome(lua_State *L) int index = 1; luaL_checktype(L, index, LUA_TTABLE); - INodeDefManager *ndef = getServer(L)->getNodeDefManager(); + const NodeDefManager *ndef = getServer(L)->getNodeDefManager(); BiomeManager *bmgr = getServer(L)->getEmergeManager()->biomemgr; Biome *biome = read_biome_def(L, index, ndef); @@ -1040,7 +1040,7 @@ int ModApiMapgen::l_register_decoration(lua_State *L) int index = 1; luaL_checktype(L, index, LUA_TTABLE); - INodeDefManager *ndef = getServer(L)->getNodeDefManager(); + const NodeDefManager *ndef = getServer(L)->getNodeDefManager(); DecorationManager *decomgr = getServer(L)->getEmergeManager()->decomgr; BiomeManager *biomemgr = getServer(L)->getEmergeManager()->biomemgr; SchematicManager *schemmgr = getServer(L)->getEmergeManager()->schemmgr; @@ -1197,7 +1197,7 @@ int ModApiMapgen::l_register_ore(lua_State *L) int index = 1; luaL_checktype(L, index, LUA_TTABLE); - INodeDefManager *ndef = getServer(L)->getNodeDefManager(); + const NodeDefManager *ndef = getServer(L)->getNodeDefManager(); BiomeManager *bmgr = getServer(L)->getEmergeManager()->biomemgr; OreManager *oremgr = getServer(L)->getEmergeManager()->oremgr; @@ -1469,7 +1469,7 @@ int ModApiMapgen::l_create_schematic(lua_State *L) { MAP_LOCK_REQUIRED; - INodeDefManager *ndef = getServer(L)->getNodeDefManager(); + const NodeDefManager *ndef = getServer(L)->getNodeDefManager(); const char *filename = luaL_checkstring(L, 4); CHECK_SECURE_PATH(L, filename, true); diff --git a/src/script/lua_api/l_vmanip.cpp b/src/script/lua_api/l_vmanip.cpp index ca837b655..f6239339c 100644 --- a/src/script/lua_api/l_vmanip.cpp +++ b/src/script/lua_api/l_vmanip.cpp @@ -136,7 +136,7 @@ int LuaVoxelManip::l_get_node_at(lua_State *L) { NO_MAP_LOCK_REQUIRED; - INodeDefManager *ndef = getServer(L)->getNodeDefManager(); + const NodeDefManager *ndef = getServer(L)->getNodeDefManager(); LuaVoxelManip *o = checkobject(L, 1); v3s16 pos = check_v3s16(L, 2); @@ -149,7 +149,7 @@ int LuaVoxelManip::l_set_node_at(lua_State *L) { NO_MAP_LOCK_REQUIRED; - INodeDefManager *ndef = getServer(L)->getNodeDefManager(); + const NodeDefManager *ndef = getServer(L)->getNodeDefManager(); LuaVoxelManip *o = checkobject(L, 1); v3s16 pos = check_v3s16(L, 2); @@ -167,7 +167,7 @@ int LuaVoxelManip::l_update_liquids(lua_State *L) LuaVoxelManip *o = checkobject(L, 1); Map *map = &(env->getMap()); - INodeDefManager *ndef = getServer(L)->getNodeDefManager(); + const NodeDefManager *ndef = getServer(L)->getNodeDefManager(); MMVManip *vm = o->vm; Mapgen mg; @@ -188,7 +188,7 @@ int LuaVoxelManip::l_calc_lighting(lua_State *L) if (!o->is_mapgen_vm) return 0; - INodeDefManager *ndef = getServer(L)->getNodeDefManager(); + const NodeDefManager *ndef = getServer(L)->getNodeDefManager(); EmergeManager *emerge = getServer(L)->getEmergeManager(); MMVManip *vm = o->vm; |