diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2022-07-11 00:56:25 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2022-07-19 23:33:09 +0200 |
commit | 284f54ed81186d3122b994db7395e870703efb4f (patch) | |
tree | 51a4b5c4a7e9fdde460c84117ea8f9ea6ed97393 /src/Items/ItemBucket.h | |
parent | Move LineBlockTracer into Physics (diff) | |
download | cuberite-Megumin.tar cuberite-Megumin.tar.gz cuberite-Megumin.tar.bz2 cuberite-Megumin.tar.lz cuberite-Megumin.tar.xz cuberite-Megumin.tar.zst cuberite-Megumin.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Items/ItemBucket.h | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/Items/ItemBucket.h b/src/Items/ItemBucket.h index e7fa0fe38..4403342f8 100644 --- a/src/Items/ItemBucket.h +++ b/src/Items/ItemBucket.h @@ -6,7 +6,7 @@ #include "../World.h" #include "../Simulator/FluidSimulator.h" #include "../Blocks/BlockHandler.h" -#include "../LineBlockTracer.h" +#include "../Physics/Tracers/LineBlockTracer.h" #include "../Blocks/ChunkInterface.h" @@ -185,7 +185,7 @@ public: bool GetBlockFromTrace(cWorld * a_World, cPlayer * a_Player, Vector3i & a_BlockPos) const { class cCallbacks : - public cBlockTracer::cCallbacks + public BlockTracerCallbacks { public: Vector3i m_Pos; @@ -213,11 +213,10 @@ public: } } Callbacks; - cLineBlockTracer Tracer(*a_World, Callbacks); Vector3d Start(a_Player->GetEyePosition() + a_Player->GetLookVector()); Vector3d End(a_Player->GetEyePosition() + a_Player->GetLookVector() * 5); - Tracer.Trace(Start, End); + LineBlockTracer::Trace(*a_World, Callbacks, Start, End); if (!Callbacks.m_HasHitFluid) { @@ -236,7 +235,7 @@ public: bool GetPlacementCoordsFromTrace(cWorld * a_World, cPlayer * a_Player, Vector3i & a_BlockPos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta, eBlockFace & a_BlockFace) const { class cCallbacks : - public cBlockTracer::cCallbacks + public BlockTracerCallbacks { public: Vector3i m_Pos; @@ -262,14 +261,13 @@ public: } } Callbacks; - cLineBlockTracer Tracer(*a_World, Callbacks); Vector3d Start(a_Player->GetEyePosition()); Vector3d End(a_Player->GetEyePosition() + a_Player->GetLookVector() * 5); - // cLineBlockTracer::Trace() returns true when whole line was traversed. By returning true from the callback when we hit something, + // LineBlockTracer::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, End)) + if (!LineBlockTracer::Trace(*a_World, Callbacks, Start, End)) { a_BlockPos = Callbacks.m_Pos; a_BlockType = Callbacks.m_ReplacedBlockType; |