3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
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.
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.
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.
22 #include "cpp_api/s_base.h"
23 #include "cpp_api/s_item.h"
28 class ScriptApiNodemeta
29 : virtual public ScriptApiBase,
33 ScriptApiNodemeta() = default;
34 virtual ~ScriptApiNodemeta() = default;
36 // Return number of accepted items to be moved
37 int nodemeta_inventory_AllowMove(v3s16 p,
38 const std::string &from_list, int from_index,
39 const std::string &to_list, int to_index,
40 int count, ServerActiveObject *player);
41 // Return number of accepted items to be put
42 int nodemeta_inventory_AllowPut(v3s16 p,
43 const std::string &listname, int index, ItemStack &stack,
44 ServerActiveObject *player);
45 // Return number of accepted items to be taken
46 int nodemeta_inventory_AllowTake(v3s16 p,
47 const std::string &listname, int index, ItemStack &stack,
48 ServerActiveObject *player);
50 void nodemeta_inventory_OnMove(v3s16 p,
51 const std::string &from_list, int from_index,
52 const std::string &to_list, int to_index,
53 int count, ServerActiveObject *player);
55 void nodemeta_inventory_OnPut(v3s16 p,
56 const std::string &listname, int index, ItemStack &stack,
57 ServerActiveObject *player);
59 void nodemeta_inventory_OnTake(v3s16 p,
60 const std::string &listname, int index, ItemStack &stack,
61 ServerActiveObject *player);