Cuberite
A lightweight, fast and extensible game server for Minecraft
BiomeDef.h
Go to the documentation of this file.
1 
2 // BiomeDef.h
3 
4 // Defines relevant information and methods related to biomes
5 
6 
7 
8 
9 
10 #pragma once
11 
12 // tolua_begin
18 {
20 
22  biOcean = 0,
23  biPlains = 1,
24  biDesert = 2,
26  biForest = 4,
27  biTaiga = 5,
29  biRiver = 7,
30  biHell = 8, // same as Nether
31  biNether = 8,
32  biSky = 9, // same as biEnd
33  biEnd = 9,
37  biTundra = 12, // same as Ice Plains
41  biBeach = 16,
46  biJungle = 21,
48 
49  // Release 1.7 biomes:
62  biSavanna = 35,
64  biMesa = 37,
67 
68  // Automatically capture the maximum consecutive biome value into biMaxBiome:
69  biNumBiomes, // True number of biomes, since they are zero-based
70  biMaxBiome = biNumBiomes - 1, // The maximum biome value
71 
72  // Add this number to the biomes to get the variant
73  biVariant = 128,
74 
75  // Release 1.7 biome variants:
78  biDesertM = 130,
81  biTaigaM = 133,
82  biSwamplandM = 134,
84  biJungleM = 149,
89  biColdTaigaM = 158,
93  biSavannaM = 163,
95  biMesaBryce = 165,
98  // Automatically capture the maximum consecutive biome value into biVarientMaxBiome:
99  biNumVariantBiomes, // True number of biomes, since they are zero-based
100  biMaxVariantBiome = biNumVariantBiomes - 1, // The maximum biome value
101 } ;
102 
103 // tolua_end
104 
105 
106 
107 
108 
111 {
112 public:
113  std::size_t operator() (const EMCSBiome a_Biome) const
114  {
115  return static_cast<std::size_t>(a_Biome);
116  }
117 };
118 
119 
120 
121 
122 
123 // tolua_begin
124 
126 extern EMCSBiome StringToBiome(const AString & a_BiomeString);
127 
129 extern AString BiomeToString(int a_Biome);
130 
132 extern bool IsBiomeNoDownfall(EMCSBiome a_Biome);
133 
135 inline bool IsBiomeOcean(int a_Biome)
136 {
137  return ((a_Biome == biOcean) || (a_Biome == biDeepOcean));
138 }
139 
143 extern bool IsBiomeVeryCold(EMCSBiome a_Biome);
144 
148 extern bool IsBiomeCold(EMCSBiome a_Biome);
149 
151 extern bool IsBiomeMountain(EMCSBiome a_Biome);
152 
154 extern bool IsBiomeMesa(EMCSBiome a_Biome);
155 
157 extern int GetSnowStartHeight(EMCSBiome a_Biome);
158 
159 // tolua_end
int GetSnowStartHeight(EMCSBiome a_Biome)
Returns the height when a biome when a biome starts snowing.
Definition: BiomeDef.cpp:275
bool IsBiomeOcean(int a_Biome)
Returns true if the biome is an ocean biome.
Definition: BiomeDef.h:135
bool IsBiomeNoDownfall(EMCSBiome a_Biome)
Returns true if the biome has no downfall - deserts and savannas.
Definition: BiomeDef.cpp:142
bool IsBiomeVeryCold(EMCSBiome a_Biome)
Returns true if the biome is very cold (has snow on ground everywhere, turns top water to ice,...
Definition: BiomeDef.cpp:169
bool IsBiomeMountain(EMCSBiome a_Biome)
Returns true if the biome is mountainous (mutations of the extreme hills biome)
Definition: BiomeDef.cpp:228
EMCSBiome StringToBiome(const AString &a_BiomeString)
Translates a biome string to biome enum.
Definition: BiomeDef.cpp:94
AString BiomeToString(int a_Biome)
Translates biome enum into biome string.
Definition: BiomeDef.cpp:126
bool IsBiomeMesa(EMCSBiome a_Biome)
Returns true if the biome is Mesa or one of its mutations.
Definition: BiomeDef.cpp:251
bool IsBiomeCold(EMCSBiome a_Biome)
Returns true if the biome is cold (has snow and snowfall at higher elevations but not at regular heig...
Definition: BiomeDef.cpp:196
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
Definition: BiomeDef.h:18
@ biJungleEdge
Definition: BiomeDef.h:50
@ biIceMountains
Definition: BiomeDef.h:38
@ biMesa
Definition: BiomeDef.h:64
@ biMesaPlateau
Definition: BiomeDef.h:66
@ biExtremeHillsM
Definition: BiomeDef.h:79
@ biForestHills
Definition: BiomeDef.h:43
@ biNether
Definition: BiomeDef.h:31
@ biBirchForest
Definition: BiomeDef.h:54
@ biBirchForestM
Definition: BiomeDef.h:86
@ biDesert
Definition: BiomeDef.h:24
@ biMesaPlateauF
Definition: BiomeDef.h:65
@ biSunflowerPlains
Definition: BiomeDef.h:77
@ biExtremeHillsPlusM
Definition: BiomeDef.h:92
@ biColdTaigaHills
Definition: BiomeDef.h:58
@ biFlowerForest
Definition: BiomeDef.h:80
@ biMaxBiome
Definition: BiomeDef.h:70
@ biInvalidBiome
Definition: BiomeDef.h:19
@ biMegaSpruceTaiga
Definition: BiomeDef.h:90
@ biStoneBeach
Definition: BiomeDef.h:52
@ biMushroomShore
Definition: BiomeDef.h:40
@ biSavanna
Definition: BiomeDef.h:62
@ biTaigaHills
Definition: BiomeDef.h:44
@ biExtremeHillsPlus
Definition: BiomeDef.h:61
@ biJungle
Definition: BiomeDef.h:46
@ biMegaTaiga
Definition: BiomeDef.h:59
@ biJungleHills
Definition: BiomeDef.h:47
@ biOcean
Definition: BiomeDef.h:22
@ biFirstVariantBiome
Definition: BiomeDef.h:76
@ biDesertHills
Definition: BiomeDef.h:42
@ biBeach
Definition: BiomeDef.h:41
@ biForest
Definition: BiomeDef.h:26
@ biJungleEdgeM
Definition: BiomeDef.h:85
@ biTaigaM
Definition: BiomeDef.h:81
@ biBirchForestHillsM
Definition: BiomeDef.h:87
@ biJungleM
Definition: BiomeDef.h:84
@ biMaxVariantBiome
Definition: BiomeDef.h:100
@ biExtremeHillsEdge
Definition: BiomeDef.h:45
@ biNumVariantBiomes
Definition: BiomeDef.h:99
@ biHell
Definition: BiomeDef.h:30
@ biFrozenRiver
Definition: BiomeDef.h:35
@ biRiver
Definition: BiomeDef.h:29
@ biMesaPlateauFM
Definition: BiomeDef.h:96
@ biMushroomIsland
Definition: BiomeDef.h:39
@ biDeepOcean
Definition: BiomeDef.h:51
@ biSavannaPlateauM
Definition: BiomeDef.h:94
@ biMesaBryce
Definition: BiomeDef.h:95
@ biPlains
Definition: BiomeDef.h:23
@ biRoofedForestM
Definition: BiomeDef.h:88
@ biBirchForestHills
Definition: BiomeDef.h:55
@ biColdBeach
Definition: BiomeDef.h:53
@ biMegaSpruceTaigaHills
Definition: BiomeDef.h:91
@ biSavannaM
Definition: BiomeDef.h:93
@ biSwamplandM
Definition: BiomeDef.h:82
@ biVariant
Definition: BiomeDef.h:73
@ biEnd
Definition: BiomeDef.h:33
@ biIcePlainsSpikes
Definition: BiomeDef.h:83
@ biFrozenOcean
Definition: BiomeDef.h:34
@ biExtremeHills
Definition: BiomeDef.h:25
@ biColdTaiga
Definition: BiomeDef.h:57
@ biSky
Definition: BiomeDef.h:32
@ biFirstBiome
Definition: BiomeDef.h:21
@ biMegaTaigaHills
Definition: BiomeDef.h:60
@ biNumBiomes
Definition: BiomeDef.h:69
@ biRoofedForest
Definition: BiomeDef.h:56
@ biIcePlains
Definition: BiomeDef.h:36
@ biTaiga
Definition: BiomeDef.h:27
@ biDesertM
Definition: BiomeDef.h:78
@ biSavannaPlateau
Definition: BiomeDef.h:63
@ biMesaPlateauM
Definition: BiomeDef.h:97
@ biTundra
Definition: BiomeDef.h:37
@ biColdTaigaM
Definition: BiomeDef.h:89
@ biSwampland
Definition: BiomeDef.h:28
std::string AString
Definition: StringUtils.h:11
Hash for EMCSBiome, so that it can be used in std::unordered_map etc.
Definition: BiomeDef.h:111
std::size_t operator()(const EMCSBiome a_Biome) const
Definition: BiomeDef.h:113