summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2015-01-25 01:03:48 +0100
committerHowaner <franzi.moos@googlemail.com>2015-01-25 01:03:48 +0100
commitba9ab96aef9bc29189df38c8aef02ce22dac202c (patch)
tree32c62c0dcf901c9da05de739d0b66315cca49ee0 /src/Blocks
parentMerge branch 'master' into Sponge (diff)
downloadcuberite-ba9ab96aef9bc29189df38c8aef02ce22dac202c.tar
cuberite-ba9ab96aef9bc29189df38c8aef02ce22dac202c.tar.gz
cuberite-ba9ab96aef9bc29189df38c8aef02ce22dac202c.tar.bz2
cuberite-ba9ab96aef9bc29189df38c8aef02ce22dac202c.tar.lz
cuberite-ba9ab96aef9bc29189df38c8aef02ce22dac202c.tar.xz
cuberite-ba9ab96aef9bc29189df38c8aef02ce22dac202c.tar.zst
cuberite-ba9ab96aef9bc29189df38c8aef02ce22dac202c.zip
Diffstat (limited to 'src/Blocks')
-rw-r--r--src/Blocks/BlockSponge.h14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Blocks/BlockSponge.h b/src/Blocks/BlockSponge.h
index 2e920e856..7bb692c37 100644
--- a/src/Blocks/BlockSponge.h
+++ b/src/Blocks/BlockSponge.h
@@ -26,16 +26,14 @@ public:
}
- virtual void OnPlacedByPlayer(
- cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player,
- int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
- int a_CursorX, int a_CursorY, int a_CursorZ,
- BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta
- )
+ virtual void OnPlacedByPlayer(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, const sSetBlock & a_BlockChange) override
{
- if (a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ) == E_META_SPONGE_NORMAL)
+ if (a_BlockChange.m_BlockMeta == E_META_SPONGE_NORMAL)
{
- AbsorbWater(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ);
+ int BlockX = a_BlockChange.m_ChunkX * cChunkDef::Width + a_BlockChange.m_RelX;
+ int BlockZ = a_BlockChange.m_ChunkZ * cChunkDef::Width + a_BlockChange.m_RelZ;
+
+ AbsorbWater(a_ChunkInterface, BlockX, a_BlockChange.m_RelY, BlockZ);
}
}