mapgen_singlenode.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU Lesser General Public License as published by
  8. the Free Software Foundation; either version 2.1 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU Lesser General Public License for more details.
  14. You should have received a copy of the GNU Lesser General Public License along
  15. with this program; if not, write to the Free Software Foundation, Inc.,
  16. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. #pragma once
  19. #include "mapgen.h"
  20. struct MapgenSinglenodeParams : public MapgenParams
  21. {
  22. MapgenSinglenodeParams() = default;
  23. ~MapgenSinglenodeParams() = default;
  24. void readParams(const Settings *settings) {}
  25. void writeParams(Settings *settings) const {}
  26. };
  27. class MapgenSinglenode : public Mapgen
  28. {
  29. public:
  30. u32 flags;
  31. content_t c_node;
  32. u8 set_light;
  33. MapgenSinglenode(int mapgenid, MapgenParams *params, EmergeManager *emerge);
  34. ~MapgenSinglenode() = default;
  35. virtual MapgenType getType() const { return MAPGEN_SINGLENODE; }
  36. void makeChunk(BlockMakeData *data);
  37. int getSpawnLevelAtPoint(v2s16 p);
  38. };