Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion biomenoise.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "tables/btree19.h"
#include "tables/btree20.h"
#include "tables/btree21wd.h"
#include "tables/btree215.h"

#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -1453,11 +1454,20 @@ int climateToBiome(int mc, const uint64_t np[6], uint64_t *dat)
btree21wd_steps, &btree21wd_param[0][0], btree21wd_nodes, btree21wd_order,
sizeof(btree21wd_nodes) / sizeof(uint64_t)
};
static const BiomeTree btree215 = {
btree215_steps, &btree215_param[0][0], btree215_nodes, btree215_order,
sizeof(btree215_nodes) / sizeof(uint64_t)
};

const BiomeTree *bt;
int idx;

if (mc >= MC_1_21_WD)
// THAT IS A LECTURE:
// When you patch a newer version, do not forget to put an 'else'
// here after you add the new biome tree.
if (mc >= MC_1_21_5)
bt = &btree215;
else if (mc >= MC_1_21_WD)
bt = &btree21wd;
else if (mc >= MC_1_20_6)
bt = &btree20;
Expand Down
2 changes: 1 addition & 1 deletion biomenoise.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ STRUCT(Range)
//
// Volumes generated with a range are generally indexed as:
// out [ i_y*sx*sz + i_z*sx + i_x ]
// where i_x, i_y, i_z are indecies in their respective directions.
// where i_x, i_y, i_z are indices in their respective directions.
//
// EXAMPLES
// Area at normal biome scale (1:4):
Expand Down
6 changes: 4 additions & 2 deletions biomes.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,10 @@ enum MCVersion
MC_1_20_6, MC_1_20 = MC_1_20_6,
MC_1_21_1,
MC_1_21_3,
MC_1_21_WD, // Winter Drop, version TBA
MC_1_21 = MC_1_21_WD,
MC_1_21_WD, MC_1_21_4 = MC_1_21_WD,
MC_1_21_5,
MC_1_21_11 = MC_1_21_5,
MC_1_21 = MC_1_21_5,
MC_NEWEST = MC_1_21,
};

Expand Down
11 changes: 11 additions & 0 deletions finders.c
Original file line number Diff line number Diff line change
Expand Up @@ -5470,6 +5470,9 @@ static const int g_biome_para_range_21wd_diff[][13] = {
{pale_garden , -1500, 2000, 3000, IMAX, 300, IMAX, -7799, 500, IMIN, IMAX, 2666, IMAX},
{-1,0,0,0,0,0,0,0,0,0,0,0,0}};

static const int g_biome_para_range_215_diff[][13] = {
{pale_garden , -1500, 2000, 3000, IMAX, 300, IMAX, -7799, 500, IMIN, IMAX, IMIN, IMAX},
{-1,0,0,0,0,0,0,0,0,0,0,0,0}};

/**
* Gets the min/max parameter values within which a biome change can occur.
Expand Down Expand Up @@ -5508,6 +5511,14 @@ const int *getBiomeParaLimits(int mc, int id)
if (mc <= MC_1_17)
return NULL;
int i;
if (mc > MC_1_21_WD)
{
for (i = 0; g_biome_para_range_215_diff[i][0] != -1; i++)
{
if (g_biome_para_range_215_diff[i][0] == id)
return &g_biome_para_range_215_diff[i][1];
}
}
if (mc > MC_1_21_3)
{
for (i = 0; g_biome_para_range_21wd_diff[i][0] != -1; i++)
Expand Down
4 changes: 3 additions & 1 deletion generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ int genArea(const Layer *layer, int *out, int areaX, int areaZ, int areaWidth, i
/**
* Map an approximation of the Overworld surface height.
* The horizontal scaling is 1:4. If non-null, the ids are filled with the
* biomes of the area. The height (written to y) is in blocks.
* biomes of the area. The height (written to y[w*h]) is in blocks.
* If the Generator's dimension is Overworld and version before Beta 1.8
* or after 1.18, SurfaceNoise is not needed.
*/
int mapApproxHeight(float *y, int *ids, const Generator *g,
const SurfaceNoise *sn, int x, int z, int w, int h);
Expand Down
Loading