2017-01-21 15:02:08 +01:00
|
|
|
/*
|
|
|
|
Minetest
|
|
|
|
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
|
|
|
Copyright (C) 2017 nerzhul, Loic Blot <loic.blot@unix-experience.fr>
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as published by
|
|
|
|
the Free Software Foundation; either version 2.1 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU Lesser General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public License along
|
|
|
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2017-01-21 15:02:08 +01:00
|
|
|
|
2017-04-29 12:08:16 +02:00
|
|
|
#include "util/pointedthing.h"
|
2017-01-21 15:02:08 +01:00
|
|
|
#include "cpp_api/s_base.h"
|
2017-01-29 18:43:44 +01:00
|
|
|
#include "mapnode.h"
|
2017-04-29 12:08:16 +02:00
|
|
|
#include "itemdef.h"
|
2017-04-07 23:22:00 +02:00
|
|
|
#include "util/string.h"
|
2017-05-06 21:12:44 +02:00
|
|
|
#include "util/pointedthing.h"
|
|
|
|
#include "lua_api/l_item.h"
|
2017-01-24 17:26:15 +01:00
|
|
|
|
|
|
|
#ifdef _CRT_MSVCP_CURRENT
|
|
|
|
#include <cstdint>
|
|
|
|
#endif
|
2017-01-21 15:02:08 +01:00
|
|
|
|
2017-03-17 07:48:29 +01:00
|
|
|
class ClientEnvironment;
|
|
|
|
|
2017-04-07 23:22:00 +02:00
|
|
|
class ScriptApiClient : virtual public ScriptApiBase
|
2017-01-21 15:02:08 +01:00
|
|
|
{
|
|
|
|
public:
|
2018-06-06 12:53:59 +02:00
|
|
|
// Calls when mods are loaded
|
|
|
|
void on_mods_loaded();
|
|
|
|
|
2017-01-21 15:02:08 +01:00
|
|
|
// Calls on_shutdown handlers
|
|
|
|
void on_shutdown();
|
2017-04-08 08:45:58 +02:00
|
|
|
|
2017-01-21 15:02:08 +01:00
|
|
|
// Chat message handlers
|
|
|
|
bool on_sending_message(const std::string &message);
|
|
|
|
bool on_receiving_message(const std::string &message);
|
2017-01-22 00:20:55 +01:00
|
|
|
|
|
|
|
void on_damage_taken(int32_t damage_amount);
|
|
|
|
void on_hp_modification(int32_t newhp);
|
|
|
|
void on_death();
|
2017-01-22 11:17:41 +01:00
|
|
|
void environment_step(float dtime);
|
2017-01-24 17:26:15 +01:00
|
|
|
void on_formspec_input(const std::string &formname, const StringMap &fields);
|
2017-01-29 18:43:44 +01:00
|
|
|
|
|
|
|
bool on_dignode(v3s16 p, MapNode node);
|
2017-01-29 19:28:38 +01:00
|
|
|
bool on_punchnode(v3s16 p, MapNode node);
|
2017-04-29 12:08:16 +02:00
|
|
|
bool on_placenode(const PointedThing &pointed, const ItemDefinition &item);
|
2017-05-06 21:12:44 +02:00
|
|
|
bool on_item_use(const ItemStack &item, const PointedThing &pointed);
|
2017-03-17 07:48:29 +01:00
|
|
|
|
2017-10-02 22:09:49 +02:00
|
|
|
bool on_inventory_open(Inventory *inventory);
|
|
|
|
|
2017-03-17 07:48:29 +01:00
|
|
|
void setEnv(ClientEnvironment *env);
|
2017-01-21 15:02:08 +01:00
|
|
|
};
|