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
+24 -8
View File
@@ -2237,7 +2237,7 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
Type = "boolean",
},
},
Notes = "Returns true if the current world is raining (no thunderstorm).",
Notes = "Returns true if the current weather is rainy.",
},
IsWeatherRainAt =
{
@@ -2258,7 +2258,7 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
Type = "boolean",
},
},
Notes = "Returns true if the specified location is raining (takes biomes into account - it never rains in a desert).",
Notes = "Returns true if it is rainy at the specified location. This takes into account biomes.",
},
IsWeatherStorm =
{
@@ -2268,7 +2268,7 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
Type = "boolean",
},
},
Notes = "Returns true if the current world is stormy.",
Notes = "Returns true if the current weather is stormy.",
},
IsWeatherStormAt =
{
@@ -2289,7 +2289,7 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
Type = "boolean",
},
},
Notes = "Returns true if the specified location is stormy (takes biomes into account - no storm in a desert).",
Notes = "Returns true if it is stormy at the specified location. This takes into account biomes.",
},
IsWeatherSunny =
{
@@ -2320,7 +2320,7 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
Type = "boolean",
},
},
Notes = "Returns true if the current weather is sunny at the specified location (takes into account biomes).",
Notes = "Returns true if it is sunny at the specified location. This takes into account biomes.",
},
IsWeatherWet =
{
@@ -2330,7 +2330,7 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
Type = "boolean",
},
},
Notes = "Returns true if the current world has any precipitation (rain or storm).",
Notes = "Returns true if the world currently has any precipitation - rain, storm or snow.",
},
IsWeatherWetAt =
{
@@ -2351,7 +2351,24 @@ function OnAllChunksAvailable()</pre> All return values from the callbacks are i
Type = "boolean",
},
},
Notes = "Returns true if the specified location has any precipitation (rain or storm) (takes biomes into account, deserts are never wet).",
Notes = "Returns true if it is raining or storming at the specified location. This takes into account biomes.",
},
IsWeatherWetAtXYZ =
{
Params =
{
{
Name = "Pos",
Type = "Vector3i",
},
},
Returns =
{
{
Type = "boolean",
},
},
Notes = "Returns true if the specified location has wet weather (rain or storm), using the same logic as IsWeatherWetAt, except that any rain-blocking blocks above the specified position will block the precipitation and this function will return false.",
},
PrepareChunk =
{
@@ -3637,4 +3654,3 @@ World:ForEachEntity(
},
},
}