diff --git a/src/pocketmine/block/Ladder.php b/src/pocketmine/block/Ladder.php index 58975a4fb..03fe07523 100644 --- a/src/pocketmine/block/Ladder.php +++ b/src/pocketmine/block/Ladder.php @@ -112,13 +112,7 @@ class Ladder extends Transparent{ public function onUpdate(int $type){ if($type === Level::BLOCK_UPDATE_NORMAL){ - $sides = [ - 2 => 3, - 3 => 2, - 4 => 5, - 5 => 4 - ]; - if(!$this->getSide($sides[$this->meta])->isSolid()){ //Replace with common break method + if(!$this->getSide($this->meta ^ 0x01)->isSolid()){ //Replace with common break method $this->level->useBreakOn($this); return Level::BLOCK_UPDATE_NORMAL; } diff --git a/src/pocketmine/block/WallSign.php b/src/pocketmine/block/WallSign.php index 62ce2507f..28037d2f7 100644 --- a/src/pocketmine/block/WallSign.php +++ b/src/pocketmine/block/WallSign.php @@ -34,19 +34,11 @@ class WallSign extends SignPost{ } public function onUpdate(int $type){ - $faces = [ - 2 => 3, - 3 => 2, - 4 => 5, - 5 => 4 - ]; if($type === Level::BLOCK_UPDATE_NORMAL){ - if(isset($faces[$this->meta])){ - if($this->getSide($faces[$this->meta])->getId() === self::AIR){ - $this->getLevel()->useBreakOn($this); - } - return Level::BLOCK_UPDATE_NORMAL; + if($this->getSide($this->meta ^ 0x01)->getId() === self::AIR){ + $this->getLevel()->useBreakOn($this); } + return Level::BLOCK_UPDATE_NORMAL; } return false; }