Code cleanup

This commit is contained in:
Shoghi Cervantes
2014-08-21 17:26:41 +02:00
parent e1ef86074e
commit db7222976e
105 changed files with 932 additions and 896 deletions

View File

@ -24,7 +24,6 @@ namespace pocketmine\level\format\generic;
use pocketmine\entity\DroppedItem;
use pocketmine\entity\Entity;
use pocketmine\level\format\Chunk;
use pocketmine\level\format\FullChunk;
use pocketmine\level\format\ChunkSection;
use pocketmine\level\format\LevelProvider;
use pocketmine\nbt\tag\Compound;
@ -153,6 +152,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
}catch(\Exception $e){
$level = $this->getProvider();
$this->setInternalSection($Y = $y >> 4, $level::createChunkSection($Y));
return $this->setBlock($x, $y, $z, $blockId, $meta);
}
}
@ -218,6 +218,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$column .= $this->sections[$y]->getBlockIdColumn($x, $z);
}
return $column;
}
@ -226,6 +227,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$column .= $this->sections[$y]->getBlockDataColumn($x, $z);
}
return $column;
}
@ -234,6 +236,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$column .= $this->sections[$y]->getBlockSkyLightColumn($x, $z);
}
return $column;
}
@ -242,6 +245,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$column .= $this->sections[$y]->getBlockLightColumn($x, $z);
}
return $column;
}
@ -274,6 +278,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$blocks .= $this->sections[$y]->getIdArray();
}
return $blocks;
}
@ -282,6 +287,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$data .= $this->sections[$y]->getDataArray();
}
return $data;
}
@ -290,6 +296,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$skyLight .= $this->sections[$y]->getSkyLightArray();
}
return $skyLight;
}
@ -298,6 +305,7 @@ abstract class BaseChunk extends BaseFullChunk implements Chunk{
for($y = 0; $y < Chunk::SECTION_COUNT; ++$y){
$blockLight .= $this->sections[$y]->getLightArray();
}
return $blockLight;
}

View File

@ -62,17 +62,17 @@ abstract class BaseFullChunk implements FullChunk{
protected $z;
/**
* @param LevelProvider $provider
* @param int $x
* @param int $z
* @param string $blocks
* @param string $data
* @param string $skyLight
* @param string $blockLight
* @param string $biomeIds
* @param int[] $biomeColors
* @param Compound[] $entities
* @param Compound[] $tiles
* @param LevelProvider $provider
* @param int $x
* @param int $z
* @param string $blocks
* @param string $data
* @param string $skyLight
* @param string $blockLight
* @param string $biomeIds
* @param int[] $biomeColors
* @param Compound[] $entities
* @param Compound[] $tiles
*
* @throws \Exception
*/
@ -188,6 +188,7 @@ abstract class BaseFullChunk implements FullChunk{
public function getBiomeColor($x, $z){
$color = $this->biomeColors[($z << 4) + $x] & 0xFFFFFF;
return [$color >> 16, ($color >> 8) & 0xFF, $color & 0xFF];
}