summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks')
-rw-r--r--src/Blocks/BlockCauldron.h14
-rw-r--r--src/Blocks/WorldInterface.h3
2 files changed, 17 insertions, 0 deletions
diff --git a/src/Blocks/BlockCauldron.h b/src/Blocks/BlockCauldron.h
index 41b79b6c3..8b5cd9ccb 100644
--- a/src/Blocks/BlockCauldron.h
+++ b/src/Blocks/BlockCauldron.h
@@ -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);
+ }
+ }
} ;
diff --git a/src/Blocks/WorldInterface.h b/src/Blocks/WorldInterface.h
index bfbb053d9..08600d502 100644
--- a/src/Blocks/WorldInterface.h
+++ b/src/Blocks/WorldInterface.h
@@ -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;
+
};