From a62b2b1be2103d7de2fd66c7304b7473e369be3c Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 5 May 2021 14:25:10 +0100 Subject: Move item placement into item handlers (#5184) * Move item placement into item handlers + Add appropriate CanBeAt checks in cPlayer::PlaceBlocks, into which all placement handlers call. * Partly addresses #5157 * Fixes #4878 * Fixes #2919 * Fixes #4629 * Fixes #4239 * Fixes #4849 Co-authored-by: changyong guo Co-authored-by: Xotheus Co-authored-by: Krist Pregracke * Review fixes * Update APIDesc.lua * Rename Co-authored-by: changyong guo Co-authored-by: Xotheus Co-authored-by: Krist Pregracke --- src/Items/ItemBucket.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Items/ItemBucket.h') diff --git a/src/Items/ItemBucket.h b/src/Items/ItemBucket.h index a5b1085ba..6d7a33ccf 100644 --- a/src/Items/ItemBucket.h +++ b/src/Items/ItemBucket.h @@ -105,8 +105,8 @@ public: return false; } - // Remove water / lava block (unless plugins disagree) - if (!a_Player->PlaceBlock(BlockPos.x, BlockPos.y, BlockPos.z, E_BLOCK_AIR, 0)) + // Remove water / lava block (unless plugins disagree): + if (!a_Player->PlaceBlock(BlockPos, E_BLOCK_AIR, 0)) { return false; } @@ -175,7 +175,7 @@ public: } // Place the actual fluid block: - return a_Player->PlaceBlock(BlockPos.x, BlockPos.y, BlockPos.z, a_FluidBlock, 0); + return a_Player->PlaceBlock(BlockPos, a_FluidBlock, 0); } -- cgit v1.2.3