From d92509a6e755271f629dffc79ee35636df7f6a27 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Fri, 14 May 2021 10:42:08 +0100 Subject: Re-implement up/down placement metadata (#5219) + Use player position when placing blocks which can face up or down, seems to better correspond to Vanilla behaviour. * Fixes #4651 --- src/Items/ItemPiston.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Items/ItemPiston.h') diff --git a/src/Items/ItemPiston.h b/src/Items/ItemPiston.h index 659300924..097c26d78 100644 --- a/src/Items/ItemPiston.h +++ b/src/Items/ItemPiston.h @@ -21,6 +21,6 @@ private: virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, const eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) override { - return a_Player.PlaceBlock(a_PlacePosition, static_cast(a_HeldItem.m_ItemType), cBlockPistonHandler::PitchYawToMetaData(a_Player.GetYaw(), a_Player.GetPitch())); + return a_Player.PlaceBlock(a_PlacePosition, static_cast(a_HeldItem.m_ItemType), cBlockPistonHandler::DisplacementYawToMetaData(a_PlacePosition, a_Player.GetEyePosition(), a_Player.GetYaw())); } }; -- cgit v1.2.3