Luanti 5.15.0-dev
 
Loading...
Searching...
No Matches
s_client.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// Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
5
6#pragma once
7
8#include "cpp_api/s_base.h"
9#include "mapnode.h"
10#include "util/pointedthing.h"
11
12#ifdef _CRT_MSVCP_CURRENT
13#include <cstdint>
14#endif
15
17struct ItemStack;
18class Inventory;
19struct ItemDefinition;
20
21class ScriptApiClient : virtual public ScriptApiBase
22{
23public:
24 // Calls when mods are loaded
25 void on_mods_loaded();
26
27 // Calls on_shutdown handlers
28 void on_shutdown();
29
30 // Chat message handlers
31 bool on_sending_message(const std::string &message);
32 bool on_receiving_message(const std::string &message);
33
34 void on_damage_taken(int32_t damage_amount);
35 void on_hp_modification(int32_t newhp);
36 void environment_step(float dtime);
37
38 bool on_dignode(v3s16 p, MapNode node);
39 bool on_punchnode(v3s16 p, MapNode node);
40 bool on_placenode(const PointedThing &pointed, const ItemDefinition &item);
41 bool on_item_use(const ItemStack &item, const PointedThing &pointed);
42
43 bool on_inventory_open(Inventory *inventory);
44
45 void setEnv(ClientEnvironment *env);
46};
Definition clientenvironment.h:54
Definition inventory.h:277
Definition s_base.h:63
Definition s_client.h:22
bool on_inventory_open(Inventory *inventory)
Definition s_client.cpp:217
void on_shutdown()
Definition s_client.cpp:30
void on_mods_loaded()
Definition s_client.cpp:15
bool on_placenode(const PointedThing &pointed, const ItemDefinition &item)
Definition s_client.cpp:173
bool on_sending_message(const std::string &message)
Definition s_client.cpp:45
bool on_item_use(const ItemStack &item, const PointedThing &pointed)
Definition s_client.cpp:195
void on_hp_modification(int32_t newhp)
Definition s_client.cpp:97
void environment_step(float dtime)
Definition s_client.cpp:113
void setEnv(ClientEnvironment *env)
Definition s_client.cpp:235
bool on_punchnode(v3s16 p, MapNode node)
Definition s_client.cpp:151
bool on_dignode(v3s16 p, MapNode node)
Definition s_client.cpp:129
void on_damage_taken(int32_t damage_amount)
Definition s_client.cpp:81
bool on_receiving_message(const std::string &message)
Definition s_client.cpp:63
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
Definition itemdef.h:83
Definition inventory.h:21
Definition mapnode.h:123
An active object or node which is selected by a ray on the map.
Definition pointedthing.h:22
static std::string p(std::string path)
Definition test_filesys.cpp:64