Decoration: Add schematic rotation support
[oweals/minetest.git] / src / script / lua_api / luaapi.h
1 /*
2 Minetest
3 Copyright (C) 2013 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 Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 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 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser 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 LUAAPI_H_
21 #define LUAAPI_H_
22
23
24 class ModApiBasic : public ModApiBase {
25
26 public:
27         ModApiBasic();
28
29         bool Initialize(lua_State* L,int top);
30
31 private:
32         // debug(text)
33         // Writes a line to dstream
34         static int l_debug(lua_State *L);
35
36         // log([level,] text)
37         // Writes a line to the logger.
38         // The one-argument version logs to infostream.
39         // The two-argument version accept a log level: error, action, info, or verbose.
40         static int l_log(lua_State *L);
41
42         // request_shutdown()
43         static int l_request_shutdown(lua_State *L);
44
45         // get_server_status()
46         static int l_get_server_status(lua_State *L);
47
48         // register_biome({lots of stuff})
49         static int l_register_biome(lua_State *L);
50
51         // setting_set(name, value)
52         static int l_setting_set(lua_State *L);
53
54         // setting_get(name)
55         static int l_setting_get(lua_State *L);
56
57         // setting_getbool(name)
58         static int l_setting_getbool(lua_State *L);
59
60         // setting_save()
61         static int l_setting_save(lua_State *L);
62
63         // chat_send_all(text)
64         static int l_chat_send_all(lua_State *L);
65
66         // chat_send_player(name, text)
67         static int l_chat_send_player(lua_State *L);
68
69         // get_player_privs(name, text)
70         static int l_get_player_privs(lua_State *L);
71
72         // get_player_ip()
73         static int l_get_player_ip(lua_State *L);
74
75         // get_ban_list()
76         static int l_get_ban_list(lua_State *L);
77
78         // get_ban_description()
79         static int l_get_ban_description(lua_State *L);
80
81         // ban_player()
82         static int l_ban_player(lua_State *L);
83
84         // unban_player_or_ip()
85         static int l_unban_player_or_ip(lua_State *L);
86
87         // show_formspec(playername,formname,formspec)
88         static int l_show_formspec(lua_State *L);
89
90         // get_dig_params(groups, tool_capabilities[, time_from_last_punch])
91         static int l_get_dig_params(lua_State *L);
92
93         // get_hit_params(groups, tool_capabilities[, time_from_last_punch])
94         static int l_get_hit_params(lua_State *L);
95
96         // get_current_modname()
97         static int l_get_current_modname(lua_State *L);
98
99         // get_modpath(modname)
100         static int l_get_modpath(lua_State *L);
101
102         // get_modnames()
103         // the returned list is sorted alphabetically for you
104         static int l_get_modnames(lua_State *L);
105
106         // get_worldpath()
107         static int l_get_worldpath(lua_State *L);
108
109         // sound_play(spec, parameters)
110         static int l_sound_play(lua_State *L);
111
112         // sound_stop(handle)
113         static int l_sound_stop(lua_State *L);
114
115         // is_singleplayer()
116         static int l_is_singleplayer(lua_State *L);
117
118         // get_password_hash(name, raw_password)
119         static int l_get_password_hash(lua_State *L);
120
121         // notify_authentication_modified(name)
122         static int l_notify_authentication_modified(lua_State *L);
123
124         // rollback_get_last_node_actor(p, range, seconds) -> actor, p, seconds
125         static int l_rollback_get_last_node_actor(lua_State *L);
126
127         // rollback_revert_actions_by(actor, seconds) -> bool, log messages
128         static int l_rollback_revert_actions_by(lua_State *L);
129
130         // register_ore(oredesc)
131         static int l_register_ore(lua_State *L);
132         
133         // register_decoration(deco)
134         static int l_register_decoration(lua_State *L);
135         
136         // create_schematic(p1, p2, filename)
137         static int l_create_schematic(lua_State *L);
138         
139         // place_schematic(p, filename, rotation)
140         static int l_place_schematic(lua_State *L);
141
142         static struct EnumString es_OreType[];
143         static struct EnumString es_DecorationType[];
144         static struct EnumString es_Rotation[];
145
146 };
147
148
149
150 #endif /* LUAAPI_H_ */