Updated Position to use Weak / strong references for Level objects

This commit is contained in:
Shoghi Cervantes
2014-05-22 04:14:06 +02:00
parent 6328834681
commit c1546aac9c
60 changed files with 584 additions and 291 deletions

View File

@ -55,7 +55,7 @@ class Carpet extends Flowable{
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);
if($down->getID() !== self::AIR){
$this->level->setBlock($block, $this, true, false, true);
$this->getLevel()->setBlock($block, $this, true, false, true);
return true;
}
@ -68,7 +68,7 @@ class Carpet extends Flowable{
if($this->getSide(0)->getID() === self::AIR){ //Replace with common break method
//TODO
//Server::getInstance()->api->entity->drop($this, Item::get($this->id, $this->meta, 1));
$this->level->setBlock($this, new Air(), true, false, true);
$this->getLevel()->setBlock($this, new Air(), true, false, true);
return Level::BLOCK_UPDATE_NORMAL;
}