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/BlockInfo.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/BlockInfo.h') diff --git a/src/BlockInfo.h b/src/BlockInfo.h index fe5421690..a15868abe 100644 --- a/src/BlockInfo.h +++ b/src/BlockInfo.h @@ -24,6 +24,10 @@ public: /** Does this block fully occupy its voxel - is it a 'full' block? */ static bool FullyOccupiesVoxel(BLOCKTYPE Block); + /** Does the client pretend the block doesn't exist when clicking? + For example, digging a fire will hit the block below the fire, so fire is "clicked through". */ + static bool IsClickedThrough(BLOCKTYPE a_Block); + /** Is a block destroyed after a single hit? Warning: IsOneHitDig does not take into account enchantments / status effects / swim state / floating state and therefore may be incorrect. Only use to check if hardness is 0. -- cgit v1.2.3