mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-20 10:00:31 +00:00
Remove ridiculous code in Ladder
This commit is contained in:
parent
778eb5fb33
commit
54342ab0ce
@ -26,6 +26,7 @@ namespace pocketmine\block;
|
|||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
|
use pocketmine\math\Facing;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
@ -90,19 +91,11 @@ class Ladder extends Transparent{
|
|||||||
|
|
||||||
|
|
||||||
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
|
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{
|
||||||
if(!$blockClicked->isTransparent()){
|
if(!$blockClicked->isTransparent() and Facing::axis($face) !== Facing::AXIS_Y){
|
||||||
$faces = [
|
$this->meta = $face;
|
||||||
2 => 2,
|
$this->getLevel()->setBlock($blockReplace, $this, true, true);
|
||||||
3 => 3,
|
|
||||||
4 => 4,
|
|
||||||
5 => 5
|
|
||||||
];
|
|
||||||
if(isset($faces[$face])){
|
|
||||||
$this->meta = $faces[$face];
|
|
||||||
$this->getLevel()->setBlock($blockReplace, $this, true, true);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user