mirror of
https://github.com/Cubitect/cubiomes.git
synced 2025-09-23 11:45:27 -04:00
Added available biome checker
This commit is contained in:
parent
95723f90bb
commit
136e645ce9
28
finders.c
28
finders.c
@ -2676,8 +2676,7 @@ BiomeFilter setupBiomeFilter(
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef struct
|
typedef struct {
|
||||||
{
|
|
||||||
Generator *g;
|
Generator *g;
|
||||||
int *ids;
|
int *ids;
|
||||||
Range r;
|
Range r;
|
||||||
@ -3510,6 +3509,31 @@ int canBiomeGenerate(int layerId, int mc, int id)
|
|||||||
return isOverworld(mc, id);
|
return isOverworld(mc, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void getAvailableBiomes(uint64_t *mL, uint64_t *mM, int layerId, int mc)
|
||||||
|
{
|
||||||
|
*mL = *mM = 0;
|
||||||
|
int i;
|
||||||
|
if (mc >= MC_1_18)
|
||||||
|
{
|
||||||
|
for (i = 0; i < 64; i++)
|
||||||
|
{
|
||||||
|
if (isOverworld(mc, i))
|
||||||
|
*mL |= (1ULL << i);
|
||||||
|
if (isOverworld(mc, i+128))
|
||||||
|
*mM |= (1ULL << i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < 64; i++)
|
||||||
|
{
|
||||||
|
if (canBiomeGenerate(layerId, mc, i))
|
||||||
|
*mL |= (1ULL << i);
|
||||||
|
if (canBiomeGenerate(layerId, mc, i+128))
|
||||||
|
*mM |= (1ULL << i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This function requires testing across versions
|
// TODO: This function requires testing across versions
|
||||||
void genPotential(uint64_t *mL, uint64_t *mM, int layer, int mc, int id)
|
void genPotential(uint64_t *mL, uint64_t *mM, int layer, int mc, int id)
|
||||||
|
12
finders.h
12
finders.h
@ -134,6 +134,7 @@ STRUCT(BiomeFilter)
|
|||||||
uint64_t oceanToFind; // all required ocean types
|
uint64_t oceanToFind; // all required ocean types
|
||||||
|
|
||||||
int specialCnt; // number of special temperature categories required
|
int specialCnt; // number of special temperature categories required
|
||||||
|
int padding[1]; // unused
|
||||||
|
|
||||||
// excluded biomes that shall not be present
|
// excluded biomes that shall not be present
|
||||||
uint64_t biomeToExcl, biomeToExclM;
|
uint64_t biomeToExcl, biomeToExclM;
|
||||||
@ -726,13 +727,20 @@ int checkForTemps(LayerStack *g, uint64_t seed, int x, int z, int w, int h, cons
|
|||||||
*/
|
*/
|
||||||
int canBiomeGenerate(int layerId, int mc, int biomeID);
|
int canBiomeGenerate(int layerId, int mc, int biomeID);
|
||||||
|
|
||||||
/* Given a biome 'id' at a generation 'layer', this functions finds which
|
/* Given a biome 'id' at a generation 'layerId', this functions finds which
|
||||||
* biomes may generate from it. The result is stored in the bitfields:
|
* biomes may generate from it. The result is stored in the bitfields:
|
||||||
* mL : for ids 0-63
|
* mL : for ids 0-63
|
||||||
* mM : for ids 128-191
|
* mM : for ids 128-191
|
||||||
*/
|
*/
|
||||||
void genPotential(uint64_t *mL, uint64_t *mM, int layer, int mc, int id);
|
void genPotential(uint64_t *mL, uint64_t *mM, int layerId, int mc, int id);
|
||||||
|
|
||||||
|
/* Gets the biomes that can generate in the given version and layer ID.
|
||||||
|
* In contrast to canBiomeGenerate() and genPotential() it also supports 1.18+,
|
||||||
|
* where the layerId is ignored.
|
||||||
|
* mL : for ids 0-63
|
||||||
|
* mM : for ids 128-191
|
||||||
|
*/
|
||||||
|
void getAvailableBiomes(uint64_t *mL, uint64_t *mM, int layerId, int mc);
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
// Biome Noise Finders (for 1.18+)
|
// Biome Noise Finders (for 1.18+)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user