Block creating and property handling rewrite, part1

This commit is contained in:
Shoghi Cervantes
2014-12-07 01:53:27 +01:00
parent 79236c971c
commit a0d4bff385
138 changed files with 1912 additions and 835 deletions

View File

@ -27,32 +27,39 @@ use pocketmine\math\AxisAlignedBB;
use pocketmine\Player;
class Carpet extends Flowable{
protected $id = self::CARPET;
public function __construct($meta = 0){
parent::__construct(self::CARPET, $meta, "Carpet");
$names = [
0 => "White Carpet",
1 => "Orange Carpet",
2 => "Magenta Carpet",
3 => "Light Blue Carpet",
4 => "Yellow Carpet",
5 => "Lime Carpet",
6 => "Pink Carpet",
7 => "Gray Carpet",
8 => "Light Gray Carpet",
9 => "Cyan Carpet",
10 => "Purple Carpet",
11 => "Blue Carpet",
12 => "Brown Carpet",
13 => "Green Carpet",
14 => "Red Carpet",
15 => "Black Carpet",
];
$this->name = $names[$this->meta];
$this->hardness = 0;
$this->isFullBlock = false;
$this->isSolid = true;
$this->meta = $meta;
}
public function isSolid(){
return true;
}
public function getName(){
static $names = [
0 => "White Carpet",
1 => "Orange Carpet",
2 => "Magenta Carpet",
3 => "Light Blue Carpet",
4 => "Yellow Carpet",
5 => "Lime Carpet",
6 => "Pink Carpet",
7 => "Gray Carpet",
8 => "Light Gray Carpet",
9 => "Cyan Carpet",
10 => "Purple Carpet",
11 => "Blue Carpet",
12 => "Brown Carpet",
13 => "Green Carpet",
14 => "Red Carpet",
15 => "Black Carpet",
];
return $names[$this->meta];
}
protected function recalculateBoundingBox(){
return new AxisAlignedBB(