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:
Dylan K. Taylor
2022-07-16 00:37:32 +01:00
parent b3f8b5ff37
commit 4f2f9b4352
19 changed files with 67 additions and 20 deletions

View File

@ -59,7 +59,7 @@ class Stair extends Transparent{
$w->writeBool($this->upsideDown);
}
public function readStateFromWorld() : void{
public function readStateFromWorld() : Block{
parent::readStateFromWorld();
$clockwise = Facing::rotateY($this->facing, true);
@ -70,6 +70,8 @@ class Stair extends Transparent{
}else{
$this->shape = StairShape::STRAIGHT();
}
return $this;
}
public function isUpsideDown() : bool{ return $this->upsideDown; }