2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2017-08-17 22:19:39 +02:00
|
|
|
#pragma once
|
2013-05-25 00:51:02 +02:00
|
|
|
|
|
|
|
#include "irr_v3d.h"
|
|
|
|
#include "cpp_api/s_base.h"
|
|
|
|
#include "cpp_api/s_nodemeta.h"
|
2015-05-19 02:24:14 -04:00
|
|
|
#include "util/string.h"
|
2013-05-25 00:51:02 +02:00
|
|
|
|
2013-06-06 22:57:38 +02:00
|
|
|
struct MapNode;
|
2013-05-25 00:51:02 +02:00
|
|
|
class ServerActiveObject;
|
|
|
|
|
|
|
|
class ScriptApiNode
|
|
|
|
: virtual public ScriptApiBase,
|
|
|
|
public ScriptApiNodemeta
|
|
|
|
{
|
|
|
|
public:
|
2017-08-20 13:30:50 +02:00
|
|
|
ScriptApiNode() = default;
|
|
|
|
virtual ~ScriptApiNode() = default;
|
2013-05-25 00:51:02 +02:00
|
|
|
|
|
|
|
bool node_on_punch(v3s16 p, MapNode node,
|
2020-05-26 17:38:31 +02:00
|
|
|
ServerActiveObject *puncher, const PointedThing &pointed);
|
2013-05-25 00:51:02 +02:00
|
|
|
bool node_on_dig(v3s16 p, MapNode node,
|
|
|
|
ServerActiveObject *digger);
|
|
|
|
void node_on_construct(v3s16 p, MapNode node);
|
|
|
|
void node_on_destruct(v3s16 p, MapNode node);
|
2017-04-19 23:10:39 -07:00
|
|
|
bool node_on_flood(v3s16 p, MapNode node, MapNode newnode);
|
2013-05-25 00:51:02 +02:00
|
|
|
void node_after_destruct(v3s16 p, MapNode node);
|
|
|
|
bool node_on_timer(v3s16 p, MapNode node, f32 dtime);
|
|
|
|
void node_on_receive_fields(v3s16 p,
|
|
|
|
const std::string &formname,
|
2015-05-19 02:24:14 -04:00
|
|
|
const StringMap &fields,
|
2013-05-25 00:51:02 +02:00
|
|
|
ServerActiveObject *sender);
|
|
|
|
public:
|
|
|
|
static struct EnumString es_DrawType[];
|
|
|
|
static struct EnumString es_ContentParamType[];
|
|
|
|
static struct EnumString es_ContentParamType2[];
|
|
|
|
static struct EnumString es_LiquidType[];
|
|
|
|
static struct EnumString es_NodeBoxType[];
|
2021-01-17 01:56:50 +01:00
|
|
|
static struct EnumString es_TextureAlphaMode[];
|
2013-05-25 00:51:02 +02:00
|
|
|
};
|