mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Updated Position to use Weak / strong references for Level objects
This commit is contained in:
@ -50,11 +50,11 @@ class Slab extends Transparent{
|
||||
$this->meta &= 0x07;
|
||||
if($face === 0){
|
||||
if($target->getID() === self::SLAB and ($target->getMetadata() & 0x08) === 0x08 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->level->setBlock($target, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
$this->getLevel()->setBlock($target, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
|
||||
return true;
|
||||
}elseif($block->getID() === self::SLAB and ($block->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->level->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
|
||||
return true;
|
||||
}else{
|
||||
@ -62,18 +62,18 @@ class Slab extends Transparent{
|
||||
}
|
||||
}elseif($face === 1){
|
||||
if($target->getID() === self::SLAB and ($target->getMetadata() & 0x08) === 0 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->level->setBlock($target, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
$this->getLevel()->setBlock($target, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
|
||||
return true;
|
||||
}elseif($block->getID() === self::SLAB and ($block->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->level->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
}elseif(!($player instanceof Player) or !$player->inBlock($block)){
|
||||
if($block->getID() === self::SLAB){
|
||||
if(($block->getMetadata() & 0x07) === ($this->meta & 0x07)){
|
||||
$this->level->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
$this->getLevel()->setBlock($block, Block::get(Item::DOUBLE_SLAB, $this->meta), true, false, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -90,7 +90,7 @@ class Slab extends Transparent{
|
||||
if($block->getID() === self::SLAB and ($target->getMetadata() & 0x07) !== ($this->meta & 0x07)){
|
||||
return false;
|
||||
}
|
||||
$this->level->setBlock($block, $this, true, false, true);
|
||||
$this->getLevel()->setBlock($block, $this, true, false, true);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user