Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
s_nodemeta.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation; either version 2.1 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License along
16with this program; if not, write to the Free Software Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20#pragma once
21
22#include "cpp_api/s_base.h"
23#include "cpp_api/s_item.h"
24#include "irr_v3d.h"
25
26struct MoveAction;
27struct ItemStack;
28
30 : virtual public ScriptApiBase,
31 public ScriptApiItem
32{
33public:
34 ScriptApiNodemeta() = default;
35 virtual ~ScriptApiNodemeta() = default;
36
37 // Return number of accepted items to be moved
39 const MoveAction &ma, int count,
40 ServerActiveObject *player);
41 // Return number of accepted items to be put
43 const MoveAction &ma, const ItemStack &stack,
44 ServerActiveObject *player);
45 // Return number of accepted items to be taken
47 const MoveAction &ma, const ItemStack &stack,
48 ServerActiveObject *player);
49 // Report moved items
51 const MoveAction &ma, int count,
52 ServerActiveObject *player);
53 // Report put items
55 const MoveAction &ma, const ItemStack &stack,
56 ServerActiveObject *player);
57 // Report taken items
59 const MoveAction &ma, const ItemStack &stack,
60 ServerActiveObject *player);
61private:
62
63};
Definition: s_base.h:79
Definition: s_item.h:37
Definition: s_nodemeta.h:32
int nodemeta_inventory_AllowPut(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition: s_nodemeta.cpp:68
int nodemeta_inventory_AllowMove(const MoveAction &ma, int count, ServerActiveObject *player)
Definition: s_nodemeta.cpp:30
ScriptApiNodemeta()=default
void nodemeta_inventory_OnMove(const MoveAction &ma, int count, ServerActiveObject *player)
Definition: s_nodemeta.cpp:140
void nodemeta_inventory_OnPut(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition: s_nodemeta.cpp:173
void nodemeta_inventory_OnTake(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition: s_nodemeta.cpp:204
int nodemeta_inventory_AllowTake(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition: s_nodemeta.cpp:104
virtual ~ScriptApiNodemeta()=default
Definition: serveractiveobject.h:55
Definition: inventory.h:34
Definition: inventorymanager.h:143