summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockCauldron.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-07-29 17:48:56 +0200
committerMattes D <github@xoft.cz>2014-07-29 17:48:56 +0200
commit30e64ed4d82c9ef9ac0797a443d07c3f62649b54 (patch)
tree32ff101a034c0af7d8b4067744b367fcc08e5751 /src/Blocks/BlockCauldron.h
parentMerge pull request #1254 from mc-server/SingleTopBlockFinisher (diff)
parentDetrailed whitespace (diff)
downloadcuberite-30e64ed4d82c9ef9ac0797a443d07c3f62649b54.tar
cuberite-30e64ed4d82c9ef9ac0797a443d07c3f62649b54.tar.gz
cuberite-30e64ed4d82c9ef9ac0797a443d07c3f62649b54.tar.bz2
cuberite-30e64ed4d82c9ef9ac0797a443d07c3f62649b54.tar.lz
cuberite-30e64ed4d82c9ef9ac0797a443d07c3f62649b54.tar.xz
cuberite-30e64ed4d82c9ef9ac0797a443d07c3f62649b54.tar.zst
cuberite-30e64ed4d82c9ef9ac0797a443d07c3f62649b54.zip
Diffstat (limited to 'src/Blocks/BlockCauldron.h')
-rw-r--r--src/Blocks/BlockCauldron.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Blocks/BlockCauldron.h b/src/Blocks/BlockCauldron.h
index 41b79b6c3..e0f86f4cb 100644
--- a/src/Blocks/BlockCauldron.h
+++ b/src/Blocks/BlockCauldron.h
@@ -58,6 +58,24 @@ 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
+ {
+ int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width;
+ int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width;
+ if (!a_WorldInterface.IsWeatherWetAt(BlockX, BlockZ) || (a_RelY != a_WorldInterface.GetHeight(BlockX, BlockZ)))
+ {
+ // It's not raining at our current location or we do not have a direct view of the sky
+ // We cannot eat the rain :(
+ 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);
+ }
+ }
} ;