mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 02:38:54 +00:00
Block update on WallSign fix
This commit is contained in:
parent
94b79ac28a
commit
f9d7e204c8
@ -88,7 +88,7 @@ class SignPost extends Transparent{
|
||||
}
|
||||
|
||||
public function onBreak(Item $item){
|
||||
$this->getLevel()->setBlock($this, new Air(), true, true, true);
|
||||
$this->getLevel()->setBlock($this, new Air(), true, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -22,6 +22,8 @@
|
||||
namespace pocketmine\block;
|
||||
|
||||
|
||||
use pocketmine\level\Level;
|
||||
|
||||
class WallSign extends SignPost{
|
||||
|
||||
protected $id = self::WALL_SIGN;
|
||||
@ -31,6 +33,20 @@ class WallSign extends SignPost{
|
||||
}
|
||||
|
||||
public function onUpdate($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;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user