mirror of
https://github.com/KaDerox/Axo-McLCE-ModLoader.git
synced 2026-07-18 02:40:56 +00:00
Add biome spawn registration functions
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
#include "..\..\Minecraft.World\Biome.h"
|
||||
|
||||
#include "AxoAPI.h"
|
||||
#include "AxoWorldGen.h"
|
||||
|
||||
struct AxoSpawnEntry {
|
||||
int blockId;
|
||||
@@ -20,6 +21,16 @@ struct AxoSpawnEntry {
|
||||
};
|
||||
|
||||
static std::vector<AxoSpawnEntry> sSpawnEntries;
|
||||
static std::vector<AxoBiomeSpawnEntry> sBiomeSpawnEntries;
|
||||
|
||||
void AxoWorldGen_RegisterBiomeSpawn(int biomeId, int weight) {
|
||||
sBiomeSpawnEntries.push_back({biomeId, weight});
|
||||
printf("[AxoLoader] Registered biome spawn id=%d weight=%d\n", biomeId, weight);
|
||||
}
|
||||
|
||||
const std::vector<AxoBiomeSpawnEntry>& AxoWorldGen_GetCustomBiomes() {
|
||||
return sBiomeSpawnEntries;
|
||||
}
|
||||
|
||||
void AxoWorldGen_RegisterSpawn(int blockId, const AxoBlockSpawnDef& spawn) {
|
||||
if (!spawn.enabled) return;
|
||||
@@ -82,4 +93,4 @@ void AxoWorldGen_Decorate(Level* level, Random* random, Biome* biome, int xo, in
|
||||
}
|
||||
}
|
||||
level->setInstaTick(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user