Implemented light population, added Level->getFullLight()

This commit is contained in:
Shoghi Cervantes
2014-11-28 14:44:27 +01:00
parent d139e5f342
commit b3c3f896a3
12 changed files with 105 additions and 0 deletions

View File

@ -543,6 +543,7 @@ class Block extends Position implements Metadatable{
public $isPlaceable = true;
public $hasPhysics = false;
public $isFullBlock = true;
public $lightLevel = 0;
public $x = 0;
public $y = 0;
public $z = 0;

View File

@ -26,6 +26,9 @@ use pocketmine\level\Level;
use pocketmine\Player;
class BrownMushroom extends Flowable{
public $lightLevel = 1;
public function __construct(){
parent::__construct(self::BROWN_MUSHROOM, 0, "Brown Mushroom");
$this->hardness = 0;

View File

@ -32,6 +32,9 @@ use pocketmine\tile\Furnace;
use pocketmine\tile\Tile;
class BurningFurnace extends Solid{
public $lightLevel = 13;
public function __construct($meta = 0){
parent::__construct(self::BURNING_FURNACE, $meta, "Burning Furnace");
$this->isActivable = true;

View File

@ -24,6 +24,9 @@ namespace pocketmine\block;
use pocketmine\math\AxisAlignedBB;
class EndPortal extends Solid{
public $lightLevel = 1;
public function __construct($meta = 0){
parent::__construct(self::END_PORTAL, $meta, "End Portal");
$this->hardness = 18000000;

View File

@ -32,6 +32,7 @@ use pocketmine\Server;
class Fire extends Flowable{
public $hasEntityCollision = true;
public $lightLevel = 15;
public function __construct($meta = 0){
parent::__construct(self::FIRE, $meta, "Fire");

View File

@ -23,6 +23,9 @@ namespace pocketmine\block;
class GlowingObsidian extends Solid{
public $lightLevel = 12;
public function __construct($meta = 0){
parent::__construct(self::GLOWING_OBSIDIAN, $meta, "Glowing Obsidian");
}

View File

@ -25,6 +25,9 @@ use pocketmine\item\Item;
use pocketmine\level\Level;
class GlowingRedstoneOre extends Solid{
public $lightLevel = 9;
public function __construct(){
parent::__construct(self::GLOWING_REDSTONE_ORE, 0, "Glowing Redstone Ore");
$this->hardness = 15;

View File

@ -24,6 +24,9 @@ namespace pocketmine\block;
use pocketmine\item\Item;
class Glowstone extends Transparent{
public $lightLevel = 15;
public function __construct(){
parent::__construct(self::GLOWSTONE_BLOCK, 0, "Glowstone");
$this->hardness = 1.5;

View File

@ -31,6 +31,8 @@ use pocketmine\Server;
class Lava extends Liquid{
public $lightLevel = 15;
public function __construct($meta = 0){
parent::__construct(self::LAVA, $meta, "Lava");
$this->hardness = 0;

View File

@ -25,6 +25,9 @@ use pocketmine\item\Item;
use pocketmine\Player;
class LitPumpkin extends Solid{
public $lightLevel = 15;
public function __construct(){
parent::__construct(self::LIT_PUMPKIN, "Jack o'Lantern");
$this->hardness = 5;

View File

@ -26,6 +26,9 @@ use pocketmine\level\Level;
use pocketmine\Player;
class Torch extends Flowable{
public $lightLevel = 15;
public function __construct($meta = 0){
parent::__construct(self::TORCH, $meta, "Torch");
$this->hardness = 0;