Added new Block properties (Block::isSolid, Block::isFullBlock)

This commit is contained in:
Shoghi Cervantes 2013-05-30 12:47:24 +02:00
parent 8d00ef381d
commit a795b64bab
36 changed files with 57 additions and 32 deletions

View file

@ -25,7 +25,6 @@ the Free Software Foundation, either version 3 of the License, or
*/
class BurningFurnaceBlock extends SolidBlock{
public function __construct($meta = 0){
parent::__construct(BURNING_FURNACE, $meta, "Burning Furnace");

View file

@ -28,6 +28,7 @@ the Free Software Foundation, either version 3 of the License, or
class CakeBlock extends TransparentBlock{
public function __construct(){
parent::__construct(CAKE_BLOCK, 0, "Cake Block");
$this->isFullBlock = false;
}
}

View file

@ -25,9 +25,11 @@ the Free Software Foundation, either version 3 of the License, or
*/
class CobwebBlock extends TransparentBlock{
class CobwebBlock extends FlowableBlock{
public function __construct(){
parent::__construct(COBWEB, 0, "Cobweb");
parent::__construct(COBWEB, 0, "Cobweb");
$this->isSolid = true;
$this->isFullBlock = false;
}
public function getDrops(Item $item, Player $player){
return array();

View file

@ -28,6 +28,7 @@ the Free Software Foundation, either version 3 of the License, or
class FenceBlock extends TransparentBlock{
public function __construct(){
parent::__construct(FENCE, 0, "Fence");
$this->isFullBlock = false;
}
}

View file

@ -29,6 +29,7 @@ class FenceGateBlock extends TransparentBlock{
public function __construct($meta = 0){
parent::__construct(FENCE_GATE, $meta, "Fence Gate");
$this->isActivable = true;
$this->isFullBlock = false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
$faces = array(

View file

@ -28,6 +28,7 @@ the Free Software Foundation, either version 3 of the License, or
class GlassPaneBlock extends TransparentBlock{
public function __construct(){
parent::__construct(GLASS_PANE, 0, "Glass Pane");
$this->isFullBlock = false;
}
}

View file

@ -38,7 +38,8 @@ class SlabBlock extends TransparentBlock{
6 => "Nether Brick",
7 => "Quartz",
);
$this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Slab";
$this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Slab";
$this->isFullBlock = false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){

View file

@ -29,6 +29,7 @@ class SnowLayerBlock extends FlowableBlock{
public function __construct($meta = 0){
parent::__construct(SNOW_LAYER, $meta, "Snow Layer");
$this->isReplaceable = true;
$this->isSolid = false;
}
}