From 2f3fcef97c4596765873c21bb4e7d2f5c3c47f79 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 12 Jan 2023 19:36:23 +0000 Subject: [PATCH] Fixed blocks incorrectly using blockClicked for support checks this caused some interesting bugs, such as being able to place floating pressure plates by clicking on the side of a solid block halfway up a wall. --- src/block/ItemFrame.php | 2 +- src/block/PressurePlate.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/block/ItemFrame.php b/src/block/ItemFrame.php index 8df62c72f..7a224c47b 100644 --- a/src/block/ItemFrame.php +++ b/src/block/ItemFrame.php @@ -175,7 +175,7 @@ class ItemFrame extends Flowable{ } public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ - if($face === Facing::DOWN || $face === Facing::UP || !$blockClicked->isSolid()){ + if($face === Facing::DOWN || $face === Facing::UP || !$blockReplace->getSide(Facing::opposite($face))->isSolid()){ return false; } diff --git a/src/block/PressurePlate.php b/src/block/PressurePlate.php index 5610b4e1a..5ad0e7873 100644 --- a/src/block/PressurePlate.php +++ b/src/block/PressurePlate.php @@ -45,7 +45,7 @@ abstract class PressurePlate extends Transparent{ } public function place(BlockTransaction $tx, Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{ - if($this->canBeSupportedBy($blockClicked)){ + if($this->canBeSupportedBy($blockReplace->getSide(Facing::DOWN))){ return parent::place($tx, $item, $blockReplace, $blockClicked, $face, $clickVector, $player); } return false;