From 221cc4ec5cb6301743e947eaabed3fecedba796f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 16 Oct 2019 10:06:34 +0200 Subject: Refactored block-to-pickup conversion. (#4417) --- src/Items/ItemBucket.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/Items/ItemBucket.h') diff --git a/src/Items/ItemBucket.h b/src/Items/ItemBucket.h index f5acb25b3..36caf667b 100644 --- a/src/Items/ItemBucket.h +++ b/src/Items/ItemBucket.h @@ -114,6 +114,8 @@ public: + + bool PlaceFluid( cWorld * a_World, cPlayer * a_Player, cBlockPluginInterface & a_PluginInterface, const cItem & a_Item, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, BLOCKTYPE a_FluidBlock @@ -164,13 +166,7 @@ public: // Plugin disagrees with the washing-away return false; } - - cBlockHandler * Handler = BlockHandler(CurrentBlockType); - if (Handler->DoesDropOnUnsuitable()) - { - cChunkInterface ChunkInterface(a_World->GetChunkMap()); - Handler->DropBlock(ChunkInterface, *a_World, a_PluginInterface, a_Player, BlockPos.x, BlockPos.y, BlockPos.z); - } + a_World->DropBlockAsPickups(BlockPos, a_Player, nullptr); a_PluginInterface.CallHookPlayerBrokenBlock(*a_Player, BlockPos.x, BlockPos.y, BlockPos.z, EntryFace, CurrentBlockType, CurrentBlockMeta); } @@ -180,6 +176,8 @@ public: + + bool GetBlockFromTrace(cWorld * a_World, cPlayer * a_Player, Vector3i & a_BlockPos) { class cCallbacks : -- cgit v1.2.3