]> git.lizzy.rs Git - minetest.git/blob - src/mapgen_singlenode.h
(Re)spawn players within 'mapgen_limit'
[minetest.git] / src / mapgen_singlenode.h
1 /*
2 Minetest
3 Copyright (C) 2013-2015 celeron55, Perttu Ahola <celeron55@gmail.com>
4 Copyright (C) 2013-2016 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
5 Copyright (C) 2015-2017 paramat
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation; either version 2.1 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public License along
18 with this program; if not, write to the Free Software Foundation, Inc.,
19 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22 #ifndef MAPGEN_SINGLENODE_HEADER
23 #define MAPGEN_SINGLENODE_HEADER
24
25 #include "mapgen.h"
26
27 struct MapgenSinglenodeParams : public MapgenParams
28 {
29         MapgenSinglenodeParams() {}
30         ~MapgenSinglenodeParams() {}
31
32         void readParams(const Settings *settings) {}
33         void writeParams(Settings *settings) const {}
34 };
35
36 class MapgenSinglenode : public Mapgen
37 {
38 public:
39         u32 flags;
40         content_t c_node;
41         u8 set_light;
42
43         MapgenSinglenode(int mapgenid, MapgenParams *params, EmergeManager *emerge);
44         ~MapgenSinglenode();
45
46         virtual MapgenType getType() const { return MAPGEN_SINGLENODE; }
47
48         void makeChunk(BlockMakeData *data);
49         int getSpawnLevelAtPoint(v2s16 p);
50 };
51
52 #endif