mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +00:00
Refactor Block & Tile: getPos() to getPosition() (#4395)
this also changes the name of the class property 'pos' to 'position' as well as Block->getPosOffset() to Block->getPositionOffset()
This commit is contained in:
@ -141,7 +141,7 @@ abstract class Projectile extends Entity{
|
||||
$nbt->setDouble("damage", $this->damage);
|
||||
|
||||
if($this->blockHit !== null){
|
||||
$pos = $this->blockHit->getPos();
|
||||
$pos = $this->blockHit->getPosition();
|
||||
$nbt->setInt("tileX", $pos->x);
|
||||
$nbt->setInt("tileY", $pos->y);
|
||||
$nbt->setInt("tileZ", $pos->z);
|
||||
@ -159,7 +159,7 @@ abstract class Projectile extends Entity{
|
||||
}
|
||||
|
||||
public function onNearbyBlockChange() : void{
|
||||
if($this->blockHit !== null and $this->getWorld()->isInLoadedTerrain($this->blockHit->getPos()) and !$this->blockHit->isSameState($this->getWorld()->getBlock($this->blockHit->getPos()))){
|
||||
if($this->blockHit !== null and $this->getWorld()->isInLoadedTerrain($this->blockHit->getPosition()) and !$this->blockHit->isSameState($this->getWorld()->getBlock($this->blockHit->getPosition()))){
|
||||
$this->blockHit = null;
|
||||
}
|
||||
|
||||
|
@ -133,11 +133,11 @@ class SplashPotion extends Throwable{
|
||||
$blockIn = $event->getBlockHit()->getSide($event->getRayTraceResult()->getHitFace());
|
||||
|
||||
if($blockIn->getId() === BlockLegacyIds::FIRE){
|
||||
$this->getWorld()->setBlock($blockIn->getPos(), VanillaBlocks::AIR());
|
||||
$this->getWorld()->setBlock($blockIn->getPosition(), VanillaBlocks::AIR());
|
||||
}
|
||||
foreach($blockIn->getHorizontalSides() as $horizontalSide){
|
||||
if($horizontalSide->getId() === BlockLegacyIds::FIRE){
|
||||
$this->getWorld()->setBlock($horizontalSide->getPos(), VanillaBlocks::AIR());
|
||||
$this->getWorld()->setBlock($horizontalSide->getPosition(), VanillaBlocks::AIR());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user