mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +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:
@ -36,7 +36,7 @@ class FlowerPot extends Flowable{
|
||||
|
||||
protected ?Block $plant = null;
|
||||
|
||||
public function readStateFromWorld() : void{
|
||||
public function readStateFromWorld() : Block{
|
||||
parent::readStateFromWorld();
|
||||
$tile = $this->position->getWorld()->getTile($this->position);
|
||||
if($tile instanceof TileFlowerPot){
|
||||
@ -44,6 +44,8 @@ class FlowerPot extends Flowable{
|
||||
}else{
|
||||
$this->setPlant(null);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function writeStateToWorld() : void{
|
||||
|
Reference in New Issue
Block a user