improve rain simulation (#4017)
* Uses vanilla logic to decide which blocks rain falls through. * Rain falls infinitely above the world, and stops at y=0. * Entities will now be extinguished if they are under rain-blocking blocks, and fire will now be extinguished by rain similarly. * Create IsWeatherWetAtXYZ to identify wetness at a particular location. * Use new code for enderman rain detection. * Fixes issue #916 * Disable warnings for global constructors in the fire simulator.
This commit is contained in:
committed by
GitHub
parent
ab5ff6a6f8
commit
6309c6a97f
@@ -542,6 +542,34 @@ void cWorld::ChangeWeather(void)
|
||||
|
||||
|
||||
|
||||
bool cWorld::IsWeatherWetAtXYZ(Vector3i a_Pos)
|
||||
{
|
||||
if ((a_Pos.y < 0) || !IsWeatherWetAt(a_Pos.x, a_Pos.z))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (a_Pos.y >= cChunkDef::Height)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
for (int y = GetHeight(a_Pos.x, a_Pos.z); y >= a_Pos.y; y--)
|
||||
{
|
||||
auto BlockType = GetBlock({a_Pos.x, y, a_Pos.z});
|
||||
if (cBlockInfo::IsRainBlocker(BlockType))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void cWorld::SetNextBlockTick(int a_BlockX, int a_BlockY, int a_BlockZ)
|
||||
{
|
||||
return m_ChunkMap->SetNextBlockTick(a_BlockX, a_BlockY, a_BlockZ);
|
||||
|
||||
Reference in New Issue
Block a user