Luanti
5.11.0-dev
Loading...
Searching...
No Matches
s_nodemeta.h
Go to the documentation of this file.
1
// Luanti
2
// SPDX-License-Identifier: LGPL-2.1-or-later
3
// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5
#pragma once
6
7
#include "
cpp_api/s_base.h
"
8
#include "
cpp_api/s_item.h
"
9
#include "
irr_v3d.h
"
10
11
struct
MoveAction
;
12
struct
ItemStack
;
13
14
class
ScriptApiNodemeta
15
:
virtual
public
ScriptApiBase
,
16
public
ScriptApiItem
17
{
18
public
:
19
ScriptApiNodemeta
() =
default
;
20
virtual
~ScriptApiNodemeta
() =
default
;
21
22
// Return number of accepted items to be moved
23
int
nodemeta_inventory_AllowMove
(
24
const
MoveAction
&ma,
int
count,
25
ServerActiveObject
*player);
26
// Return number of accepted items to be put
27
int
nodemeta_inventory_AllowPut
(
28
const
MoveAction
&ma,
const
ItemStack
&stack,
29
ServerActiveObject
*player);
30
// Return number of accepted items to be taken
31
int
nodemeta_inventory_AllowTake
(
32
const
MoveAction
&ma,
const
ItemStack
&stack,
33
ServerActiveObject
*player);
34
// Report moved items
35
void
nodemeta_inventory_OnMove
(
36
const
MoveAction
&ma,
int
count,
37
ServerActiveObject
*player);
38
// Report put items
39
void
nodemeta_inventory_OnPut
(
40
const
MoveAction
&ma,
const
ItemStack
&stack,
41
ServerActiveObject
*player);
42
// Report taken items
43
void
nodemeta_inventory_OnTake
(
44
const
MoveAction
&ma,
const
ItemStack
&stack,
45
ServerActiveObject
*player);
46
private
:
47
48
};
ScriptApiBase
Definition
s_base.h:64
ScriptApiItem
Definition
s_item.h:22
ScriptApiNodemeta
Definition
s_nodemeta.h:17
ScriptApiNodemeta::nodemeta_inventory_AllowPut
int nodemeta_inventory_AllowPut(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition
s_nodemeta.cpp:53
ScriptApiNodemeta::nodemeta_inventory_AllowMove
int nodemeta_inventory_AllowMove(const MoveAction &ma, int count, ServerActiveObject *player)
Definition
s_nodemeta.cpp:15
ScriptApiNodemeta::ScriptApiNodemeta
ScriptApiNodemeta()=default
ScriptApiNodemeta::nodemeta_inventory_OnMove
void nodemeta_inventory_OnMove(const MoveAction &ma, int count, ServerActiveObject *player)
Definition
s_nodemeta.cpp:125
ScriptApiNodemeta::nodemeta_inventory_OnPut
void nodemeta_inventory_OnPut(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition
s_nodemeta.cpp:158
ScriptApiNodemeta::nodemeta_inventory_OnTake
void nodemeta_inventory_OnTake(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition
s_nodemeta.cpp:189
ScriptApiNodemeta::nodemeta_inventory_AllowTake
int nodemeta_inventory_AllowTake(const MoveAction &ma, const ItemStack &stack, ServerActiveObject *player)
Definition
s_nodemeta.cpp:89
ScriptApiNodemeta::~ScriptApiNodemeta
virtual ~ScriptApiNodemeta()=default
ServerActiveObject
Definition
serveractiveobject.h:41
irr_v3d.h
s_base.h
s_item.h
ItemStack
Definition
inventory.h:19
MoveAction
Definition
inventorymanager.h:128
script
cpp_api
s_nodemeta.h
Generated on Sun Dec 1 2024 10:42:56 for Luanti by
1.11.0