diff options
author | mBornand <63592189+mBornand@users.noreply.github.com> | 2020-05-08 11:04:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-08 11:04:07 +0200 |
commit | 1565d9b3ce8e74cdf8d2c95181f98531794f2c36 (patch) | |
tree | 09f6d9158cd2c583789d5c23bc174be115178972 /src/Items | |
parent | Fix SetBlockMeta call in observer handler (#4728) (diff) | |
download | cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.gz cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.bz2 cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.lz cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.xz cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.tar.zst cuberite-1565d9b3ce8e74cdf8d2c95181f98531794f2c36.zip |
Diffstat (limited to 'src/Items')
-rw-r--r-- | src/Items/ItemBoat.h | 4 | ||||
-rw-r--r-- | src/Items/ItemBottle.h | 4 | ||||
-rw-r--r-- | src/Items/ItemBucket.h | 14 | ||||
-rw-r--r-- | src/Items/ItemLilypad.h | 8 |
4 files changed, 15 insertions, 15 deletions
diff --git a/src/Items/ItemBoat.h b/src/Items/ItemBoat.h index b6af554c5..d6e9ed7c3 100644 --- a/src/Items/ItemBoat.h +++ b/src/Items/ItemBoat.h @@ -52,11 +52,11 @@ public: { } - virtual bool OnNextBlock(int a_CBBlockX, int a_CBBlockY, int a_CBBlockZ, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, eBlockFace a_CBEntryFace) override + virtual bool OnNextBlock(Vector3i a_CBBlockPos, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, eBlockFace a_CBEntryFace) override { if (a_CBBlockType != E_BLOCK_AIR) { - m_Pos.Set(a_CBBlockX, a_CBBlockY, a_CBBlockZ); + m_Pos = a_CBBlockPos; m_HasFound = true; return true; } diff --git a/src/Items/ItemBottle.h b/src/Items/ItemBottle.h index 2f4d8f93f..84950de29 100644 --- a/src/Items/ItemBottle.h +++ b/src/Items/ItemBottle.h @@ -43,7 +43,7 @@ public: { } - virtual bool OnNextBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, eBlockFace a_EntryFace) override + virtual bool OnNextBlock(Vector3i a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, eBlockFace a_EntryFace) override { if (IsBlockWater(a_BlockType)) { @@ -52,7 +52,7 @@ public: return false; } m_HasHitFluid = true; - m_Pos.Set(a_BlockX, a_BlockY, a_BlockZ); + m_Pos = a_BlockPosition; return true; } return false; diff --git a/src/Items/ItemBucket.h b/src/Items/ItemBucket.h index d2a9b1884..7e1e2c07f 100644 --- a/src/Items/ItemBucket.h +++ b/src/Items/ItemBucket.h @@ -197,7 +197,7 @@ public: { } - virtual bool OnNextBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, eBlockFace a_EntryFace) override + virtual bool OnNextBlock(Vector3i a_BlockPosition, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, eBlockFace a_EntryFace) override { if (IsBlockWater(a_BlockType) || IsBlockLava(a_BlockType)) { @@ -206,7 +206,7 @@ public: return false; } m_HasHitFluid = true; - m_Pos.Set(a_BlockX, a_BlockY, a_BlockZ); + m_Pos = a_BlockPosition; return true; } return false; @@ -217,7 +217,7 @@ public: Vector3d Start(a_Player->GetEyePosition() + a_Player->GetLookVector()); Vector3d End(a_Player->GetEyePosition() + a_Player->GetLookVector() * 5); - Tracer.Trace(Start.x, Start.y, Start.z, End.x, End.y, End.z); + Tracer.Trace(Start, End); if (!Callbacks.m_HasHitFluid) { @@ -244,7 +244,7 @@ public: NIBBLETYPE m_ReplacedBlockMeta; eBlockFace m_EntryFace; - virtual bool OnNextBlock(int a_CBBlockX, int a_CBBlockY, int a_CBBlockZ, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, eBlockFace a_CBEntryFace) override + virtual bool OnNextBlock(Vector3i a_CBBlockPos, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, eBlockFace a_CBEntryFace) override { if ((a_CBBlockType != E_BLOCK_AIR) && !IsBlockLiquid(a_CBBlockType)) { @@ -253,9 +253,9 @@ public: m_EntryFace = static_cast<eBlockFace>(a_CBEntryFace); if (!cFluidSimulator::CanWashAway(a_CBBlockType)) { - AddFaceDirection(a_CBBlockX, a_CBBlockY, a_CBBlockZ, a_CBEntryFace); // Was an unwashawayable block, can't overwrite it! + a_CBBlockPos = AddFaceDirection(a_CBBlockPos, a_CBEntryFace); // Was an unwashawayable block, can't overwrite it! } - m_Pos.Set(a_CBBlockX, a_CBBlockY, a_CBBlockZ); // (Block could be washed away, replace it) + m_Pos = a_CBBlockPos; // (Block could be washed away, replace it) return true; // Abort tracing } return false; @@ -269,7 +269,7 @@ public: // cLineBlockTracer::Trace() returns true when whole line was traversed. By returning true from the callback when we hit something, // we ensure that this never happens if liquid could be placed // Use this to judge whether the position is valid - if (!Tracer.Trace(Start.x, Start.y, Start.z, End.x, End.y, End.z)) + if (!Tracer.Trace(Start, End)) { a_BlockPos = Callbacks.m_Pos; a_BlockType = Callbacks.m_ReplacedBlockType; diff --git a/src/Items/ItemLilypad.h b/src/Items/ItemLilypad.h index 1190e817b..747175811 100644 --- a/src/Items/ItemLilypad.h +++ b/src/Items/ItemLilypad.h @@ -66,7 +66,7 @@ public: { } - virtual bool OnNextBlock(int a_CBBlockX, int a_CBBlockY, int a_CBBlockZ, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, eBlockFace a_CBEntryFace) override + virtual bool OnNextBlock(Vector3i a_CBBlockPos, BLOCKTYPE a_CBBlockType, NIBBLETYPE a_CBBlockMeta, eBlockFace a_CBEntryFace) override { if (IsBlockWater(a_CBBlockType)) { @@ -74,7 +74,7 @@ public: { return false; } - AddFaceDirection(a_CBBlockX, a_CBBlockY, a_CBBlockZ, BLOCK_FACE_YP); // Always place pad at top of water block + a_CBBlockPos = AddFaceDirection(a_CBBlockPos, BLOCK_FACE_YP); // Always place pad at top of water block if ( !IsBlockWater(a_CBBlockType) && cBlockInfo::FullyOccupiesVoxel(a_CBBlockType) @@ -84,7 +84,7 @@ public: return true; } m_HasHitFluid = true; - m_Pos.Set(a_CBBlockX, a_CBBlockY, a_CBBlockZ); + m_Pos = a_CBBlockPos; return true; } return false; @@ -96,7 +96,7 @@ public: } Callbacks; auto Start = a_Player->GetEyePosition() + a_Player->GetLookVector(); auto End = a_Player->GetEyePosition() + a_Player->GetLookVector() * 5; - cLineBlockTracer::Trace(*a_Player->GetWorld(), Callbacks, Start.x, Start.y, Start.z, End.x, End.y, End.z); + cLineBlockTracer::Trace(*a_Player->GetWorld(), Callbacks, Start, End); if (Callbacks.m_HasHitFluid) { |