mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-08 04:38:35 +00:00
Painting: clean up guard checks, remove unnecessary checks
This commit is contained in:
parent
93c26a0b0c
commit
60dddcd12a
@ -37,8 +37,10 @@ class PaintingItem extends Item{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : bool{
|
public function onActivate(Player $player, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector) : bool{
|
||||||
if(!$blockClicked->isTransparent() and $face > 1 and !$blockReplace->isSolid()){
|
if($face === Vector3::SIDE_DOWN or $face === Vector3::SIDE_UP){
|
||||||
/** @var PaintingMotive[] $motives */
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
$motives = [];
|
$motives = [];
|
||||||
|
|
||||||
$totalDimension = 0;
|
$totalDimension = 0;
|
||||||
@ -98,7 +100,6 @@ class PaintingItem extends Item{
|
|||||||
$player->getLevel()->broadcastLevelEvent($blockReplace->add(0.5, 0.5, 0.5), LevelEventPacket::EVENT_SOUND_ITEMFRAME_PLACE); //item frame and painting have the same sound
|
$player->getLevel()->broadcastLevelEvent($blockReplace->add(0.5, 0.5, 0.5), LevelEventPacket::EVENT_SOUND_ITEMFRAME_PLACE); //item frame and painting have the same sound
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user