mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-19 17:40:38 +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\item\Item;
|
||||
use pocketmine\math\AxisAlignedBB;
|
||||
use pocketmine\math\Facing;
|
||||
use pocketmine\math\Vector3;
|
||||
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{
|
||||
if(!$blockClicked->isTransparent()){
|
||||
$faces = [
|
||||
2 => 2,
|
||||
3 => 3,
|
||||
4 => 4,
|
||||
5 => 5
|
||||
];
|
||||
if(isset($faces[$face])){
|
||||
$this->meta = $faces[$face];
|
||||
$this->getLevel()->setBlock($blockReplace, $this, true, true);
|
||||
if(!$blockClicked->isTransparent() and Facing::axis($face) !== Facing::AXIS_Y){
|
||||
$this->meta = $face;
|
||||
$this->getLevel()->setBlock($blockReplace, $this, true, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user