mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 17:59:48 +00:00
Position: rename getWorldNonNull() to getWorld(), remove original getWorld()
This commit is contained in:
@ -73,7 +73,7 @@ class Bed extends Transparent{
|
||||
public function readStateFromWorld() : void{
|
||||
parent::readStateFromWorld();
|
||||
//read extra state information from the tile - this is an ugly hack
|
||||
$tile = $this->pos->getWorldNonNull()->getTile($this->pos);
|
||||
$tile = $this->pos->getWorld()->getTile($this->pos);
|
||||
if($tile instanceof TileBed){
|
||||
$this->color = $tile->getColor();
|
||||
}
|
||||
@ -82,7 +82,7 @@ class Bed extends Transparent{
|
||||
public function writeStateToWorld() : void{
|
||||
parent::writeStateToWorld();
|
||||
//extra block properties storage hack
|
||||
$tile = $this->pos->getWorldNonNull()->getTile($this->pos);
|
||||
$tile = $this->pos->getWorld()->getTile($this->pos);
|
||||
if($tile instanceof TileBed){
|
||||
$tile->setColor($this->color);
|
||||
}
|
||||
@ -105,11 +105,11 @@ class Bed extends Transparent{
|
||||
|
||||
public function setOccupied(bool $occupied = true) : void{
|
||||
$this->occupied = $occupied;
|
||||
$this->pos->getWorldNonNull()->setBlock($this->pos, $this, false);
|
||||
$this->pos->getWorld()->setBlock($this->pos, $this, false);
|
||||
|
||||
if(($other = $this->getOtherHalf()) !== null){
|
||||
$other->occupied = $occupied;
|
||||
$this->pos->getWorldNonNull()->setBlock($other->pos, $other, false);
|
||||
$this->pos->getWorld()->setBlock($other->pos, $other, false);
|
||||
}
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ class Bed extends Transparent{
|
||||
return true;
|
||||
}
|
||||
|
||||
$time = $this->pos->getWorldNonNull()->getTimeOfDay();
|
||||
$time = $this->pos->getWorld()->getTimeOfDay();
|
||||
|
||||
$isNight = ($time >= World::TIME_NIGHT and $time < World::TIME_SUNRISE);
|
||||
|
||||
|
Reference in New Issue
Block a user