1
0

Get biome at world coords on mob spawn (#4692)

This commit is contained in:
Mat 2020-04-25 01:00:27 +03:00 committed by GitHub
parent c0e7708aa7
commit 9432b57ba8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -596,7 +596,10 @@ void cChunk::SpawnMobs(cMobSpawner & a_MobSpawner)
ASSERT(TryY > 0);
ASSERT(TryY < cChunkDef::Height - 1);
EMCSBiome Biome = m_ChunkMap->GetBiomeAt(TryX, TryZ);
int WorldX, WorldY, WorldZ;
PositionToWorldPosition(TryX, TryY, TryZ, WorldX, WorldY, WorldZ);
EMCSBiome Biome = m_ChunkMap->GetBiomeAt(WorldX, WorldZ);
// MG TODO :
// Moon cycle (for slime)
// check player and playerspawn presence < 24 blocks
@ -621,8 +624,6 @@ void cChunk::SpawnMobs(cMobSpawner & a_MobSpawner)
{
continue;
}
int WorldX, WorldY, WorldZ;
PositionToWorldPosition(TryX, TryY, TryZ, WorldX, WorldY, WorldZ);
double ActualX = WorldX + 0.5;
double ActualZ = WorldZ + 0.5;
newMob->SetPosition(ActualX, WorldY, ActualZ);