Minetest 5.9.0-dev
 
Loading...
Searching...
No Matches
s_env.h
Go to the documentation of this file.
1/*
2Minetest
3Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5This program is free software; you can redistribute it and/or modify
6it under the terms of the GNU Lesser General Public License as published by
7the Free Software Foundation; either version 2.1 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public License along
16with this program; if not, write to the Free Software Foundation, Inc.,
1751 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*/
19
20#pragma once
21
22#include "cpp_api/s_base.h"
23#include "irr_v3d.h"
24#include "mapnode.h"
25#include <unordered_set>
26#include <vector>
27
30
31class ScriptApiEnv : virtual public ScriptApiBase
32{
33public:
34 // Called on environment step
35 void environment_Step(float dtime);
36
37 // Called after generating a piece of map
38 void environment_OnGenerated(v3s16 minp, v3s16 maxp, u32 blockseed);
39
40 // Called on player event
41 void player_event(ServerActiveObject *player, const std::string &type);
42
43 // Called after emerge of a block queued from core.emerge_area()
44 void on_emerge_area_completion(v3s16 blockpos, int action,
45 ScriptCallbackState *state);
46
48
49 // Called after liquid transform changes
50 void on_liquid_transformed(const std::vector<std::pair<v3s16, MapNode>> &list);
51
52 // Called after mapblock changes
53 void on_mapblocks_changed(const std::unordered_set<v3s16> &set);
54
55 // Determines whether there are any on_mapblocks_changed callbacks
57
59};
Definition: s_base.h:79
Definition: s_env.h:32
void player_event(ServerActiveObject *player, const std::string &type)
Definition: s_env.cpp:59
void on_emerge_area_completion(v3s16 blockpos, int action, ScriptCallbackState *state)
Definition: s_env.cpp:218
void initializeEnvironment(ServerEnvironment *env)
Definition: s_env.cpp:76
void on_mapblocks_changed(const std::unordered_set< v3s16 > &set)
Definition: s_env.cpp:303
void check_for_falling(v3s16 p)
Definition: s_env.cpp:260
void environment_Step(float dtime)
Definition: s_env.cpp:46
void on_liquid_transformed(const std::vector< std::pair< v3s16, MapNode > > &list)
Definition: s_env.cpp:272
bool has_on_mapblocks_changed()
Definition: s_env.cpp:325
void environment_OnGenerated(v3s16 minp, v3s16 maxp, u32 blockseed)
Definition: s_env.cpp:31
Definition: serveractiveobject.h:55
Definition: serverenvironment.h:220
core::vector3d< s16 > v3s16
Definition: irr_v3d.h:28
Definition: l_env.h:397
static std::string p(std::string path)
Definition: test_filesys.cpp:64