summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemLilypad.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-04-04 09:56:57 +0200
committermadmaxoft <github@xoft.cz>2014-04-04 09:56:57 +0200
commit402d85d896c793644681c4bb2934a7e0abb5ed8c (patch)
tree1cf3fa3d08cf88829695f8d063e3132be3f9e9b9 /src/Items/ItemLilypad.h
parentProtoProxy: Fixed a few Clang and MSVC warnings. (diff)
downloadcuberite-402d85d896c793644681c4bb2934a7e0abb5ed8c.tar
cuberite-402d85d896c793644681c4bb2934a7e0abb5ed8c.tar.gz
cuberite-402d85d896c793644681c4bb2934a7e0abb5ed8c.tar.bz2
cuberite-402d85d896c793644681c4bb2934a7e0abb5ed8c.tar.lz
cuberite-402d85d896c793644681c4bb2934a7e0abb5ed8c.tar.xz
cuberite-402d85d896c793644681c4bb2934a7e0abb5ed8c.tar.zst
cuberite-402d85d896c793644681c4bb2934a7e0abb5ed8c.zip
Diffstat (limited to 'src/Items/ItemLilypad.h')
-rw-r--r--src/Items/ItemLilypad.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/Items/ItemLilypad.h b/src/Items/ItemLilypad.h
index 5a29abe94..8fc1d8543 100644
--- a/src/Items/ItemLilypad.h
+++ b/src/Items/ItemLilypad.h
@@ -16,17 +16,19 @@ class cItemLilypadHandler :
typedef cItemHandler super;
public:
- cItemLilypadHandler(BLOCKTYPE a_BlockType)
- : cItemHandler(a_BlockType)
+ cItemLilypadHandler(int a_ItemType):
+ super(a_ItemType)
{
}
+
virtual bool IsPlaceable(void) override
{
return false; // Set as not placeable so OnItemUse is called
}
+
virtual bool OnItemUse(cWorld * a_World, cPlayer * a_Player, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
{
if (a_BlockFace > BLOCK_FACE_NONE)
@@ -45,23 +47,22 @@ public:
public cBlockTracer::cCallbacks
{
public:
- cCallbacks(cWorld * a_World) :
+ cCallbacks(cWorld * a_CBWorld) :
m_HasHitFluid(false),
- m_World(a_World)
+ m_World(a_CBWorld)
{
}
- virtual bool OnNextBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, char a_EntryFace) override
+ virtual bool OnNextBlock(int a_CBBlockX, int a_CBBlockY, int a_CBBlockZ, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, char a_CBEntryFace) override
{
- if (IsBlockWater(a_BlockType))
+ if (IsBlockWater(a_CBBlockType))
{
- if ((a_BlockMeta != 0) || (a_EntryFace == BLOCK_FACE_NONE)) // The hit block should be a source. The FACE_NONE check is clicking whilst submerged
+ if ((a_CBBlockMeta != 0) || (a_CBEntryFace == BLOCK_FACE_NONE)) // The hit block should be a source. The FACE_NONE check is clicking whilst submerged
{
return false;
}
- a_EntryFace = BLOCK_FACE_YP; // Always place pad at top of water block
- AddFaceDirection(a_BlockX, a_BlockY, a_BlockZ, (eBlockFace)a_EntryFace);
- BLOCKTYPE Block = m_World->GetBlock(a_BlockX, a_BlockY, a_BlockZ);
+ AddFaceDirection(a_CBBlockX, a_CBBlockY, a_CBBlockZ, BLOCK_FACE_YP); // Always place pad at top of water block
+ BLOCKTYPE Block = m_World->GetBlock(a_CBBlockX, a_CBBlockY, a_CBBlockZ);
if (
!IsBlockWater(Block) &&
cBlockInfo::FullyOccupiesVoxel(Block)
@@ -71,7 +72,7 @@ public:
return true;
}
m_HasHitFluid = true;
- m_Pos.Set(a_BlockX, a_BlockY, a_BlockZ);
+ m_Pos.Set(a_CBBlockX, a_CBBlockY, a_CBBlockZ);
return true;
}
return false;