mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
first shot making Block not extend Position
this makes some stuff a lot less pretty, but this seems to be the bare minimum necessary to do this task. It can be enhanced later.
This commit is contained in:
@ -95,7 +95,7 @@ class Banner extends Transparent{
|
||||
|
||||
public function readStateFromWorld() : void{
|
||||
parent::readStateFromWorld();
|
||||
$tile = $this->world->getTile($this);
|
||||
$tile = $this->pos->getWorld()->getTile($this->pos);
|
||||
if($tile instanceof TileBanner){
|
||||
$this->baseColor = $tile->getBaseColor();
|
||||
$this->setPatterns($tile->getPatterns());
|
||||
@ -104,7 +104,7 @@ class Banner extends Transparent{
|
||||
|
||||
public function writeStateToWorld() : void{
|
||||
parent::writeStateToWorld();
|
||||
$tile = $this->world->getTile($this);
|
||||
$tile = $this->pos->getWorld()->getTile($this->pos);
|
||||
assert($tile instanceof TileBanner);
|
||||
$tile->setBaseColor($this->baseColor);
|
||||
$tile->setPatterns($this->patterns);
|
||||
@ -163,7 +163,7 @@ class Banner extends Transparent{
|
||||
|
||||
public function onNearbyBlockChange() : void{
|
||||
if($this->getSide(Facing::opposite($this->facing))->getId() === BlockLegacyIds::AIR){
|
||||
$this->getWorld()->useBreakOn($this);
|
||||
$this->pos->getWorld()->useBreakOn($this->pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user