Fix formatting issues due to bad IDE settings

This commit is contained in:
Shoghi Cervantes 2014-12-07 16:30:04 +01:00
parent bb82e7be50
commit 747f7685e7
191 changed files with 1315 additions and 1304 deletions

View File

@ -1752,19 +1752,19 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$nbt = new Compound("", [
"Pos" => new Enum("Pos", [
new Double("", $this->x),
new Double("", $this->y + $this->getEyeHeight()),
new Double("", $this->z)
]),
new Double("", $this->x),
new Double("", $this->y + $this->getEyeHeight()),
new Double("", $this->z)
]),
"Motion" => new Enum("Motion", [
new Double("", -sin($this->yaw / 180 * M_PI) * cos($this->pitch / 180 * M_PI)),
new Double("", -sin($this->pitch / 180 * M_PI)),
new Double("", cos($this->yaw / 180 * M_PI) * cos($this->pitch / 180 * M_PI))
]),
new Double("", -sin($this->yaw / 180 * M_PI) * cos($this->pitch / 180 * M_PI)),
new Double("", -sin($this->pitch / 180 * M_PI)),
new Double("", cos($this->yaw / 180 * M_PI) * cos($this->pitch / 180 * M_PI))
]),
"Rotation" => new Enum("Rotation", [
new Float("", $this->yaw),
new Float("", $this->pitch)
]),
new Float("", $this->yaw),
new Float("", $this->pitch)
]),
]);
$f = 1.5;
@ -1875,7 +1875,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
if($target instanceof Entity and $this->getGamemode() !== Player::VIEW and $this->dead !== true and $target->dead !== true){
if($target instanceof DroppedItem or $target instanceof Arrow){
$this->kick("Attempting to attack an invalid entity");
$this->server->getLogger()->warning("Player ". $this->getName() ." tried to attack an invalid entity");
$this->server->getLogger()->warning("Player " . $this->getName() . " tried to attack an invalid entity");
return;
}
@ -2536,7 +2536,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
case EntityDamageEvent::CAUSE_ENTITY_EXPLOSION:
$message = $this->getName() . " blew up";
break;
case EntityDamageEvent::CAUSE_MAGIC:
case EntityDamageEvent::CAUSE_CUSTOM:
@ -2621,7 +2621,7 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
$flags = 0;
$flags |= $this->fireTicks > 0 ? 1 : 0;
//$flags |= ($this->crouched === true ? 0b10:0) << 1;
$flags |= ($this->inAction === true ? 0b10000:0);
$flags |= ($this->inAction === true ? 0b10000 : 0);
$d = [
0 => ["type" => 0, "value" => $flags],
1 => ["type" => 1, "value" => $this->airTicks],

View File

@ -143,8 +143,8 @@ namespace pocketmine {
if($response = Utils::getURL("http://ip-api.com/json")
and $ip_geolocation_data = json_decode($response, true)
and $ip_geolocation_data['status'] != 'fail'
and date_default_timezone_set($ip_geolocation_data['timezone']))
{
and date_default_timezone_set($ip_geolocation_data['timezone'])
){
//Again, for redundancy.
ini_set("date.timezone", $ip_geolocation_data['timezone']);
}else{
@ -192,8 +192,7 @@ namespace pocketmine {
//Detect the Time Zone string
preg_match($regex, $string, $matches);
if(!isset($matches[2]))
{
if(!isset($matches[2])){
return false;
}
@ -251,6 +250,7 @@ namespace pocketmine {
/**
* @param string $offset In the format of +09:00, +02:00, -04:00 etc.
*
* @return string
*/
function parse_offset($offset){

View File

@ -149,8 +149,8 @@ class Server{
*/
private $tickCounter;
private $nextTick = 0;
private $tickAverage = [20,20,20,20,20];
private $useAverage = [20,20,20,20,20];
private $tickAverage = [20, 20, 20, 20, 20];
private $useAverage = [20, 20, 20, 20, 20];
/** @var \AttachableThreadedLogger */
private $logger;
@ -1444,7 +1444,7 @@ class Server{
}
/**
* @param \ClassLoader $autoloader
* @param \ClassLoader $autoloader
* @param \ThreadedLogger $logger
* @param string $filePath
* @param string $dataPath
@ -1672,7 +1672,7 @@ class Server{
}
/**
* @param $message
* @param $message
* @param Player[]|null $recipients
*
* @return int
@ -1898,7 +1898,7 @@ class Server{
foreach($this->interfaces as $interface){
$interface->shutdown();
}
}catch (\Exception $e){
}catch(\Exception $e){
$this->logger->emergency("Crashed while crashing, killing process");
@kill(getmypid());
}
@ -2083,8 +2083,8 @@ class Server{
foreach($this->getLevels() as $level){
try{
$level->doTick($currentTick);
}catch (\Exception $e){
$this->logger->critical("Could not tick level ".$level->getName().": ".$e->getMessage());
}catch(\Exception $e){
$this->logger->critical("Could not tick level " . $level->getName() . ": " . $e->getMessage());
if($this->logger instanceof MainLogger){
$this->logger->logException($e);
}
@ -2152,7 +2152,7 @@ class Server{
private function titleTick(){
if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0 and \pocketmine\ANSI === true){
echo "\x1b]0;". $this->getName() . " " . $this->getPocketMineVersion() . " | Online " . count($this->players) . "/" . $this->getMaxPlayers() . " | RAM " . round((memory_get_usage() / 1024) / 1024, 2) . "/" . round((memory_get_usage(true) / 1024) / 1024, 2) . " MB | U " . round($this->mainInterface->getUploadUsage() / 1024, 2) . " D " . round($this->mainInterface->getDownloadUsage() / 1024, 2) . " kB/s | TPS " . $this->getTicksPerSecond() . " | Load ". $this->getTickUsage() . "%\x07";
echo "\x1b]0;" . $this->getName() . " " . $this->getPocketMineVersion() . " | Online " . count($this->players) . "/" . $this->getMaxPlayers() . " | RAM " . round((memory_get_usage() / 1024) / 1024, 2) . "/" . round((memory_get_usage(true) / 1024) / 1024, 2) . " MB | U " . round($this->mainInterface->getUploadUsage() / 1024, 2) . " D " . round($this->mainInterface->getDownloadUsage() / 1024, 2) . " kB/s | TPS " . $this->getTicksPerSecond() . " | Load " . $this->getTickUsage() . "%\x07";
}
}
@ -2199,7 +2199,7 @@ class Server{
try{
$this->generationManager->process();
}catch (\Exception $e){
}catch(\Exception $e){
if($this->logger instanceof MainLogger){
$this->logger->logException($e);
}

View File

@ -20,6 +20,7 @@
*/
namespace pocketmine\block;
use pocketmine\item\Item;
@ -39,25 +40,25 @@ class Air extends Transparent{
return "Air";
}
public function isBreakable(Item $item){
return false;
}
public function isBreakable(Item $item){
return false;
}
public function canBeFlowedInto(){
return true;
}
public function canBeFlowedInto(){
return true;
}
public function canBeReplaced(){
return true;
}
public function canBeReplaced(){
return true;
}
public function canBePlaced(){
return false;
}
public function canBePlaced(){
return false;
}
public function isSolid(){
return false;
}
public function isSolid(){
return false;
}
public function getBoundingBox(){
return null;

View File

@ -29,23 +29,23 @@ use pocketmine\Player;
class Bed extends Transparent{
protected $id = self::BED_BLOCK;
protected $id = self::BED_BLOCK;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
public function getHardness(){
return 1;
}
public function getHardness(){
return 1;
}
public function getName(){
return "Bed Block";
}
public function getName(){
return "Bed Block";
}
protected function recalculateBoundingBox(){
return new AxisAlignedBB(

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Bedrock extends Solid{
protected $id = self::BEDROCK;
protected $id = self::BEDROCK;
public function __construct(){
}
public function getName(){
return "Bedrock";
}
public function getName(){
return "Bedrock";
}
public function getHardness(){
return 18000000;
}
public function getHardness(){
return 18000000;
}
public function isBreakable(Item $item){
return false;

View File

@ -25,15 +25,15 @@ use pocketmine\item\Item;
class Beetroot extends Crops{
protected $id = self::BEETROOT_BLOCK;
protected $id = self::BEETROOT_BLOCK;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Beetroot Block";
}
public function getName(){
return "Beetroot Block";
}
public function getDrops(Item $item){
$drops = [];

View File

@ -25,15 +25,15 @@ use pocketmine\item\Item;
class BirchWoodStairs extends Stair{
protected $id = self::BIRCH_WOOD_STAIRS;
protected $id = self::BIRCH_WOOD_STAIRS;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Birch Wood Stairs";
}
public function getName(){
return "Birch Wood Stairs";
}
public function getDrops(Item $item){
return [

View File

@ -782,8 +782,8 @@ class Block extends Position implements Metadatable{
}
/**
* @param int $id
* @param int $meta
* @param int $id
* @param int $meta
*/
public function __construct($id, $meta = 0){
$this->id = (int) $id;

View File

@ -24,18 +24,18 @@ namespace pocketmine\block;
class Bookshelf extends Solid{
protected $id = self::BOOKSHELF;
protected $id = self::BOOKSHELF;
public function __construct(){
}
public function getName(){
return "Bookshelf";
}
public function getName(){
return "Bookshelf";
}
public function getHardness(){
return 7.5;
}
public function getHardness(){
return 7.5;
}
}

View File

@ -24,14 +24,14 @@ namespace pocketmine\block;
class BrickStairs extends Stair{
protected $id = self::BRICK_STAIRS;
protected $id = self::BRICK_STAIRS;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Brick Stairs";
}
public function getName(){
return "Brick Stairs";
}
}

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Bricks extends Solid{
protected $id = self::BRICKS_BLOCK;
protected $id = self::BRICKS_BLOCK;
public function __construct(){
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getName(){
return "Bricks";
}
public function getName(){
return "Bricks";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -33,13 +33,13 @@ class BrownMushroom extends Flowable{
$this->meta = $meta;
}
public function getName(){
return "Brown Mushroom";
}
public function getName(){
return "Brown Mushroom";
}
public function getLightLevel(){
return 1;
}
public function getLightLevel(){
return 1;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){

View File

@ -36,24 +36,24 @@ class BurningFurnace extends Solid{
protected $id = self::BURNING_FURNACE;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Burning Furnace";
}
public function getName(){
return "Burning Furnace";
}
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
public function getHardness(){
return 17.5;
}
public function getHardness(){
return 17.5;
}
public function getLightLevel(){
return 13;
}
public function getLightLevel(){
return 13;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$faces = [

View File

@ -34,23 +34,23 @@ use pocketmine\Server;
class Cactus extends Transparent{
protected $id = self::CACTUS;
protected $id = self::CACTUS;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getHardness(){
return 2;
}
public function getHardness(){
return 2;
}
public function hasEntityCollision(){
return true;
}
public function hasEntityCollision(){
return true;
}
public function getName(){
return "Cactus";
}
public function getName(){
return "Cactus";
}
protected function recalculateBoundingBox(){

View File

@ -30,23 +30,23 @@ use pocketmine\Server;
class Cake extends Transparent{
protected $id = self::CAKE_BLOCK;
protected $id = self::CAKE_BLOCK;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
public function getHardness(){
return 2.5;
}
public function getHardness(){
return 2.5;
}
public function getName(){
return "Cake Block";
}
public function getName(){
return "Cake Block";
}
protected function recalculateBoundingBox(){

View File

@ -28,37 +28,37 @@ use pocketmine\Player;
class Carpet extends Flowable{
protected $id = self::CARPET;
protected $id = self::CARPET;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function isSolid(){
return true;
}
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 & 0x0f];
}
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 & 0x0f];
}
protected function recalculateBoundingBox(){

View File

@ -25,15 +25,15 @@ use pocketmine\item\Item;
class Carrot extends Crops{
protected $id = self::CARROT_BLOCK;
protected $id = self::CARROT_BLOCK;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Carrot Block";
}
public function getName(){
return "Carrot Block";
}
public function getDrops(Item $item){
$drops = [];

View File

@ -34,23 +34,23 @@ use pocketmine\tile\Tile;
class Chest extends Transparent{
protected $id = self::CHEST;
protected $id = self::CHEST;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getName(){
return "Chest";
}
public function getName(){
return "Chest";
}
protected function recalculateBoundingBox(){
return new AxisAlignedBB(

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Clay extends Solid{
protected $id = self::CLAY_BLOCK;
protected $id = self::CLAY_BLOCK;
public function __construct(){
}
public function getHardness(){
return 3;
}
public function getHardness(){
return 3;
}
public function getName(){
return "Clay Block";
}
public function getName(){
return "Clay Block";
}
public function getDrops(Item $item){
return [

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Coal extends Solid{
protected $id = self::COAL_BLOCK;
protected $id = self::COAL_BLOCK;
public function __construct(){
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getName(){
return "Coal Block";
}
public function getName(){
return "Coal Block";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class CoalOre extends Solid{
protected $id = self::COAL_ORE;
protected $id = self::COAL_ORE;
public function __construct(){
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getName(){
return "Coal Ore";
}
public function getName(){
return "Coal Ore";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Cobblestone extends Solid{
protected $id = self::COBBLESTONE;
protected $id = self::COBBLESTONE;
public function __construct(){
}
public function getName(){
return "Cobblestone";
}
public function getName(){
return "Cobblestone";
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -24,14 +24,14 @@ namespace pocketmine\block;
class CobblestoneStairs extends Stair{
protected $id = self::COBBLESTONE_STAIRS;
protected $id = self::COBBLESTONE_STAIRS;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Cobblestone Stairs";
}
public function getName(){
return "Cobblestone Stairs";
}
}

View File

@ -32,24 +32,24 @@ class Cobweb extends Flowable{
}
public function hasEntityCollision(){
return true;
}
public function hasEntityCollision(){
return true;
}
public function getName(){
return "Cobweb";
}
public function getName(){
return "Cobweb";
}
public function getHardness(){
return 25;
}
public function getHardness(){
return 25;
}
public function onEntityCollide(Entity $entity){
$entity->fallDistance = 0;
}
public function getDrops(Item $item){
//TODO: correct drops
//TODO: correct drops
return [];
}
}

View File

@ -29,9 +29,9 @@ use pocketmine\Server;
abstract class Crops extends Flowable{
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$down = $this->getSide(0);

View File

@ -27,15 +27,15 @@ use pocketmine\Player;
class Dandelion extends Flowable{
protected $id = self::DANDELION;
protected $id = self::DANDELION;
public function __construct(){
}
public function getName(){
return "Dandelion";
}
public function getName(){
return "Dandelion";
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){

View File

@ -25,15 +25,15 @@ use pocketmine\item\Item;
class DarkOakWoodStairs extends Stair{
protected $id = self::DARK_OAK_WOOD_STAIRS;
protected $id = self::DARK_OAK_WOOD_STAIRS;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Dark Oak Wood Stairs";
}
public function getName(){
return "Dark Oak Wood Stairs";
}
public function getDrops(Item $item){
return [

View File

@ -25,21 +25,21 @@ use pocketmine\level\Level;
class DeadBush extends Flowable{
protected $id = self::DEAD_BUSH;
protected $id = self::DEAD_BUSH;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
return "Dead Bush";
}
public function getName(){
return "Dead Bush";
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){
if($this->getSide(0)->isTransparent() === true){
$this->getLevel()->useBreakOn($this);
$this->getLevel()->useBreakOn($this);
return Level::BLOCK_UPDATE_NORMAL;
}

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Diamond extends Solid{
protected $id = self::DIAMOND_BLOCK;
protected $id = self::DIAMOND_BLOCK;
public function __construct(){
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getName(){
return "Diamond Block";
}
public function getName(){
return "Diamond Block";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class DiamondOre extends Solid{
protected $id = self::DIAMOND_ORE;
protected $id = self::DIAMOND_ORE;
public function __construct(){
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getName(){
return "Diamond Ore";
}
public function getName(){
return "Diamond Ore";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -32,17 +32,17 @@ class Dirt extends Solid{
}
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
public function getHardness(){
return 2.5;
}
public function getHardness(){
return 2.5;
}
public function getName(){
return "Dirt";
}
public function getName(){
return "Dirt";
}
public function onActivate(Item $item, Player $player = null){
if($item->isHoe()){

View File

@ -31,13 +31,13 @@ use pocketmine\Server;
abstract class Door extends Transparent{
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
public function isSolid(){
return false;
}
public function isSolid(){
return false;
}
private function getFullDamage(){
$damage = $this->getDamage();

View File

@ -25,29 +25,29 @@ use pocketmine\item\Item;
class DoubleSlab extends Solid{
protected $id = self::DOUBLE_SLAB;
protected $id = self::DOUBLE_SLAB;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getName(){
static $names = [
0 => "Stone",
1 => "Sandstone",
2 => "Wooden",
3 => "Cobblestone",
4 => "Brick",
5 => "Stone Brick",
6 => "Quartz",
7 => "",
];
return "Double " . $names[$this->meta & 0x07] . " Slab";
}
public function getName(){
static $names = [
0 => "Stone",
1 => "Sandstone",
2 => "Wooden",
3 => "Cobblestone",
4 => "Brick",
5 => "Stone Brick",
6 => "Quartz",
7 => "",
];
return "Double " . $names[$this->meta & 0x07] . " Slab";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -25,29 +25,29 @@ use pocketmine\item\Item;
class DoubleWoodSlab extends Solid{
protected $id = self::DOUBLE_WOOD_SLAB;
protected $id = self::DOUBLE_WOOD_SLAB;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getName(){
static $names = [
0 => "Oak",
1 => "Spruce",
2 => "Birch",
3 => "Jungle",
4 => "Acacia",
5 => "Dark Oak",
6 => "",
7 => ""
];
return "Double " . $names[$this->meta & 0x07] . " Wooden Slab";
}
public function getName(){
static $names = [
0 => "Oak",
1 => "Spruce",
2 => "Birch",
3 => "Jungle",
4 => "Acacia",
5 => "Dark Oak",
6 => "",
7 => ""
];
return "Double " . $names[$this->meta & 0x07] . " Wooden Slab";
}
public function getBreakTime(Item $item){
switch($item->isAxe()){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Emerald extends Solid{
protected $id = self::EMERALD_BLOCK;
protected $id = self::EMERALD_BLOCK;
public function __construct(){
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getName(){
return "Emerald Block";
}
public function getName(){
return "Emerald Block";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class EmeraldOre extends Solid{
protected $id = self::EMERALD_ORE;
protected $id = self::EMERALD_ORE;
public function __construct(){
}
public function getName(){
return "Emerald Ore";
}
public function getName(){
return "Emerald Ore";
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -26,27 +26,27 @@ use pocketmine\math\AxisAlignedBB;
class EndPortalFrame extends Solid{
protected $id = self::END_PORTAL_FRAME;
protected $id = self::END_PORTAL_FRAME;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getLightLevel(){
return 1;
}
public function getLightLevel(){
return 1;
}
public function getName(){
return "End Portal Frame";
}
public function getName(){
return "End Portal Frame";
}
public function getHardness(){
return 18000000;
}
public function getHardness(){
return 18000000;
}
public function isBreakable(Item $item){
return false;
}
public function isBreakable(Item $item){
return false;
}
protected function recalculateBoundingBox(){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class EndStone extends Solid{
protected $id = self::END_STONE;
protected $id = self::END_STONE;
public function __construct(){
}
public function getName(){
return "End Stone";
}
public function getName(){
return "End Stone";
}
public function getHardness(){
return 45;
}
public function getHardness(){
return 45;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -26,19 +26,19 @@ use pocketmine\math\AxisAlignedBB;
class Farmland extends Solid{
protected $id = self::FARMLAND;
protected $id = self::FARMLAND;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Farmland";
}
public function getName(){
return "Farmland";
}
public function getHardness(){
return 3;
}
public function getHardness(){
return 3;
}
protected function recalculateBoundingBox(){
return new AxisAlignedBB(

View File

@ -25,19 +25,19 @@ use pocketmine\math\AxisAlignedBB;
class Fence extends Transparent{
protected $id = self::FENCE;
protected $id = self::FENCE;
public function __construct(){
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getName(){
return "Oak Fence";
}
public function getName(){
return "Oak Fence";
}
protected function recalculateBoundingBox(){
@ -46,7 +46,7 @@ class Fence extends Transparent{
$flag2 = $this->canConnect($this->getSide(4));
$flag3 = $this->canConnect($this->getSide(5));
$f = $flag2 ? 0 : 0.375;
$f = $flag2 ? 0 : 0.375;
$f1 = $flag3 ? 1 : 0.625;
$f2 = $flag ? 0 : 0.375;
$f3 = $flag1 ? 1 : 0.625;

View File

@ -23,9 +23,9 @@ namespace pocketmine\block;
class FenceAcacia extends Fence{
protected $id = self::FENCE_ACACIA;
protected $id = self::FENCE_ACACIA;
public function getName(){
return "Acacia Fence";
}
return "Acacia Fence";
}
}

View File

@ -23,9 +23,9 @@ namespace pocketmine\block;
class FenceBirch extends Fence{
protected $id = self::FENCE_BIRCH;
protected $id = self::FENCE_BIRCH;
public function getName(){
return "Birch Fence";
}
public function getName(){
return "Birch Fence";
}
}

View File

@ -23,9 +23,9 @@ namespace pocketmine\block;
class FenceDarkOak extends Fence{
protected $id = self::FENCE_DARK_OAK;
protected $id = self::FENCE_DARK_OAK;
public function getName(){
return "Dark Oak Fence";
}
public function getName(){
return "Dark Oak Fence";
}
}

View File

@ -27,23 +27,23 @@ use pocketmine\Player;
class FenceGate extends Transparent{
protected $id = self::FENCE_GATE;
protected $id = self::FENCE_GATE;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Oak Fence Gate";
}
public function getName(){
return "Oak Fence Gate";
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
protected function recalculateBoundingBox(){

View File

@ -24,9 +24,9 @@ namespace pocketmine\block;
class FenceGateAcacia extends FenceGate{
protected $id = self::FENCE_GATE_ACACIA;
protected $id = self::FENCE_GATE_ACACIA;
public function getName(){
return "Acacia Fence Gate";
}
public function getName(){
return "Acacia Fence Gate";
}
}

View File

@ -24,9 +24,9 @@ namespace pocketmine\block;
class FenceGateBirch extends FenceGate{
protected $id = self::FENCE_GATE_BIRCH;
protected $id = self::FENCE_GATE_BIRCH;
public function getName(){
return "Birch Fence Gate";
}
public function getName(){
return "Birch Fence Gate";
}
}

View File

@ -24,9 +24,9 @@ namespace pocketmine\block;
class FenceGateDarkOak extends FenceGate{
protected $id = self::FENCE_GATE_DARK_OAK;
protected $id = self::FENCE_GATE_DARK_OAK;
public function getName(){
return "Dark Oak Fence Gate";
}
public function getName(){
return "Dark Oak Fence Gate";
}
}

View File

@ -24,9 +24,9 @@ namespace pocketmine\block;
class FenceGateJungle extends FenceGate{
protected $id = self::FENCE_GATE_JUNGLE;
protected $id = self::FENCE_GATE_JUNGLE;
public function getName(){
return "Jungle Fence Gate";
}
public function getName(){
return "Jungle Fence Gate";
}
}

View File

@ -24,9 +24,9 @@ namespace pocketmine\block;
class FenceGateSpruce extends FenceGate{
protected $id = self::FENCE_GATE_SPRUCE;
protected $id = self::FENCE_GATE_SPRUCE;
public function getName(){
return "Spruce Fence Gate";
}
public function getName(){
return "Spruce Fence Gate";
}
}

View File

@ -23,9 +23,9 @@ namespace pocketmine\block;
class FenceJungle extends Fence{
protected $id = self::FENCE_JUNGLE;
protected $id = self::FENCE_JUNGLE;
public function getName(){
return "Jungle Fence";
}
public function getName(){
return "Jungle Fence";
}
}

View File

@ -23,9 +23,9 @@ namespace pocketmine\block;
class FenceSpruce extends Fence{
protected $id = self::FENCE_SPRUCE;
protected $id = self::FENCE_SPRUCE;
public function getName(){
return "Spruce Fence";
}
public function getName(){
return "Spruce Fence";
}
}

View File

@ -31,31 +31,31 @@ use pocketmine\Server;
class Fire extends Flowable{
protected $id = self::FIRE;
protected $id = self::FIRE;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function hasEntityCollision(){
return true;
}
public function hasEntityCollision(){
return true;
}
public function getName(){
return "Fire Block";
}
public function getName(){
return "Fire Block";
}
public function getLightLevel(){
return 15;
}
return 15;
}
public function isBreakable(Item $item){
return false;
}
public function isBreakable(Item $item){
return false;
}
public function canBeReplaced(){
return true;
}
public function canBeReplaced(){
return true;
}
public function onEntityCollide(Entity $entity){
$ev = new EntityDamageByBlockEvent($this, $entity, EntityDamageEvent::CAUSE_FIRE, 1);

View File

@ -24,19 +24,19 @@ namespace pocketmine\block;
abstract class Flowable extends Transparent{
public function canBeFlowedInto(){
return true;
}
public function canBeFlowedInto(){
return true;
}
public function isSolid(){
return false;
}
public function isSolid(){
return false;
}
public function getBoundingBox(){
return null;
}
public function getBoundingBox(){
return null;
}
public function getHardness(){
return 0;
}
public function getHardness(){
return 0;
}
}

View File

@ -24,9 +24,9 @@ namespace pocketmine\block;
class Furnace extends BurningFurnace{
protected $id = self::FURNACE;
protected $id = self::FURNACE;
public function getName(){
return "Furnace";
}
public function getName(){
return "Furnace";
}
}

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Glass extends Transparent{
protected $id = self::GLASS;
protected $id = self::GLASS;
public function __construct(){
public function __construct(){
}
public function getName(){
return "Glass";
}
public function getName(){
return "Glass";
}
public function getHardness(){
return 1.5;
}
public function getHardness(){
return 1.5;
}
public function getDrops(Item $item){
return [];

View File

@ -24,18 +24,18 @@ namespace pocketmine\block;
class GlassPane extends Thin{
protected $id = self::GLASS_PANE;
protected $id = self::GLASS_PANE;
public function __construct(){
public function __construct(){
}
}
public function getName(){
return "Glass Pane";
}
public function getName(){
return "Glass Pane";
}
public function getHardness(){
return 1.5;
}
public function getHardness(){
return 1.5;
}
}

View File

@ -27,15 +27,15 @@ class GlowingObsidian extends Solid{
protected $id = self::GLOWING_OBSIDIAN;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Glowing Obsidian";
}
public function getName(){
return "Glowing Obsidian";
}
public function getLightLevel(){
return 12;
}
public function getLightLevel(){
return 12;
}
}

View File

@ -32,17 +32,17 @@ class GlowingRedstoneOre extends Solid{
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getName(){
return "Glowing Redstone Ore";
}
public function getName(){
return "Glowing Redstone Ore";
}
public function getLightLevel(){
return 9;
}
public function getLightLevel(){
return 9;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_SCHEDULED or $type === Level::BLOCK_UPDATE_RANDOM){

View File

@ -25,23 +25,23 @@ use pocketmine\item\Item;
class Glowstone extends Transparent{
protected $id = self::GLOWSTONE_BLOCK;
protected $id = self::GLOWSTONE_BLOCK;
public function __construct(){
}
public function getName(){
return "Glowstone";
}
public function getName(){
return "Glowstone";
}
public function getHardness(){
return 1.5;
}
public function getHardness(){
return 1.5;
}
public function getLightLevel(){
return 15;
}
public function getLightLevel(){
return 15;
}
public function getDrops(Item $item){
return [

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Gold extends Solid{
protected $id = self::GOLD_BLOCK;
protected $id = self::GOLD_BLOCK;
public function __construct(){
}
public function getName(){
return "Gold Block";
}
public function getName(){
return "Gold Block";
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class GoldOre extends Solid{
protected $id = self::GOLD_ORE;
protected $id = self::GOLD_ORE;
public function __construct(){
}
public function getName(){
return "Gold Ore";
}
public function getName(){
return "Gold Ore";
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -38,17 +38,17 @@ class Grass extends Solid{
}
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
public function getName(){
return "Grass";
}
public function getName(){
return "Grass";
}
public function getHardness(){
return 3;
}
public function getHardness(){
return 3;
}
public function getDrops(Item $item){
return [

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Gravel extends Fallable{
protected $id = self::GRAVEL;
protected $id = self::GRAVEL;
public function __construct(){
}
public function getName(){
return "Gravel";
}
public function getName(){
return "Gravel";
}
public function getHardness(){
return 3;
}
public function getHardness(){
return 3;
}
public function getDrops(Item $item){
if(mt_rand(1, 10) === 1){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class HardenedClay extends Solid{
protected $id = self::HARDENED_CLAY;
protected $id = self::HARDENED_CLAY;
public function __construct(){
}
public function getName(){
return "Hardened Clay";
}
public function getName(){
return "Hardened Clay";
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -26,19 +26,19 @@ use pocketmine\Player;
class HayBale extends Solid{
protected $id = self::HAY_BALE;
protected $id = self::HAY_BALE;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
return "Hay Bale";
}
public function getName(){
return "Hay Bale";
}
public function getHardness(){
return 10;
}
public function getHardness(){
return 10;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
$faces = [

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Ice extends Transparent{
protected $id = self::ICE;
protected $id = self::ICE;
public function __construct(){
}
public function getName(){
return "Ice";
}
public function getName(){
return "Ice";
}
public function getHardness(){
return 2.5;
}
public function getHardness(){
return 2.5;
}
public function onBreak(Item $item){
$this->getLevel()->setBlock($this, new Water(), true);

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Iron extends Solid{
protected $id = self::IRON_BLOCK;
protected $id = self::IRON_BLOCK;
public function __construct(){
}
public function getName(){
return "Iron Block";
}
public function getName(){
return "Iron Block";
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -24,14 +24,14 @@ namespace pocketmine\block;
class IronBars extends Thin{
protected $id = self::IRON_BARS;
protected $id = self::IRON_BARS;
public function __construct(){
}
public function getName(){
return "Iron Bars";
}
public function getName(){
return "Iron Bars";
}
}

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class IronDoor extends Door{
protected $id = self::IRON_DOOR_BLOCK;
protected $id = self::IRON_DOOR_BLOCK;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
return "Iron Door Block";
}
public function getName(){
return "Iron Door Block";
}
public function getHardness(){
return 25;
}
public function getHardness(){
return 25;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class IronOre extends Solid{
protected $id = self::IRON_ORE;
protected $id = self::IRON_ORE;
public function __construct(){
}
public function getName(){
return "Iron Ore";
}
public function getName(){
return "Iron Ore";
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -25,15 +25,15 @@ use pocketmine\item\Item;
class JungleWoodStairs extends Stair{
protected $id = self::JUNGLE_WOOD_STAIRS;
protected $id = self::JUNGLE_WOOD_STAIRS;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Jungle Wood Stairs";
}
public function getName(){
return "Jungle Wood Stairs";
}
public function getDrops(Item $item){
return [

View File

@ -35,21 +35,21 @@ class Ladder extends Transparent{
$this->meta = $meta;
}
public function getName(){
return "Ladder";
}
public function getName(){
return "Ladder";
}
public function hasEntityCollision(){
return true;
}
public function hasEntityCollision(){
return true;
}
public function isSolid(){
return false;
}
public function isSolid(){
return false;
}
public function getHardness(){
return 2;
}
public function getHardness(){
return 2;
}
public function onEntityCollide(Entity $entity){
$entity->fallDistance = 0;

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Lapis extends Solid{
protected $id = self::LAPIS_BLOCK;
protected $id = self::LAPIS_BLOCK;
public function __construct(){
}
public function getName(){
return "Lapis Block";
}
public function getName(){
return "Lapis Block";
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class LapisOre extends Solid{
protected $id = self::LAPIS_ORE;
protected $id = self::LAPIS_ORE;
public function __construct(){
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getName(){
return "Lapis Ore";
}
public function getName(){
return "Lapis Ore";
}
public function getBreakTime(Item $item){

View File

@ -37,17 +37,17 @@ class Lava extends Liquid{
$this->meta = $meta;
}
public function getLightLevel(){
return 15;
}
public function getLightLevel(){
return 15;
}
public function getName(){
return "Lava";
}
public function getName(){
return "Lava";
}
public function getHardness(){
return 0;
}
public function getHardness(){
return 0;
}
public function onEntityCollide(Entity $entity){
$entity->fallDistance *= 0.5;

View File

@ -35,25 +35,25 @@ class Leaves extends Transparent{
const ACACIA = 0;
const DARK_OAK = 1;
protected $id = self::LEAVES;
protected $id = self::LEAVES;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getHardness(){
return 1;
}
public function getHardness(){
return 1;
}
public function getName(){
static $names = [
self::OAK => "Oak Leaves",
self::SPRUCE => "Spruce Leaves",
self::BIRCH => "Birch Leaves",
self::JUNGLE => "Jungle Leaves",
];
return $names[$this->meta & 0x03];
}
public function getName(){
static $names = [
self::OAK => "Oak Leaves",
self::SPRUCE => "Spruce Leaves",
self::BIRCH => "Birch Leaves",
self::JUNGLE => "Jungle Leaves",
];
return $names[$this->meta & 0x03];
}
private function findLog(Block $pos, array $visited, $distance, &$check, $fromSide = null){
++$check;

View File

@ -29,19 +29,19 @@ use pocketmine\Server;
class Leaves2 extends Leaves{
protected $id = self::LEAVES2;
protected $id = self::LEAVES2;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
static $names = [
self::ACACIA => "Acacia Leaves",
self::DARK_OAK => "Dark Oak Leaves",
];
return $names[$this->meta & 0x01];
}
public function getName(){
static $names = [
self::ACACIA => "Acacia Leaves",
self::DARK_OAK => "Dark Oak Leaves",
];
return $names[$this->meta & 0x01];
}
private function findLog(Block $pos, array $visited, $distance, &$check, $fromSide = null){
++$check;

View File

@ -29,21 +29,21 @@ use pocketmine\math\Vector3;
abstract class Liquid extends Transparent{
public function hasEntityCollision(){
return true;
}
public function hasEntityCollision(){
return true;
}
public function isBreakable(Item $item){
return false;
}
public function isBreakable(Item $item){
return false;
}
public function canBeReplaced(){
return true;
}
public function canBeReplaced(){
return true;
}
public function isSolid(){
return false;
}
public function isSolid(){
return false;
}
public $adjacentSources = 0;
public $isOptimalFlowDirection = [0, 0, 0, 0];

View File

@ -26,22 +26,22 @@ use pocketmine\Player;
class LitPumpkin extends Solid{
protected $id = self::LIT_PUMPKIN;
protected $id = self::LIT_PUMPKIN;
public function getLightLevel(){
return 15;
}
public function getLightLevel(){
return 15;
}
public function getHardness(){
return 5;
}
public function getHardness(){
return 5;
}
public function getName(){
return "Jack o'Lantern";
}
public function getName(){
return "Jack o'Lantern";
}
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Melon extends Transparent{
protected $id = self::MELON_BLOCK;
protected $id = self::MELON_BLOCK;
public function __construct(){
}
public function getName(){
return "Melon Block";
}
public function getName(){
return "Melon Block";
}
public function getHardness(){
return 5;
}
public function getHardness(){
return 5;
}
public function getDrops(Item $item){
return [

View File

@ -28,11 +28,11 @@ use pocketmine\Server;
class MelonStem extends Crops{
protected $id = self::MELON_STEM;
protected $id = self::MELON_STEM;
public function getName(){
return "Melon Stem";
}
public function getName(){
return "Melon Stem";
}
public function __construct($meta = 0){
$this->meta = $meta;

View File

@ -25,38 +25,38 @@ use pocketmine\item\Item;
class MonsterSpawner extends Solid{
protected $id = self::MONSTER_SPAWNER;
protected $id = self::MONSTER_SPAWNER;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getHardness(){
return 25;
}
public function getHardness(){
return 25;
}
public function getName(){
return "Monster Spawner";
}
public function getName(){
return "Monster Spawner";
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
case 3:
return 1.9;
case 2:
return 0.65;
case 1:
return 3.75;
default:
return 25;
}
}
public function getBreakTime(Item $item){
switch($item->isPickaxe()){
case 5:
return 0.95;
case 4:
return 1.25;
case 3:
return 1.9;
case 2:
return 0.65;
case 1:
return 3.75;
default:
return 25;
}
}
public function getDrops(Item $item){
return [];
}
public function getDrops(Item $item){
return [];
}
}

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class MossStone extends Solid{
protected $id = self::MOSS_STONE;
protected $id = self::MOSS_STONE;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
return "Moss Stone";
}
public function getName(){
return "Moss Stone";
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){

View File

@ -29,19 +29,19 @@ use pocketmine\Server;
class Mycelium extends Solid{
protected $id = self::MYCELIUM;
protected $id = self::MYCELIUM;
public function __construct(){
}
public function getName(){
return "Mycelium";
}
public function getName(){
return "Mycelium";
}
public function getHardness() {
return 2.5;
}
public function getHardness(){
return 2.5;
}
public function getDrops(Item $item){
return [

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class NetherBrick extends Solid{
protected $id = self::NETHER_BRICKS;
protected $id = self::NETHER_BRICKS;
public function __construct(){
}
public function getName(){
return "Nether Bricks";
}
public function getName(){
return "Nether Bricks";
}
public function getHardness(){
return 30;
}
public function getHardness(){
return 30;
}
public function getBreakTime(Item $item){

View File

@ -24,11 +24,11 @@ namespace pocketmine\block;
class NetherBrickStairs extends Stair{
protected $id = self::NETHER_BRICKS_STAIRS;
protected $id = self::NETHER_BRICKS_STAIRS;
public function getName(){
return "Nether Bricks Stairs";
}
public function getName(){
return "Nether Bricks Stairs";
}
public function __construct($meta = 0){
$this->meta = $meta;

View File

@ -24,18 +24,18 @@ namespace pocketmine\block;
class NetherReactor extends Solid{
protected $id = self::NETHER_REACTOR;
protected $id = self::NETHER_REACTOR;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
return "Nether Reactor";
}
public function getName(){
return "Nether Reactor";
}
public function canBeActivated(){
return true;
}
public function canBeActivated(){
return true;
}
}

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Netherrack extends Solid{
protected $id = self::NETHERRACK;
protected $id = self::NETHERRACK;
public function __construct(){
}
public function getName(){
return "Netherrack";
}
public function getName(){
return "Netherrack";
}
public function getHardness(){
return 2;
}
public function getHardness(){
return 2;
}
public function getBreakTime(Item $item){

View File

@ -25,19 +25,19 @@ use pocketmine\item\Item;
class Obsidian extends Solid{
protected $id = self::OBSIDIAN;
protected $id = self::OBSIDIAN;
public function __construct(){
}
public function getName(){
return "Obsidian";
}
public function getName(){
return "Obsidian";
}
public function getHardness(){
return 6000;
}
public function getHardness(){
return 6000;
}
public function getBreakTime(Item $item){

View File

@ -30,28 +30,28 @@ class Planks extends Solid{
const ACACIA = 4;
const DARK_OAK = 5;
protected $id = self::WOODEN_PLANKS;
protected $id = self::WOODEN_PLANKS;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function getName(){
static $names = [
self::OAK => "Oak Wood Planks",
self::SPRUCE => "Spruce Wood Planks",
self::BIRCH => "Birch Wood Planks",
self::JUNGLE => "Jungle Wood Planks",
self::ACACIA => "Acacia Wood Planks",
self::DARK_OAK => "Jungle Wood Planks",
"",
""
];
return $names[$this->meta & 0x07];
}
public function getName(){
static $names = [
self::OAK => "Oak Wood Planks",
self::SPRUCE => "Spruce Wood Planks",
self::BIRCH => "Birch Wood Planks",
self::JUNGLE => "Jungle Wood Planks",
self::ACACIA => "Acacia Wood Planks",
self::DARK_OAK => "Jungle Wood Planks",
"",
""
];
return $names[$this->meta & 0x07];
}
}

View File

@ -23,17 +23,17 @@ namespace pocketmine\block;
class Podzol extends Solid{
protected $id = self::PODZOL;
protected $id = self::PODZOL;
public function __construct(){
}
public function getName(){
return "Podzol";
}
public function getName(){
return "Podzol";
}
public function getHardness(){
return 2.5;
}
public function getHardness(){
return 2.5;
}
}

View File

@ -27,15 +27,15 @@ use pocketmine\Player;
class Poppy extends Flowable{
protected $id = self::POPPY;
protected $id = self::POPPY;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Poppy";
}
public function getName(){
return "Poppy";
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){

View File

@ -25,15 +25,15 @@ use pocketmine\item\Item;
class Potato extends Crops{
protected $id = self::POTATO_BLOCK;
protected $id = self::POTATO_BLOCK;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
return "Potato Block";
}
public function getName(){
return "Potato Block";
}
public function getDrops(Item $item){
$drops = [];

View File

@ -26,19 +26,19 @@ use pocketmine\Player;
class Pumpkin extends Solid{
protected $id = self::PUMPKIN;
protected $id = self::PUMPKIN;
public function __construct(){
}
public function getHardness(){
return 5;
}
public function getHardness(){
return 5;
}
public function getName(){
return "Pumpkin";
}
public function getName(){
return "Pumpkin";
}
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
if($player instanceof Player){

View File

@ -28,15 +28,15 @@ use pocketmine\Server;
class PumpkinStem extends Crops{
protected $id = self::PUMPKIN_STEM;
protected $id = self::PUMPKIN_STEM;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
return "Pumpkin Stem";
}
public function getName(){
return "Pumpkin Stem";
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL){

View File

@ -25,21 +25,21 @@ use pocketmine\item\Item;
class Quartz extends Solid{
protected $id = self::QUARTZ_BLOCK;
protected $id = self::QUARTZ_BLOCK;
public function __construct($meta = 0){
$this->meta = $meta;
}
public function getName(){
static $names = [
0 => "Quartz Block",
1 => "Chiseled Quartz Block",
2 => "Quartz Pillar",
3 => "Quartz Pillar",
];
return $names[$this->meta & 0x03];
}
public function getName(){
static $names = [
0 => "Quartz Block",
1 => "Chiseled Quartz Block",
2 => "Quartz Pillar",
3 => "Quartz Pillar",
];
return $names[$this->meta & 0x03];
}
public function getBreakTime(Item $item){

View File

@ -24,14 +24,14 @@ namespace pocketmine\block;
class QuartzStairs extends Stair{
protected $id = self::QUARTZ_STAIRS;
protected $id = self::QUARTZ_STAIRS;
public function __construct($meta = 0){
$this->meta = $meta;
$this->meta = $meta;
}
public function getName(){
return "Quartz Stairs";
}
public function getName(){
return "Quartz Stairs";
}
}

View File

@ -27,15 +27,15 @@ use pocketmine\Player;
class RedMushroom extends Flowable{
protected $id = self::RED_MUSHROOM;
protected $id = self::RED_MUSHROOM;
public function __construct(){
}
public function getName(){
return "Red Mushroom";
}
return "Red Mushroom";
}
public function onUpdate($type){

View File

@ -26,19 +26,19 @@ use pocketmine\level\Level;
class RedstoneOre extends Solid{
protected $id = self::REDSTONE_ORE;
protected $id = self::REDSTONE_ORE;
public function __construct(){
}
public function getName(){
return "Redstone Ore";
}
public function getName(){
return "Redstone Ore";
}
public function getHardness(){
return 15;
}
public function getHardness(){
return 15;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL or $type === Level::BLOCK_UPDATE_TOUCH){

Some files were not shown because too many files have changed in this diff Show More