mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Corrected block metadata
This commit is contained in:
@ -58,7 +58,7 @@ abstract class Block{
|
||||
}
|
||||
|
||||
final public function getMetadata(){
|
||||
return $meta & 0x0F;
|
||||
return $this->meta & 0x0F;
|
||||
}
|
||||
|
||||
final public function position(Vector3 $v){
|
||||
|
@ -31,8 +31,8 @@ class SaplingBlock extends TransparentBlock{
|
||||
const BIRCH = 2;
|
||||
const BURN_TIME = 5;
|
||||
|
||||
public function __construct($type = Sapling::OAK){
|
||||
parent::__construct(SAPLING, $type, "Sapling");
|
||||
public function __construct($meta = Sapling::OAK){
|
||||
parent::__construct(SAPLING, $meta, "Sapling");
|
||||
$this->isActivable = true;
|
||||
$this->isFlowable = true;
|
||||
$names = array(
|
||||
@ -40,7 +40,7 @@ class SaplingBlock extends TransparentBlock{
|
||||
1 => "Spruce Sapling",
|
||||
2 => "Birch Sapling",
|
||||
);
|
||||
$this->name = $names[$this->type & 0x03];
|
||||
$this->name = $names[$this->meta & 0x03];
|
||||
}
|
||||
|
||||
public function onActivate(LevelAPI $level, Item $item, Player $player){
|
||||
|
@ -26,8 +26,8 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
*/
|
||||
|
||||
class TallGrassBlock extends FlowableBlock{
|
||||
public function __construct($type = 1){
|
||||
parent::__construct(TALL_GRASS, $type, "Tall Grass");
|
||||
public function __construct($meta = 1){
|
||||
parent::__construct(TALL_GRASS, $meta, "Tall Grass");
|
||||
$this->isFlowable = true;
|
||||
$this->isReplaceable = true;
|
||||
$names = array(
|
||||
@ -35,7 +35,7 @@ class TallGrassBlock extends FlowableBlock{
|
||||
1 => "Tall Grass",
|
||||
2 => "Fern",
|
||||
);
|
||||
$this->name = $names[$this->type & 0x03];
|
||||
$this->name = $names[$this->meta & 0x03];
|
||||
}
|
||||
|
||||
}
|
@ -26,14 +26,14 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
*/
|
||||
|
||||
class LeavesBlock extends TransparentBlock{
|
||||
public function __construct($type = 0){
|
||||
parent::__construct(LEAVES, $type, "Leaves");
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(LEAVES, $meta, "Leaves");
|
||||
$names = array(
|
||||
0 => "Oak Leaves",
|
||||
1 => "Spruce Leaves",
|
||||
2 => "Birch Leaves",
|
||||
);
|
||||
$this->name = $names[$this->type & 0x03];
|
||||
$this->name = $names[$this->meta & 0x03];
|
||||
}
|
||||
|
||||
}
|
@ -26,8 +26,8 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
*/
|
||||
|
||||
class PlanksBlock extends SolidBlock{
|
||||
public function __construct($type = 0){
|
||||
parent::__construct(PLANKS, $type, "Wooden Planks");
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(PLANKS, $meta, "Wooden Planks");
|
||||
}
|
||||
|
||||
}
|
@ -26,14 +26,14 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
*/
|
||||
|
||||
class SandstoneBlock extends SolidBlock{
|
||||
public function __construct($type = 0){
|
||||
parent::__construct(SANDSTONE, $type, "Sandstone");
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(SANDSTONE, $meta, "Sandstone");
|
||||
$names = array(
|
||||
0 => "Sandstone",
|
||||
1 => "Chiseled Sandstone",
|
||||
2 => "Smooth Sandstone",
|
||||
);
|
||||
$this->name = $names[$this->type & 0x03];
|
||||
$this->name = $names[$this->meta & 0x03];
|
||||
}
|
||||
|
||||
}
|
@ -29,14 +29,14 @@ class WoodBlock extends SolidBlock{
|
||||
const OAK = 0;
|
||||
const SPRUCE = 1;
|
||||
const BIRCH = 2;
|
||||
public function __construct($type = 0){
|
||||
parent::__construct(WOOD, $type, "Wood");
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(WOOD, $meta, "Wood");
|
||||
$names = array(
|
||||
0 => "Oak Wood",
|
||||
1 => "Spruce Wood",
|
||||
2 => "Birch Wood",
|
||||
);
|
||||
$this->name = $names[$this->type & 0x03];
|
||||
$this->name = $names[$this->meta & 0x03];
|
||||
}
|
||||
|
||||
}
|
@ -26,8 +26,8 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
*/
|
||||
|
||||
class WoolBlock extends SolidBlock{
|
||||
public function __construct($type = 0){
|
||||
parent::__construct(WOOL, $type, "Wool");
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(WOOL, $meta, "Wool");
|
||||
$names = array(
|
||||
0 => "White Wool",
|
||||
1 => "Orange Wool",
|
||||
@ -46,7 +46,7 @@ class WoolBlock extends SolidBlock{
|
||||
14 => "Red Wool",
|
||||
15 => "Black Wool",
|
||||
);
|
||||
$this->name = $names[$this->type];
|
||||
$this->name = $names[$this->meta];
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user