1
0

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:
Alexander Harkness
2017-12-26 21:25:57 +00:00
committed by GitHub
parent ab5ff6a6f8
commit 6309c6a97f
12 changed files with 180 additions and 113 deletions

View File

@@ -464,6 +464,16 @@ cBlockInfo::cBlockInfoArray::cBlockInfoArray()
Info[E_BLOCK_YELLOW_SHULKER_BOX ].m_PistonBreakable = true;
/* Blocks that block rain or snow's passage:
* All solid blocks are also rain blockers, and they are set automatically
* at the end of this function.
*/
Info[E_BLOCK_SIGN_POST ].m_IsRainBlocker = true;
Info[E_BLOCK_WALLSIGN ].m_IsRainBlocker = true;
Info[E_BLOCK_WALL_BANNER ].m_IsRainBlocker = true;
Info[E_BLOCK_STANDING_BANNER ].m_IsRainBlocker = true;
// Blocks that can be snowed over:
Info[E_BLOCK_BEDROCK ].m_IsSnowable = true;
Info[E_BLOCK_BLOCK_OF_COAL ].m_IsSnowable = true;
@@ -554,8 +564,8 @@ cBlockInfo::cBlockInfoArray::cBlockInfoArray()
Info[E_BLOCK_BIG_FLOWER ].m_IsSolid = false;
Info[E_BLOCK_BROWN_MUSHROOM ].m_IsSolid = false;
Info[E_BLOCK_CARROTS ].m_IsSolid = false;
Info[E_BLOCK_CHORUS_PLANT ].m_IsSolid = false;
Info[E_BLOCK_CHORUS_FLOWER ].m_IsSolid = false;
Info[E_BLOCK_CHORUS_PLANT ].m_IsSolid = false;
Info[E_BLOCK_COBWEB ].m_IsSolid = false;
Info[E_BLOCK_CROPS ].m_IsSolid = false;
Info[E_BLOCK_DANDELION ].m_IsSolid = false;
@@ -575,17 +585,17 @@ cBlockInfo::cBlockInfoArray::cBlockInfoArray()
Info[E_BLOCK_POTATOES ].m_IsSolid = false;
Info[E_BLOCK_POWERED_RAIL ].m_IsSolid = false;
Info[E_BLOCK_RAIL ].m_IsSolid = false;
Info[E_BLOCK_RED_MUSHROOM ].m_IsSolid = false;
Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_IsSolid = false;
Info[E_BLOCK_REDSTONE_TORCH_ON ].m_IsSolid = false;
Info[E_BLOCK_REDSTONE_WIRE ].m_IsSolid = false;
Info[E_BLOCK_RED_MUSHROOM ].m_IsSolid = false;
Info[E_BLOCK_REEDS ].m_IsSolid = false;
Info[E_BLOCK_SAPLING ].m_IsSolid = false;
Info[E_BLOCK_SIGN_POST ].m_IsSolid = false;
Info[E_BLOCK_SNOW ].m_IsSolid = false;
Info[E_BLOCK_STANDING_BANNER ].m_IsSolid = false;
Info[E_BLOCK_STATIONARY_LAVA ].m_IsSolid = false;
Info[E_BLOCK_STATIONARY_WATER ].m_IsSolid = false;
Info[E_BLOCK_STANDING_BANNER ].m_IsSolid = false;
Info[E_BLOCK_STONE_BUTTON ].m_IsSolid = false;
Info[E_BLOCK_STONE_PRESSURE_PLATE ].m_IsSolid = false;
Info[E_BLOCK_TALL_GRASS ].m_IsSolid = false;
@@ -974,8 +984,9 @@ cBlockInfo::cBlockInfoArray::cBlockInfoArray()
Info[E_BLOCK_RED_SHULKER_BOX ].m_Hardness = 0.2f;
Info[E_BLOCK_BLACK_SHULKER_BOX ].m_Hardness = 0.2f;
Info[E_BLOCK_STRUCTURE_BLOCK ].m_Hardness = -1.0f;
for (size_t i = 0; i < Info.size(); ++i)
{
Info[i].m_IsRainBlocker |= Info[i].m_IsSolid;
}
}