From c9d6593fb0676d7b2e56528891897da3f72048be Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 3 Oct 2014 22:23:28 +0100 Subject: Lilypad placement calls block place hook * Fixes #1050 --- src/Items/ItemLilypad.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Items') diff --git a/src/Items/ItemLilypad.h b/src/Items/ItemLilypad.h index b9d837384..9ffecd133 100644 --- a/src/Items/ItemLilypad.h +++ b/src/Items/ItemLilypad.h @@ -91,6 +91,14 @@ public: if (Callbacks.m_HasHitFluid) { + if (cRoot::Get()->GetPluginManager()->CallHookPlayerPlacingBlock(*a_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, 0, 0, 0, E_BLOCK_LILY_PAD, 0)) + { + // A plugin doesn't agree with placing the block, revert the block on the client: + a_World->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player); + a_Player->GetInventory().SendEquippedSlot(); + return; + } + a_World->SetBlock(Callbacks.m_Pos.x, Callbacks.m_Pos.y, Callbacks.m_Pos.z, E_BLOCK_LILY_PAD, 0); if (!a_Player->IsGameModeCreative()) { -- cgit v1.2.3