1
0
Fork 0

Cauldrons fill

This commit is contained in:
Tiger Wang 2014-05-29 16:58:40 +01:00
parent 444cce1269
commit cea3a8e7e8
4 changed files with 19 additions and 3 deletions

View File

@ -58,6 +58,20 @@ public:
{
return true;
}
virtual void OnUpdate(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
{
if (!a_WorldInterface.IsWeatherWet())
{
return;
}
NIBBLETYPE Meta = a_Chunk.GetMeta(a_RelX, a_RelY, a_RelZ);
if (Meta < 3)
{
a_Chunk.SetMeta(a_RelX, a_RelY, a_RelZ, Meta + 1);
}
}
} ;

View File

@ -37,4 +37,7 @@ public:
virtual void SetTimeOfDay(Int64 a_TimeOfDay) = 0;
/** Returns true if the current weather has any precipitation - rain or storm */
virtual bool IsWeatherWet(void) const = 0;
};

View File

@ -961,7 +961,6 @@ void cChunk::ApplyWeatherToTop()
}
break;
} // case (snowy biomes)
// TODO: Rainy biomes should check for farmland and cauldrons
default:
{
break;

View File

@ -690,8 +690,8 @@ public:
bool IsWeatherStorm(void) const { return (m_Weather == wStorm); }
/** Returns true if the current weather has any precipitation - rain or storm */
bool IsWeatherWet (void) const { return (m_Weather != wSunny); }
virtual bool IsWeatherWet(void) const override { return (m_Weather != wSunny); }
// tolua_end
cChunkGenerator & GetGenerator(void) { return m_Generator; }