]> git.lizzy.rs Git - dragonfireclient.git/blob - src/mapgen/mapgen_singlenode.h
ContentCAO: Fix broken attachments on join (#8701)
[dragonfireclient.git] / src / mapgen / mapgen_singlenode.h
1 /*
2 Minetest
3 Copyright (C) 2013-2018 celeron55, Perttu Ahola <celeron55@gmail.com>
4 Copyright (C) 2013-2018 kwolekr, Ryan Kwolek <kwolekr@minetest.net>
5 Copyright (C) 2015-2018 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 #pragma once
23
24 #include "mapgen.h"
25
26 struct MapgenSinglenodeParams : public MapgenParams
27 {
28         MapgenSinglenodeParams() = default;
29         ~MapgenSinglenodeParams() = default;
30
31         void readParams(const Settings *settings) {}
32         void writeParams(Settings *settings) const {}
33 };
34
35 class MapgenSinglenode : public Mapgen
36 {
37 public:
38         content_t c_node;
39         u8 set_light;
40
41         MapgenSinglenode(MapgenParams *params, EmergeManager *emerge);
42         ~MapgenSinglenode() = default;
43
44         virtual MapgenType getType() const { return MAPGEN_SINGLENODE; }
45
46         void makeChunk(BlockMakeData *data);
47         int getSpawnLevelAtPoint(v2s16 p);
48 };