mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Block::readStateFromWorld() now returns the block object that should be used for the target position
this enables changing the block type completely if the situation calls for it.
This commit is contained in:
@ -58,7 +58,7 @@ class Door extends Transparent{
|
||||
$w->writeBool($this->open);
|
||||
}
|
||||
|
||||
public function readStateFromWorld() : void{
|
||||
public function readStateFromWorld() : Block{
|
||||
parent::readStateFromWorld();
|
||||
|
||||
//copy door properties from other half
|
||||
@ -71,6 +71,8 @@ class Door extends Transparent{
|
||||
$this->hingeRight = $other->hingeRight;
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isTop() : bool{ return $this->top; }
|
||||
|
Reference in New Issue
Block a user