Add Beta 1.7 and its unique biomes to enums, util

(layers.h)
- Add MC_B1_7 to MCVersion enum
- Add name mappings for B1.7 biomes to BiomeID enum

(util.c)
- Add Beta 1.7 to mc2str and str2mc functions
- Add name mappings for B1.7 biomes to biome2str function
This commit is contained in:
Kai Sandstrom 2023-01-19 15:13:58 -05:00
parent 03895e6c22
commit 3bfdd1d056
2 changed files with 20 additions and 0 deletions

View File

@ -13,6 +13,7 @@ enum MCVersion
// NOTE: Development effort focuses on just the newest patch for each major
// release. Minor releases and major versions <= 1.0 are experimental.
MC_UNDEF,
MC_B1_7,
MC_B1_8,
MC_1_0_0, MC_1_0 = MC_1_0_0,
MC_1_1_0, MC_1_1 = MC_1_1_0,
@ -163,6 +164,10 @@ enum BiomeID
// 1.19
deep_dark = 183,
mangrove_swamp = 184,
// Alpha 1.2 - Beta 1.7
seasonal_forest = wooded_hills;
rainforest = jungle;
shrubland = windswept_savanna;
};

15
util.c
View File

@ -48,6 +48,7 @@ const char* mc2str(int mc)
{
switch (mc)
{
case MC_B1_7: return "Beta 1.7"; break;
case MC_B1_8: return "Beta 1.8"; break;
case MC_1_0: return "1.0"; break;
case MC_1_1: return "1.1"; break;
@ -98,6 +99,7 @@ int str2mc(const char *s)
if (!strcmp(s, "1.1")) return MC_1_1;
if (!strcmp(s, "1.0")) return MC_1_0;
if (!strcmp(s, "Beta 1.8")) return MC_B1_8;
if (!strcmp(s, "Beta 1.7")) return MC_B1_7;
return -1;
}
@ -123,6 +125,19 @@ const char *biome2str(int mc, int id)
case wooded_badlands: return "wooded_badlands";
}
}
if (mc <= MC_B1_7)
{
// ids and colors re-used for Alpha 1.2 - Beta 1.7 biomes:
// wooded_hills used for seasonal_forest
// windswept_savanna used for shrubland
// jungle used for rainforest
switch(id)
{
case wooded_hills: return "seasonal_forest";
case windswept_savanna: return "shrubland";
case jungle: return "rainforest";
}
}
switch (id)
{