1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-05 19:31:04 +00:00
luanti/src/script/cpp_api/s_client.h

48 lines
1.3 KiB
C++

// Luanti
// SPDX-License-Identifier: LGPL-2.1-or-later
// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
// Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
#pragma once
#include "cpp_api/s_base.h"
#include "mapnode.h"
#include "util/string.h"
#include "util/pointedthing.h"
#ifdef _CRT_MSVCP_CURRENT
#include <cstdint>
#endif
class ClientEnvironment;
struct ItemStack;
class Inventory;
struct ItemDefinition;
class ScriptApiClient : virtual public ScriptApiBase
{
public:
// Calls when mods are loaded
void on_mods_loaded();
// Calls on_shutdown handlers
void on_shutdown();
// Chat message handlers
bool on_sending_message(const std::string &message);
bool on_receiving_message(const std::string &message);
void on_damage_taken(int32_t damage_amount);
void on_hp_modification(int32_t newhp);
void environment_step(float dtime);
void on_formspec_input(const std::string &formname, const StringMap &fields);
bool on_dignode(v3s16 p, MapNode node);
bool on_punchnode(v3s16 p, MapNode node);
bool on_placenode(const PointedThing &pointed, const ItemDefinition &item);
bool on_item_use(const ItemStack &item, const PointedThing &pointed);
bool on_inventory_open(Inventory *inventory);
void setEnv(ClientEnvironment *env);
};