Updated blocks direct break

This commit is contained in:
Shoghi Cervantes 2013-09-04 12:59:08 +02:00
parent cf8e3e41ba
commit 19112f0d06
33 changed files with 97 additions and 92 deletions

View file

@ -33,12 +33,12 @@ class BurningFurnaceBlock extends SolidBlock{
3 => 3,
);
$this->meta = $faces[$player->entity->getDirection()];
$this->level->setBlock($block, $this);
$this->level->setBlock($block, $this, true, false, true);
return true;
}
public function onBreak(Item $item, Player $player){
$this->level->setBlock($this, new AirBlock(), true, true);
$this->level->setBlock($this, new AirBlock(), true, true, true);
return true;
}

View file

@ -51,7 +51,7 @@ class ChestBlock extends TransparentBlock{
}
}
$this->level->setBlock($block, $this);
$this->level->setBlock($block, $this, true, false, true);
$tile = $server->api->tile->add($this->level, TILE_CHEST, $this->x, $this->y, $this->z, array(
"Items" => array(),
"id" => TILE_CHEST,
@ -72,7 +72,7 @@ class ChestBlock extends TransparentBlock{
if($t !== false){
$t->unpair();
}
$this->level->setBlock($this, new AirBlock(), true, true);
$this->level->setBlock($this, new AirBlock(), true, true, true);
return true;
}

View file

@ -30,7 +30,7 @@ class DirtBlock extends SolidBlock{
if(($player->gamemode & 0x01) === 0){
$item->useOn($this);
}
$this->level->setBlock($this, BlockAPI::get(FARMLAND, 0));
$this->level->setBlock($this, BlockAPI::get(FARMLAND, 0), true, false, true);
return true;
}
return false;

View file

@ -103,7 +103,7 @@ class LeavesBlock extends TransparentBlock{
if($type === BLOCK_UPDATE_NORMAL){
if(($this->meta & 0b00001100) === 0){
$this->meta |= 0x08;
$this->level->setBlock($this, $this, false);
$this->level->setBlock($this, $this, false, false, true);
return BLOCK_UPDATE_RANDOM;
}
}elseif($type === BLOCK_UPDATE_RANDOM){
@ -112,9 +112,9 @@ class LeavesBlock extends TransparentBlock{
$visited = array();
$check = 0;
if($this->findLog($this, $visited, 0, $check) === true){
$this->level->setBlock($this, $this, false);
$this->level->setBlock($this, $this, false, false, true);
}else{
$this->level->setBlock($this, new AirBlock(), false);
$this->level->setBlock($this, new AirBlock(), false, false, true);
if(mt_rand(1,20) === 1){ //Saplings
ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(SAPLING, $this->meta & 0x03, 1));
}
@ -130,7 +130,7 @@ class LeavesBlock extends TransparentBlock{
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$this->meta |= 0x04;
$this->level->setBlock($this, $this);
$this->level->setBlock($this, $this, true, false, true);
}
public function getDrops(Item $item, Player $player){