Add node definitions in Lua and do not use content_mapnode_init anymore (except in...
[oweals/minetest.git] / src / content_mapnode.h
1 /*
2 Minetest-c55
3 Copyright (C) 2010-2011 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19
20 #ifndef CONTENT_MAPNODE_HEADER
21 #define CONTENT_MAPNODE_HEADER
22
23 #include "mapnode.h"
24
25 /*
26         Legacy node definitions
27 */
28
29 class IWritableNodeDefManager;
30
31 // Initialize legacy node definitions
32 // Not used used anywhere else than in test.cpp (and SHALL NOT BE)
33 void content_mapnode_init(IWritableNodeDefManager *nodemgr);
34
35 // Backwards compatibility for non-extended content types in v19
36 extern content_t trans_table_19[21][2];
37 MapNode mapnode_translate_from_internal(MapNode n_from, u8 version);
38 MapNode mapnode_translate_to_internal(MapNode n_from, u8 version);
39
40 // Get legacy node name mapping for loading old blocks
41 class NameIdMapping;
42 void content_mapnode_get_name_id_mapping(NameIdMapping *nimap);
43
44 // Convert "CONTENT_STONE"-style names to dynamic ids
45 std::string content_mapnode_get_new_name(const std::string &oldname);
46 class INodeDefManager;
47 content_t legacy_get_id(const std::string &oldname, INodeDefManager *ndef);
48 #define LEGN(ndef, oldname) legacy_get_id(oldname, ndef)
49
50 #endif
51