diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index d7c1ba591..227a51e1f 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -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], diff --git a/src/pocketmine/PocketMine.php b/src/pocketmine/PocketMine.php index aa125a9f7..bc0951216 100644 --- a/src/pocketmine/PocketMine.php +++ b/src/pocketmine/PocketMine.php @@ -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){ diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 777429bca..c744fb4e9 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -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); } diff --git a/src/pocketmine/block/Air.php b/src/pocketmine/block/Air.php index 16840484f..22d9a7386 100644 --- a/src/pocketmine/block/Air.php +++ b/src/pocketmine/block/Air.php @@ -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; diff --git a/src/pocketmine/block/Bed.php b/src/pocketmine/block/Bed.php index 7b0e83025..16cadf7f9 100644 --- a/src/pocketmine/block/Bed.php +++ b/src/pocketmine/block/Bed.php @@ -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( diff --git a/src/pocketmine/block/Bedrock.php b/src/pocketmine/block/Bedrock.php index 00ac97b4e..4f8f04257 100644 --- a/src/pocketmine/block/Bedrock.php +++ b/src/pocketmine/block/Bedrock.php @@ -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; diff --git a/src/pocketmine/block/Beetroot.php b/src/pocketmine/block/Beetroot.php index 41c5fae43..de006fa4f 100644 --- a/src/pocketmine/block/Beetroot.php +++ b/src/pocketmine/block/Beetroot.php @@ -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 = []; diff --git a/src/pocketmine/block/BirchWoodStairs.php b/src/pocketmine/block/BirchWoodStairs.php index bd37fa235..ae0517878 100644 --- a/src/pocketmine/block/BirchWoodStairs.php +++ b/src/pocketmine/block/BirchWoodStairs.php @@ -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 [ diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index 71651a406..b78a38b87 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -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; diff --git a/src/pocketmine/block/Bookshelf.php b/src/pocketmine/block/Bookshelf.php index dd0f97278..8e930b2f3 100644 --- a/src/pocketmine/block/Bookshelf.php +++ b/src/pocketmine/block/Bookshelf.php @@ -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; + } } \ No newline at end of file diff --git a/src/pocketmine/block/BrickStairs.php b/src/pocketmine/block/BrickStairs.php index 3b2ae72cb..f8830cc80 100644 --- a/src/pocketmine/block/BrickStairs.php +++ b/src/pocketmine/block/BrickStairs.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Bricks.php b/src/pocketmine/block/Bricks.php index f95e2c4a6..cb6d65592 100644 --- a/src/pocketmine/block/Bricks.php +++ b/src/pocketmine/block/Bricks.php @@ -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()){ diff --git a/src/pocketmine/block/BrownMushroom.php b/src/pocketmine/block/BrownMushroom.php index d513c09c6..2eae733f9 100644 --- a/src/pocketmine/block/BrownMushroom.php +++ b/src/pocketmine/block/BrownMushroom.php @@ -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){ diff --git a/src/pocketmine/block/BurningFurnace.php b/src/pocketmine/block/BurningFurnace.php index 8bff00704..d4c5cbdfd 100644 --- a/src/pocketmine/block/BurningFurnace.php +++ b/src/pocketmine/block/BurningFurnace.php @@ -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 = [ diff --git a/src/pocketmine/block/Cactus.php b/src/pocketmine/block/Cactus.php index 000de4e78..3bd478ba5 100644 --- a/src/pocketmine/block/Cactus.php +++ b/src/pocketmine/block/Cactus.php @@ -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(){ diff --git a/src/pocketmine/block/Cake.php b/src/pocketmine/block/Cake.php index 667f6411c..8373d660c 100644 --- a/src/pocketmine/block/Cake.php +++ b/src/pocketmine/block/Cake.php @@ -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(){ diff --git a/src/pocketmine/block/Carpet.php b/src/pocketmine/block/Carpet.php index 563a6b471..77b91b345 100644 --- a/src/pocketmine/block/Carpet.php +++ b/src/pocketmine/block/Carpet.php @@ -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(){ diff --git a/src/pocketmine/block/Carrot.php b/src/pocketmine/block/Carrot.php index b1ca5f2b7..c946041c8 100644 --- a/src/pocketmine/block/Carrot.php +++ b/src/pocketmine/block/Carrot.php @@ -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 = []; diff --git a/src/pocketmine/block/Chest.php b/src/pocketmine/block/Chest.php index 15b57a587..72f0261ba 100644 --- a/src/pocketmine/block/Chest.php +++ b/src/pocketmine/block/Chest.php @@ -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( diff --git a/src/pocketmine/block/Clay.php b/src/pocketmine/block/Clay.php index fdc27e00b..c25124249 100644 --- a/src/pocketmine/block/Clay.php +++ b/src/pocketmine/block/Clay.php @@ -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 [ diff --git a/src/pocketmine/block/Coal.php b/src/pocketmine/block/Coal.php index b72576ca4..f00312788 100644 --- a/src/pocketmine/block/Coal.php +++ b/src/pocketmine/block/Coal.php @@ -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()){ diff --git a/src/pocketmine/block/CoalOre.php b/src/pocketmine/block/CoalOre.php index 7b07afee9..59f7fa57e 100644 --- a/src/pocketmine/block/CoalOre.php +++ b/src/pocketmine/block/CoalOre.php @@ -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()){ diff --git a/src/pocketmine/block/Cobblestone.php b/src/pocketmine/block/Cobblestone.php index a318ea3c5..84895dc4d 100644 --- a/src/pocketmine/block/Cobblestone.php +++ b/src/pocketmine/block/Cobblestone.php @@ -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()){ diff --git a/src/pocketmine/block/CobblestoneStairs.php b/src/pocketmine/block/CobblestoneStairs.php index 155786434..a9e9f727c 100644 --- a/src/pocketmine/block/CobblestoneStairs.php +++ b/src/pocketmine/block/CobblestoneStairs.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Cobweb.php b/src/pocketmine/block/Cobweb.php index 0dbc7cc7f..5bc1220f6 100644 --- a/src/pocketmine/block/Cobweb.php +++ b/src/pocketmine/block/Cobweb.php @@ -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 []; } } \ No newline at end of file diff --git a/src/pocketmine/block/Crops.php b/src/pocketmine/block/Crops.php index 2ee4d5458..eaf8871cf 100644 --- a/src/pocketmine/block/Crops.php +++ b/src/pocketmine/block/Crops.php @@ -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); diff --git a/src/pocketmine/block/Dandelion.php b/src/pocketmine/block/Dandelion.php index 9b8a6266e..260829cf7 100644 --- a/src/pocketmine/block/Dandelion.php +++ b/src/pocketmine/block/Dandelion.php @@ -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){ diff --git a/src/pocketmine/block/DarkOakWoodStairs.php b/src/pocketmine/block/DarkOakWoodStairs.php index 03ca2859b..c5a4cc06f 100644 --- a/src/pocketmine/block/DarkOakWoodStairs.php +++ b/src/pocketmine/block/DarkOakWoodStairs.php @@ -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 [ diff --git a/src/pocketmine/block/DeadBush.php b/src/pocketmine/block/DeadBush.php index 0080d58c8..fd49b1c60 100644 --- a/src/pocketmine/block/DeadBush.php +++ b/src/pocketmine/block/DeadBush.php @@ -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; } diff --git a/src/pocketmine/block/Diamond.php b/src/pocketmine/block/Diamond.php index 6c544ea93..2e15ebfae 100644 --- a/src/pocketmine/block/Diamond.php +++ b/src/pocketmine/block/Diamond.php @@ -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()){ diff --git a/src/pocketmine/block/DiamondOre.php b/src/pocketmine/block/DiamondOre.php index fe8766aa7..66b560c4f 100644 --- a/src/pocketmine/block/DiamondOre.php +++ b/src/pocketmine/block/DiamondOre.php @@ -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()){ diff --git a/src/pocketmine/block/Dirt.php b/src/pocketmine/block/Dirt.php index ce90f253b..fa05a2e93 100644 --- a/src/pocketmine/block/Dirt.php +++ b/src/pocketmine/block/Dirt.php @@ -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()){ diff --git a/src/pocketmine/block/Door.php b/src/pocketmine/block/Door.php index c1f062248..67d6ab388 100644 --- a/src/pocketmine/block/Door.php +++ b/src/pocketmine/block/Door.php @@ -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(); diff --git a/src/pocketmine/block/DoubleSlab.php b/src/pocketmine/block/DoubleSlab.php index 8ca344234..2f1558563 100644 --- a/src/pocketmine/block/DoubleSlab.php +++ b/src/pocketmine/block/DoubleSlab.php @@ -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()){ diff --git a/src/pocketmine/block/DoubleWoodSlab.php b/src/pocketmine/block/DoubleWoodSlab.php index ea193705a..b9430e3eb 100644 --- a/src/pocketmine/block/DoubleWoodSlab.php +++ b/src/pocketmine/block/DoubleWoodSlab.php @@ -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()){ diff --git a/src/pocketmine/block/Emerald.php b/src/pocketmine/block/Emerald.php index 4ffbf3e2d..3d65a7292 100644 --- a/src/pocketmine/block/Emerald.php +++ b/src/pocketmine/block/Emerald.php @@ -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()){ diff --git a/src/pocketmine/block/EmeraldOre.php b/src/pocketmine/block/EmeraldOre.php index 11c753fcb..7896c0c2d 100644 --- a/src/pocketmine/block/EmeraldOre.php +++ b/src/pocketmine/block/EmeraldOre.php @@ -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()){ diff --git a/src/pocketmine/block/EndPortalFrame.php b/src/pocketmine/block/EndPortalFrame.php index 8ab3f0671..158805196 100644 --- a/src/pocketmine/block/EndPortalFrame.php +++ b/src/pocketmine/block/EndPortalFrame.php @@ -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(){ diff --git a/src/pocketmine/block/EndStone.php b/src/pocketmine/block/EndStone.php index 1f0ee4ece..ceef5a782 100644 --- a/src/pocketmine/block/EndStone.php +++ b/src/pocketmine/block/EndStone.php @@ -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()){ diff --git a/src/pocketmine/block/Farmland.php b/src/pocketmine/block/Farmland.php index 0a4e9dbd9..55bd5a611 100644 --- a/src/pocketmine/block/Farmland.php +++ b/src/pocketmine/block/Farmland.php @@ -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( diff --git a/src/pocketmine/block/Fence.php b/src/pocketmine/block/Fence.php index 518c41016..67eae5b69 100644 --- a/src/pocketmine/block/Fence.php +++ b/src/pocketmine/block/Fence.php @@ -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; diff --git a/src/pocketmine/block/FenceAcacia.php b/src/pocketmine/block/FenceAcacia.php index 947b9c466..aa367fb2c 100644 --- a/src/pocketmine/block/FenceAcacia.php +++ b/src/pocketmine/block/FenceAcacia.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceBirch.php b/src/pocketmine/block/FenceBirch.php index d257689bd..0120269cb 100644 --- a/src/pocketmine/block/FenceBirch.php +++ b/src/pocketmine/block/FenceBirch.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceDarkOak.php b/src/pocketmine/block/FenceDarkOak.php index c8a436839..8ef1dfc4f 100644 --- a/src/pocketmine/block/FenceDarkOak.php +++ b/src/pocketmine/block/FenceDarkOak.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceGate.php b/src/pocketmine/block/FenceGate.php index 6e89d1825..918cdb4b8 100644 --- a/src/pocketmine/block/FenceGate.php +++ b/src/pocketmine/block/FenceGate.php @@ -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(){ diff --git a/src/pocketmine/block/FenceGateAcacia.php b/src/pocketmine/block/FenceGateAcacia.php index e84c6a4f2..ddfcc2064 100644 --- a/src/pocketmine/block/FenceGateAcacia.php +++ b/src/pocketmine/block/FenceGateAcacia.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceGateBirch.php b/src/pocketmine/block/FenceGateBirch.php index f44638c6f..9db442fd9 100644 --- a/src/pocketmine/block/FenceGateBirch.php +++ b/src/pocketmine/block/FenceGateBirch.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceGateDarkOak.php b/src/pocketmine/block/FenceGateDarkOak.php index 7f76c8685..a4fb69f82 100644 --- a/src/pocketmine/block/FenceGateDarkOak.php +++ b/src/pocketmine/block/FenceGateDarkOak.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceGateJungle.php b/src/pocketmine/block/FenceGateJungle.php index 16774e1d8..c441f28dd 100644 --- a/src/pocketmine/block/FenceGateJungle.php +++ b/src/pocketmine/block/FenceGateJungle.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceGateSpruce.php b/src/pocketmine/block/FenceGateSpruce.php index bc42f504b..1ddb5fe0d 100644 --- a/src/pocketmine/block/FenceGateSpruce.php +++ b/src/pocketmine/block/FenceGateSpruce.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceJungle.php b/src/pocketmine/block/FenceJungle.php index cafd4f07b..9f7106437 100644 --- a/src/pocketmine/block/FenceJungle.php +++ b/src/pocketmine/block/FenceJungle.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceSpruce.php b/src/pocketmine/block/FenceSpruce.php index b4628f575..dcd45a3b4 100644 --- a/src/pocketmine/block/FenceSpruce.php +++ b/src/pocketmine/block/FenceSpruce.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Fire.php b/src/pocketmine/block/Fire.php index 5cf90ca7c..28eb20635 100644 --- a/src/pocketmine/block/Fire.php +++ b/src/pocketmine/block/Fire.php @@ -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); diff --git a/src/pocketmine/block/Flowable.php b/src/pocketmine/block/Flowable.php index 0dfdb4d71..ccdb725e5 100644 --- a/src/pocketmine/block/Flowable.php +++ b/src/pocketmine/block/Flowable.php @@ -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; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Furnace.php b/src/pocketmine/block/Furnace.php index 93e5465bb..2d64088ce 100644 --- a/src/pocketmine/block/Furnace.php +++ b/src/pocketmine/block/Furnace.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Glass.php b/src/pocketmine/block/Glass.php index e86252e57..8b5fba8eb 100644 --- a/src/pocketmine/block/Glass.php +++ b/src/pocketmine/block/Glass.php @@ -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 []; diff --git a/src/pocketmine/block/GlassPane.php b/src/pocketmine/block/GlassPane.php index bccec447c..9edb3bc9f 100644 --- a/src/pocketmine/block/GlassPane.php +++ b/src/pocketmine/block/GlassPane.php @@ -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; + } } \ No newline at end of file diff --git a/src/pocketmine/block/GlowingObsidian.php b/src/pocketmine/block/GlowingObsidian.php index 1af01ca3c..10ca59964 100644 --- a/src/pocketmine/block/GlowingObsidian.php +++ b/src/pocketmine/block/GlowingObsidian.php @@ -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; + } } \ No newline at end of file diff --git a/src/pocketmine/block/GlowingRedstoneOre.php b/src/pocketmine/block/GlowingRedstoneOre.php index 933957c1f..9c3ff2dfc 100644 --- a/src/pocketmine/block/GlowingRedstoneOre.php +++ b/src/pocketmine/block/GlowingRedstoneOre.php @@ -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){ diff --git a/src/pocketmine/block/Glowstone.php b/src/pocketmine/block/Glowstone.php index c81b52cab..d40403255 100644 --- a/src/pocketmine/block/Glowstone.php +++ b/src/pocketmine/block/Glowstone.php @@ -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 [ diff --git a/src/pocketmine/block/Gold.php b/src/pocketmine/block/Gold.php index e3b4e2be4..55df7b2bd 100644 --- a/src/pocketmine/block/Gold.php +++ b/src/pocketmine/block/Gold.php @@ -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()){ diff --git a/src/pocketmine/block/GoldOre.php b/src/pocketmine/block/GoldOre.php index 370b1acf3..2ab095be4 100644 --- a/src/pocketmine/block/GoldOre.php +++ b/src/pocketmine/block/GoldOre.php @@ -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()){ diff --git a/src/pocketmine/block/Grass.php b/src/pocketmine/block/Grass.php index fbe2bf44d..352d9d4e8 100644 --- a/src/pocketmine/block/Grass.php +++ b/src/pocketmine/block/Grass.php @@ -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 [ diff --git a/src/pocketmine/block/Gravel.php b/src/pocketmine/block/Gravel.php index ebd8987b6..ddcdca2bc 100644 --- a/src/pocketmine/block/Gravel.php +++ b/src/pocketmine/block/Gravel.php @@ -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){ diff --git a/src/pocketmine/block/HardenedClay.php b/src/pocketmine/block/HardenedClay.php index 11cc36270..786c2e6b0 100644 --- a/src/pocketmine/block/HardenedClay.php +++ b/src/pocketmine/block/HardenedClay.php @@ -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()){ diff --git a/src/pocketmine/block/HayBale.php b/src/pocketmine/block/HayBale.php index 4f235c1f2..1dcb64b7e 100644 --- a/src/pocketmine/block/HayBale.php +++ b/src/pocketmine/block/HayBale.php @@ -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 = [ diff --git a/src/pocketmine/block/Ice.php b/src/pocketmine/block/Ice.php index 8312ed49f..fcc0a2ec4 100644 --- a/src/pocketmine/block/Ice.php +++ b/src/pocketmine/block/Ice.php @@ -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); diff --git a/src/pocketmine/block/Iron.php b/src/pocketmine/block/Iron.php index 38f7a6147..d25e7c44d 100644 --- a/src/pocketmine/block/Iron.php +++ b/src/pocketmine/block/Iron.php @@ -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()){ diff --git a/src/pocketmine/block/IronBars.php b/src/pocketmine/block/IronBars.php index 937121230..ad75b5d3a 100644 --- a/src/pocketmine/block/IronBars.php +++ b/src/pocketmine/block/IronBars.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/IronDoor.php b/src/pocketmine/block/IronDoor.php index 4735b1ed5..8327f5205 100644 --- a/src/pocketmine/block/IronDoor.php +++ b/src/pocketmine/block/IronDoor.php @@ -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()){ diff --git a/src/pocketmine/block/IronOre.php b/src/pocketmine/block/IronOre.php index 373254035..0d6873f8f 100644 --- a/src/pocketmine/block/IronOre.php +++ b/src/pocketmine/block/IronOre.php @@ -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()){ diff --git a/src/pocketmine/block/JungleWoodStairs.php b/src/pocketmine/block/JungleWoodStairs.php index 275d4d5b7..bf958f6f8 100644 --- a/src/pocketmine/block/JungleWoodStairs.php +++ b/src/pocketmine/block/JungleWoodStairs.php @@ -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 [ diff --git a/src/pocketmine/block/Ladder.php b/src/pocketmine/block/Ladder.php index e4f76e434..b0c389784 100644 --- a/src/pocketmine/block/Ladder.php +++ b/src/pocketmine/block/Ladder.php @@ -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; diff --git a/src/pocketmine/block/Lapis.php b/src/pocketmine/block/Lapis.php index e5a1fbecd..6a8855672 100644 --- a/src/pocketmine/block/Lapis.php +++ b/src/pocketmine/block/Lapis.php @@ -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()){ diff --git a/src/pocketmine/block/LapisOre.php b/src/pocketmine/block/LapisOre.php index 3513d609a..7c21a19f2 100644 --- a/src/pocketmine/block/LapisOre.php +++ b/src/pocketmine/block/LapisOre.php @@ -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){ diff --git a/src/pocketmine/block/Lava.php b/src/pocketmine/block/Lava.php index 33b442bac..5c1db3993 100644 --- a/src/pocketmine/block/Lava.php +++ b/src/pocketmine/block/Lava.php @@ -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; diff --git a/src/pocketmine/block/Leaves.php b/src/pocketmine/block/Leaves.php index 9e9c8cbbf..34a12b4b8 100644 --- a/src/pocketmine/block/Leaves.php +++ b/src/pocketmine/block/Leaves.php @@ -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; diff --git a/src/pocketmine/block/Leaves2.php b/src/pocketmine/block/Leaves2.php index 969467a2b..7869c4935 100644 --- a/src/pocketmine/block/Leaves2.php +++ b/src/pocketmine/block/Leaves2.php @@ -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; diff --git a/src/pocketmine/block/Liquid.php b/src/pocketmine/block/Liquid.php index 0d06ba185..ca5c1712b 100644 --- a/src/pocketmine/block/Liquid.php +++ b/src/pocketmine/block/Liquid.php @@ -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]; diff --git a/src/pocketmine/block/LitPumpkin.php b/src/pocketmine/block/LitPumpkin.php index 43764ad47..b369e455d 100644 --- a/src/pocketmine/block/LitPumpkin.php +++ b/src/pocketmine/block/LitPumpkin.php @@ -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){ diff --git a/src/pocketmine/block/Melon.php b/src/pocketmine/block/Melon.php index 4155adf2a..82736ac29 100644 --- a/src/pocketmine/block/Melon.php +++ b/src/pocketmine/block/Melon.php @@ -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 [ diff --git a/src/pocketmine/block/MelonStem.php b/src/pocketmine/block/MelonStem.php index f5a7c132d..70c7c378d 100644 --- a/src/pocketmine/block/MelonStem.php +++ b/src/pocketmine/block/MelonStem.php @@ -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; diff --git a/src/pocketmine/block/MonsterSpawner.php b/src/pocketmine/block/MonsterSpawner.php index 27db243ed..9a4d6dc7b 100644 --- a/src/pocketmine/block/MonsterSpawner.php +++ b/src/pocketmine/block/MonsterSpawner.php @@ -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 []; + } } \ No newline at end of file diff --git a/src/pocketmine/block/MossStone.php b/src/pocketmine/block/MossStone.php index 5d0e201f9..f0304dc6c 100644 --- a/src/pocketmine/block/MossStone.php +++ b/src/pocketmine/block/MossStone.php @@ -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){ diff --git a/src/pocketmine/block/Mycelium.php b/src/pocketmine/block/Mycelium.php index 3f11285f5..7f261ddb7 100644 --- a/src/pocketmine/block/Mycelium.php +++ b/src/pocketmine/block/Mycelium.php @@ -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 [ diff --git a/src/pocketmine/block/NetherBrick.php b/src/pocketmine/block/NetherBrick.php index f0c8bc76b..a2e1570f6 100644 --- a/src/pocketmine/block/NetherBrick.php +++ b/src/pocketmine/block/NetherBrick.php @@ -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){ diff --git a/src/pocketmine/block/NetherBrickStairs.php b/src/pocketmine/block/NetherBrickStairs.php index de8462806..a90e427b9 100644 --- a/src/pocketmine/block/NetherBrickStairs.php +++ b/src/pocketmine/block/NetherBrickStairs.php @@ -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; diff --git a/src/pocketmine/block/NetherReactor.php b/src/pocketmine/block/NetherReactor.php index 0fb8dedfb..47e49582b 100644 --- a/src/pocketmine/block/NetherReactor.php +++ b/src/pocketmine/block/NetherReactor.php @@ -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; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Netherrack.php b/src/pocketmine/block/Netherrack.php index 530c039c5..6873f9336 100644 --- a/src/pocketmine/block/Netherrack.php +++ b/src/pocketmine/block/Netherrack.php @@ -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){ diff --git a/src/pocketmine/block/Obsidian.php b/src/pocketmine/block/Obsidian.php index be6b2a7b5..f491405a3 100644 --- a/src/pocketmine/block/Obsidian.php +++ b/src/pocketmine/block/Obsidian.php @@ -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){ diff --git a/src/pocketmine/block/Planks.php b/src/pocketmine/block/Planks.php index 3326189a3..c15e1749c 100644 --- a/src/pocketmine/block/Planks.php +++ b/src/pocketmine/block/Planks.php @@ -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]; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Podzol.php b/src/pocketmine/block/Podzol.php index 85ddb7b0e..752aaa018 100644 --- a/src/pocketmine/block/Podzol.php +++ b/src/pocketmine/block/Podzol.php @@ -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; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Poppy.php b/src/pocketmine/block/Poppy.php index 9e6bd757f..0cbd5b651 100644 --- a/src/pocketmine/block/Poppy.php +++ b/src/pocketmine/block/Poppy.php @@ -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){ diff --git a/src/pocketmine/block/Potato.php b/src/pocketmine/block/Potato.php index 9d6fe9651..a47eabc14 100644 --- a/src/pocketmine/block/Potato.php +++ b/src/pocketmine/block/Potato.php @@ -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 = []; diff --git a/src/pocketmine/block/Pumpkin.php b/src/pocketmine/block/Pumpkin.php index f751a5a5b..aa3768e57 100644 --- a/src/pocketmine/block/Pumpkin.php +++ b/src/pocketmine/block/Pumpkin.php @@ -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){ diff --git a/src/pocketmine/block/PumpkinStem.php b/src/pocketmine/block/PumpkinStem.php index faecd8cb7..1f902025e 100644 --- a/src/pocketmine/block/PumpkinStem.php +++ b/src/pocketmine/block/PumpkinStem.php @@ -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){ diff --git a/src/pocketmine/block/Quartz.php b/src/pocketmine/block/Quartz.php index 161f01ec5..be08b7200 100644 --- a/src/pocketmine/block/Quartz.php +++ b/src/pocketmine/block/Quartz.php @@ -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){ diff --git a/src/pocketmine/block/QuartzStairs.php b/src/pocketmine/block/QuartzStairs.php index f55f08901..ede682d02 100644 --- a/src/pocketmine/block/QuartzStairs.php +++ b/src/pocketmine/block/QuartzStairs.php @@ -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"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/RedMushroom.php b/src/pocketmine/block/RedMushroom.php index 85ad0033a..1c61a0f9e 100644 --- a/src/pocketmine/block/RedMushroom.php +++ b/src/pocketmine/block/RedMushroom.php @@ -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){ diff --git a/src/pocketmine/block/RedstoneOre.php b/src/pocketmine/block/RedstoneOre.php index df074ffe8..52bf8c0da 100644 --- a/src/pocketmine/block/RedstoneOre.php +++ b/src/pocketmine/block/RedstoneOre.php @@ -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){ diff --git a/src/pocketmine/block/Sand.php b/src/pocketmine/block/Sand.php index b2d2f5d2b..1620f87dc 100644 --- a/src/pocketmine/block/Sand.php +++ b/src/pocketmine/block/Sand.php @@ -24,22 +24,22 @@ namespace pocketmine\block; class Sand extends Fallable{ - protected $id = self::SAND; + protected $id = self::SAND; public function __construct($meta = 0){ $this->meta = $meta; } - public function getHardness(){ - return 2.5; - } + public function getHardness(){ + return 2.5; + } - public function getName(){ - if($this->meta === 0x01){ - return "Red Sand"; - } + public function getName(){ + if($this->meta === 0x01){ + return "Red Sand"; + } - return "Sand"; - } + return "Sand"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Sandstone.php b/src/pocketmine/block/Sandstone.php index 6f6ad9033..b239a0b10 100644 --- a/src/pocketmine/block/Sandstone.php +++ b/src/pocketmine/block/Sandstone.php @@ -25,25 +25,25 @@ use pocketmine\item\Item; class Sandstone extends Solid{ - protected $id = self::SANDSTONE; + protected $id = self::SANDSTONE; public function __construct($meta = 0){ $this->meta = $meta; } - public function getHardness(){ - return 4; - } + public function getHardness(){ + return 4; + } - public function getName(){ - static $names = [ - 0 => "Sandstone", - 1 => "Chiseled Sandstone", - 2 => "Smooth Sandstone", - 3 => "", - ]; - return $names[$this->meta & 0x03]; - } + public function getName(){ + static $names = [ + 0 => "Sandstone", + 1 => "Chiseled Sandstone", + 2 => "Smooth Sandstone", + 3 => "", + ]; + return $names[$this->meta & 0x03]; + } public function getBreakTime(Item $item){ diff --git a/src/pocketmine/block/SandstoneStairs.php b/src/pocketmine/block/SandstoneStairs.php index d63f1fe62..6b6f14016 100644 --- a/src/pocketmine/block/SandstoneStairs.php +++ b/src/pocketmine/block/SandstoneStairs.php @@ -24,14 +24,14 @@ namespace pocketmine\block; class SandstoneStairs extends Stair{ - protected $id = self::SANDSTONE_STAIRS; + protected $id = self::SANDSTONE_STAIRS; public function __construct($meta = 0){ $this->meta = $meta; } - public function getName(){ - return "Sandstone Stairs"; - } + public function getName(){ + return "Sandstone Stairs"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Sapling.php b/src/pocketmine/block/Sapling.php index 133c8ea60..6015b85a3 100644 --- a/src/pocketmine/block/Sapling.php +++ b/src/pocketmine/block/Sapling.php @@ -32,32 +32,32 @@ class Sapling extends Flowable{ const SPRUCE = 1; const BIRCH = 2; const JUNGLE = 3; - const ACACIA = 4; - const DARK_OAK = 5; + const ACACIA = 4; + const DARK_OAK = 5; - protected $id = self::SAPLING; + protected $id = self::SAPLING; public function __construct($meta = 0){ - $this->meta = 0; + $this->meta = 0; } - public function canBeActivated(){ - return true; - } + public function canBeActivated(){ + return true; + } - public function getName(){ - static $names = [ - 0 => "Oak Sapling", - 1 => "Spruce Sapling", - 2 => "Birch Sapling", - 3 => "Jungle Sapling", - 4 => "Acacia Sapling", - 5 => "Dark Oak Sapling", - 6 => "", - 7 => "", - ]; + public function getName(){ + static $names = [ + 0 => "Oak Sapling", + 1 => "Spruce Sapling", + 2 => "Birch Sapling", + 3 => "Jungle Sapling", + 4 => "Acacia Sapling", + 5 => "Dark Oak Sapling", + 6 => "", + 7 => "", + ]; return $names[$this->meta & 0x07]; - } + } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ diff --git a/src/pocketmine/block/SignPost.php b/src/pocketmine/block/SignPost.php index add716556..831b420bb 100644 --- a/src/pocketmine/block/SignPost.php +++ b/src/pocketmine/block/SignPost.php @@ -27,23 +27,23 @@ use pocketmine\Player; class SignPost extends Transparent{ - protected $id = self::SIGN_POST; + protected $id = self::SIGN_POST; public function __construct($meta = 0){ $this->meta = $meta; } - public function getHardness(){ - return 5; - } + public function getHardness(){ + return 5; + } - public function isSolid(){ - return false; - } + public function isSolid(){ + return false; + } - public function getName(){ - return "Sign Post"; - } + public function getName(){ + return "Sign Post"; + } public function getBoundingBox(){ return null; diff --git a/src/pocketmine/block/Slab.php b/src/pocketmine/block/Slab.php index 25f4a8355..dc5dc435f 100644 --- a/src/pocketmine/block/Slab.php +++ b/src/pocketmine/block/Slab.php @@ -27,29 +27,29 @@ use pocketmine\Player; class Slab extends Transparent{ - protected $id = self::SLAB; + protected $id = self::SLAB; public function __construct($meta = 0){ $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 (($this->meta & 0x08) === 0x08 ? "Upper " : "") . $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 (($this->meta & 0x08) === 0x08 ? "Upper " : "") . $names[$this->meta & 0x07] . " Slab"; + } protected function recalculateBoundingBox(){ diff --git a/src/pocketmine/block/Snow.php b/src/pocketmine/block/Snow.php index f0cd4b7e8..21f2c10dd 100644 --- a/src/pocketmine/block/Snow.php +++ b/src/pocketmine/block/Snow.php @@ -24,18 +24,18 @@ namespace pocketmine\block; class Snow extends Solid{ - protected $id = self::SNOW_BLOCK; + protected $id = self::SNOW_BLOCK; public function __construct(){ } - public function getHardness(){ - return 1; - } + public function getHardness(){ + return 1; + } - public function getName(){ - return "Snow Block"; - } + public function getName(){ + return "Snow Block"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/SnowLayer.php b/src/pocketmine/block/SnowLayer.php index 803e044b0..4d6a649f7 100644 --- a/src/pocketmine/block/SnowLayer.php +++ b/src/pocketmine/block/SnowLayer.php @@ -27,23 +27,23 @@ use pocketmine\Player; class SnowLayer extends Flowable{ - protected $id = self::SNOW_LAYER; + protected $id = self::SNOW_LAYER; public function __construct($meta = 0){ - $this->meta = $meta; + $this->meta = $meta; } - public function getName(){ - return "Snow Layer"; - } + public function getName(){ + return "Snow Layer"; + } - public function canBeReplaced(){ - return true; - } + public function canBeReplaced(){ + return true; + } - public function getHardness(){ - return 0.5; - } + public function getHardness(){ + return 0.5; + } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ diff --git a/src/pocketmine/block/Solid.php b/src/pocketmine/block/Solid.php index 3a1eaf33a..381e8b03a 100644 --- a/src/pocketmine/block/Solid.php +++ b/src/pocketmine/block/Solid.php @@ -23,7 +23,7 @@ namespace pocketmine\block; abstract class Solid extends Block{ - public function isSolid(){ - return true; - } + public function isSolid(){ + return true; + } } \ No newline at end of file diff --git a/src/pocketmine/block/SoulSand.php b/src/pocketmine/block/SoulSand.php index eb41e2810..ae76b0f8a 100644 --- a/src/pocketmine/block/SoulSand.php +++ b/src/pocketmine/block/SoulSand.php @@ -26,19 +26,19 @@ use pocketmine\math\AxisAlignedBB; class SoulSand extends Solid{ - protected $id = self::SOUL_SAND; + protected $id = self::SOUL_SAND; public function __construct(){ } - public function getName(){ - return "Soul Sand"; - } + public function getName(){ + return "Soul Sand"; + } - public function getHardness(){ - return 2.5; - } + public function getHardness(){ + return 2.5; + } protected function recalculateBoundingBox(){ diff --git a/src/pocketmine/block/Sponge.php b/src/pocketmine/block/Sponge.php index 35e7a7a32..5c1d5afd6 100644 --- a/src/pocketmine/block/Sponge.php +++ b/src/pocketmine/block/Sponge.php @@ -24,18 +24,18 @@ namespace pocketmine\block; class Sponge extends Solid{ - protected $id = self::SPONGE; + protected $id = self::SPONGE; public function __construct(){ } - public function getHardness(){ - return 3; - } + public function getHardness(){ + return 3; + } - public function getName(){ - return "Sponge"; - } + public function getName(){ + return "Sponge"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/SpruceWoodStairs.php b/src/pocketmine/block/SpruceWoodStairs.php index 549e224f9..38c0cd8db 100644 --- a/src/pocketmine/block/SpruceWoodStairs.php +++ b/src/pocketmine/block/SpruceWoodStairs.php @@ -25,15 +25,15 @@ use pocketmine\item\Item; class SpruceWoodStairs extends Stair{ - protected $id = self::SPRUCE_WOOD_STAIRS; + protected $id = self::SPRUCE_WOOD_STAIRS; public function __construct($meta = 0){ $this->meta = $meta; } - public function getName(){ - return "Spruce Wood Stairs"; - } + public function getName(){ + return "Spruce Wood Stairs"; + } public function getDrops(Item $item){ return [ diff --git a/src/pocketmine/block/StainedClay.php b/src/pocketmine/block/StainedClay.php index 713b50050..773370f55 100644 --- a/src/pocketmine/block/StainedClay.php +++ b/src/pocketmine/block/StainedClay.php @@ -25,37 +25,37 @@ use pocketmine\item\Item; class StainedClay extends Solid{ - protected $id = self::STAINED_CLAY; + protected $id = self::STAINED_CLAY; 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 => "White Stained Clay", - 1 => "Orange Stained Clay", - 2 => "Magenta Stained Clay", - 3 => "Light Blue Stained Clay", - 4 => "Yellow Stained Clay", - 5 => "Lime Stained Clay", - 6 => "Pink Stained Clay", - 7 => "Gray Stained Clay", - 8 => "Light Gray Stained Clay", - 9 => "Cyan Stained Clay", - 10 => "Purple Stained Clay", - 11 => "Blue Stained Clay", - 12 => "Brown Stained Clay", - 13 => "Green Stained Clay", - 14 => "Red Stained Clay", - 15 => "Black Stained Clay", - ]; - return $names[$this->meta & 0x0f]; - } + public function getName(){ + static $names = [ + 0 => "White Stained Clay", + 1 => "Orange Stained Clay", + 2 => "Magenta Stained Clay", + 3 => "Light Blue Stained Clay", + 4 => "Yellow Stained Clay", + 5 => "Lime Stained Clay", + 6 => "Pink Stained Clay", + 7 => "Gray Stained Clay", + 8 => "Light Gray Stained Clay", + 9 => "Cyan Stained Clay", + 10 => "Purple Stained Clay", + 11 => "Blue Stained Clay", + 12 => "Brown Stained Clay", + 13 => "Green Stained Clay", + 14 => "Red Stained Clay", + 15 => "Black Stained Clay", + ]; + return $names[$this->meta & 0x0f]; + } public function getBreakTime(Item $item){ switch($item->isPickaxe()){ diff --git a/src/pocketmine/block/Stair.php b/src/pocketmine/block/Stair.php index fbf3fa9de..f29caff5a 100644 --- a/src/pocketmine/block/Stair.php +++ b/src/pocketmine/block/Stair.php @@ -27,9 +27,9 @@ use pocketmine\Player; abstract class Stair extends Transparent{ - public function getHardness(){ - return 30; - } + public function getHardness(){ + return 30; + } /* public function collidesWithBB(AxisAlignedBB $bb, &$list = []){ diff --git a/src/pocketmine/block/StillLava.php b/src/pocketmine/block/StillLava.php index 051062b2d..44ccd6b5f 100644 --- a/src/pocketmine/block/StillLava.php +++ b/src/pocketmine/block/StillLava.php @@ -23,14 +23,14 @@ namespace pocketmine\block; class StillLava extends Lava{ - protected $id = self::STILL_LAVA; + protected $id = self::STILL_LAVA; - public function getName(){ - return "Still Lava"; - } + public function getName(){ + return "Still Lava"; + } - public function getHardness(){ - return 500; - } + public function getHardness(){ + return 500; + } } \ No newline at end of file diff --git a/src/pocketmine/block/StillWater.php b/src/pocketmine/block/StillWater.php index aaf3a6db5..8c67f65a3 100644 --- a/src/pocketmine/block/StillWater.php +++ b/src/pocketmine/block/StillWater.php @@ -22,10 +22,10 @@ namespace pocketmine\block; class StillWater extends Water{ - - protected $id = self::STILL_WATER; - public function getName(){ - return "Still Water"; - } + protected $id = self::STILL_WATER; + + public function getName(){ + return "Still Water"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Stone.php b/src/pocketmine/block/Stone.php index dbc472082..06318de21 100644 --- a/src/pocketmine/block/Stone.php +++ b/src/pocketmine/block/Stone.php @@ -40,23 +40,23 @@ class Stone extends Solid{ } - public function getHardness(){ - return 30; - } + public function getHardness(){ + return 30; + } - public function getName(){ - static $names = [ - self::NORMAL => "Stone", - self::GRANITE => "Granite", - self::POLISHED_GRANITE => "Polished Granite", - self::DIORITE => "Diorite", - self::POLISHED_DIORITE => "Polished Diorite", - self::ANDESITE => "Andesite", - self::POLISHED_ANDESITE => "Polished Andesite", - 7 => "Unknown Stone", - ]; - return $names[$this->meta & 0x07]; - } + public function getName(){ + static $names = [ + self::NORMAL => "Stone", + self::GRANITE => "Granite", + self::POLISHED_GRANITE => "Polished Granite", + self::DIORITE => "Diorite", + self::POLISHED_DIORITE => "Polished Diorite", + self::ANDESITE => "Andesite", + self::POLISHED_ANDESITE => "Polished Andesite", + 7 => "Unknown Stone", + ]; + return $names[$this->meta & 0x07]; + } public function getBreakTime(Item $item){ switch($item->isPickaxe()){ diff --git a/src/pocketmine/block/StoneBrickStairs.php b/src/pocketmine/block/StoneBrickStairs.php index c94ac49b1..6f75bb69e 100644 --- a/src/pocketmine/block/StoneBrickStairs.php +++ b/src/pocketmine/block/StoneBrickStairs.php @@ -24,14 +24,14 @@ namespace pocketmine\block; class StoneBrickStairs extends Stair{ - protected $id = self::STONE_BRICK_STAIRS; + protected $id = self::STONE_BRICK_STAIRS; public function __construct($meta = 0){ - $this->meta = $meta; + $this->meta = $meta; } - public function getName(){ - return "Stone Brick Stairs"; - } + public function getName(){ + return "Stone Brick Stairs"; + } } \ No newline at end of file diff --git a/src/pocketmine/block/StoneBricks.php b/src/pocketmine/block/StoneBricks.php index 7821c15de..b5cc72d6c 100644 --- a/src/pocketmine/block/StoneBricks.php +++ b/src/pocketmine/block/StoneBricks.php @@ -25,25 +25,25 @@ use pocketmine\item\Item; class StoneBricks extends Solid{ - protected $id = self::STONE_BRICKS; + protected $id = self::STONE_BRICKS; 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 Bricks", - 1 => "Mossy Stone Bricks", - 2 => "Cracked Stone Bricks", - 3 => "Chiseled Stone Bricks", - ]; - return $names[$this->meta & 0x03]; - } + public function getName(){ + static $names = [ + 0 => "Stone Bricks", + 1 => "Mossy Stone Bricks", + 2 => "Cracked Stone Bricks", + 3 => "Chiseled Stone Bricks", + ]; + return $names[$this->meta & 0x03]; + } public function getBreakTime(Item $item){ diff --git a/src/pocketmine/block/StoneWall.php b/src/pocketmine/block/StoneWall.php index 51cdcd97e..648cafc1d 100644 --- a/src/pocketmine/block/StoneWall.php +++ b/src/pocketmine/block/StoneWall.php @@ -26,27 +26,27 @@ use pocketmine\math\AxisAlignedBB; class StoneWall extends Transparent{ - protected $id = self::STONE_WALL; + protected $id = self::STONE_WALL; public function __construct($meta = 0){ - $this->meta = $meta; + $this->meta = $meta; } - public function isSolid(){ - return false; - } + public function isSolid(){ + return false; + } - public function getHardness(){ - return 30; - } + public function getHardness(){ + return 30; + } - public function getName(){ - if($this->meta === 0x01){ - return "Mossy Cobblestone Wall"; - } + public function getName(){ + if($this->meta === 0x01){ + return "Mossy Cobblestone Wall"; + } - return "Cobblestone Wall"; - } + return "Cobblestone Wall"; + } protected function recalculateBoundingBox(){ @@ -55,7 +55,7 @@ class StoneWall extends Transparent{ $flag2 = $this->canConnect($this->getSide(4)); $flag3 = $this->canConnect($this->getSide(5)); - $f = $flag2 ? 0 : 0.25; + $f = $flag2 ? 0 : 0.25; $f1 = $flag3 ? 1 : 0.75; $f2 = $flag ? 0 : 0.25; $f3 = $flag1 ? 1 : 0.75; diff --git a/src/pocketmine/block/Stonecutter.php b/src/pocketmine/block/Stonecutter.php index 9b7a5f0d4..6a8d7985d 100644 --- a/src/pocketmine/block/Stonecutter.php +++ b/src/pocketmine/block/Stonecutter.php @@ -27,19 +27,19 @@ use pocketmine\Player; //TODO: check orientation class Stonecutter extends Solid{ - protected $id = self::STONECUTTER; + protected $id = self::STONECUTTER; public function __construct($meta = 0){ $this->meta = $meta; } - public function getName(){ - return "Stonecutter"; - } + public function getName(){ + return "Stonecutter"; + } - public function canBeActivated(){ - return true; - } + public function canBeActivated(){ + return true; + } public function onActivate(Item $item, Player $player = null){ if($player instanceof Player){ diff --git a/src/pocketmine/block/Sugarcane.php b/src/pocketmine/block/Sugarcane.php index f2ecdcfa6..a14b9e50d 100644 --- a/src/pocketmine/block/Sugarcane.php +++ b/src/pocketmine/block/Sugarcane.php @@ -30,15 +30,15 @@ use pocketmine\Server; class Sugarcane extends Flowable{ - protected $id = self::SUGARCANE_BLOCK; + protected $id = self::SUGARCANE_BLOCK; public function __construct($meta = 0){ $this->meta = $meta; } - public function getName(){ - return "Sugarcane"; - } + public function getName(){ + return "Sugarcane"; + } public function getDrops(Item $item){ diff --git a/src/pocketmine/block/TNT.php b/src/pocketmine/block/TNT.php index 052c9a6a1..7212a33d4 100644 --- a/src/pocketmine/block/TNT.php +++ b/src/pocketmine/block/TNT.php @@ -33,23 +33,23 @@ use pocketmine\utils\Random; class TNT extends Solid{ - protected $id = self::TNT; + protected $id = self::TNT; public function __construct(){ } - public function getName(){ - return "TNT"; - } + public function getName(){ + return "TNT"; + } - public function getHardness(){ - return 0; - } + public function getHardness(){ + return 0; + } - public function canBeActivated(){ - return true; - } + public function canBeActivated(){ + return true; + } public function onActivate(Item $item, Player $player = null){ if($item->getId() === Item::FLINT_STEEL){ diff --git a/src/pocketmine/block/TallGrass.php b/src/pocketmine/block/TallGrass.php index 9593d574a..faa483f80 100644 --- a/src/pocketmine/block/TallGrass.php +++ b/src/pocketmine/block/TallGrass.php @@ -26,25 +26,25 @@ use pocketmine\level\Level; class TallGrass extends Flowable{ - protected $id = self::TALL_GRASS; + protected $id = self::TALL_GRASS; public function __construct($meta = 1){ $this->meta = $meta; } - public function canBeReplaced(){ - return true; - } + public function canBeReplaced(){ + return true; + } public function getName(){ - static $names = [ - 0 => "Dead Shrub", - 1 => "Tall Grass", - 2 => "Fern", - 3 => "" - ]; - return $names[$this->meta & 0x03]; - } + static $names = [ + 0 => "Dead Shrub", + 1 => "Tall Grass", + 2 => "Fern", + 3 => "" + ]; + return $names[$this->meta & 0x03]; + } public function onUpdate($type){ diff --git a/src/pocketmine/block/Thin.php b/src/pocketmine/block/Thin.php index c756e5ad7..2031b3108 100644 --- a/src/pocketmine/block/Thin.php +++ b/src/pocketmine/block/Thin.php @@ -26,9 +26,9 @@ use pocketmine\math\AxisAlignedBB; abstract class Thin extends Transparent{ - public function isSolid(){ - return false; - } + public function isSolid(){ + return false; + } protected function recalculateBoundingBox(){ diff --git a/src/pocketmine/block/Torch.php b/src/pocketmine/block/Torch.php index 7e8e23b86..218e242aa 100644 --- a/src/pocketmine/block/Torch.php +++ b/src/pocketmine/block/Torch.php @@ -27,19 +27,19 @@ use pocketmine\Player; class Torch extends Flowable{ - protected $id = self::TORCH; + protected $id = self::TORCH; public function __construct($meta = 0){ $this->meta = $meta; } - public function getLightLevel(){ - return 15; - } + public function getLightLevel(){ + return 15; + } - public function getName(){ - return "Torch"; - } + public function getName(){ + return "Torch"; + } public function onUpdate($type){ @@ -55,7 +55,7 @@ class Torch extends Flowable{ 0 => 0, ]; - if($this->getSide($faces[$side])->isTransparent()=== true and !($side === 0 and $this->getSide(0)->getId() === self::FENCE)){ + if($this->getSide($faces[$side])->isTransparent() === true and !($side === 0 and $this->getSide(0)->getId() === self::FENCE)){ $this->getLevel()->useBreakOn($this); return Level::BLOCK_UPDATE_NORMAL; diff --git a/src/pocketmine/block/Transparent.php b/src/pocketmine/block/Transparent.php index 10571c47b..9e0b24674 100644 --- a/src/pocketmine/block/Transparent.php +++ b/src/pocketmine/block/Transparent.php @@ -22,10 +22,9 @@ namespace pocketmine\block; - abstract class Transparent extends Block{ - public function isTransparent(){ - return true; - } + public function isTransparent(){ + return true; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Trapdoor.php b/src/pocketmine/block/Trapdoor.php index 688303b2a..446d834b9 100644 --- a/src/pocketmine/block/Trapdoor.php +++ b/src/pocketmine/block/Trapdoor.php @@ -27,23 +27,23 @@ use pocketmine\Player; class Trapdoor extends Transparent{ - protected $id = self::TRAPDOOR; + protected $id = self::TRAPDOOR; public function __construct($meta = 0){ - $this->meta = $meta; + $this->meta = $meta; } - public function getName(){ - return "Trapdoor"; - } + public function getName(){ + return "Trapdoor"; + } - public function getHardness(){ - return 15; - } + public function getHardness(){ + return 15; + } - public function canBeActivated(){ - return true; - } + public function canBeActivated(){ + return true; + } protected function recalculateBoundingBox(){ @@ -90,7 +90,8 @@ class Trapdoor extends Transparent{ $this->y + 1, $this->z + $f ); - }if(($damage & 0x03) === 2){ + } + if(($damage & 0x03) === 2){ $bb->setBounds( $this->x + 1 - $f, $this->y, @@ -99,7 +100,8 @@ class Trapdoor extends Transparent{ $this->y + 1, $this->z + 1 ); - }if(($damage & 0x03) === 3){ + } + if(($damage & 0x03) === 3){ $bb->setBounds( $this->x, $this->y, diff --git a/src/pocketmine/block/Vine.php b/src/pocketmine/block/Vine.php index 5eb97c3bd..40d2a092b 100644 --- a/src/pocketmine/block/Vine.php +++ b/src/pocketmine/block/Vine.php @@ -36,21 +36,21 @@ class Vine extends Transparent{ $this->meta = $meta; } - public function isSolid(){ - return false; - } + public function isSolid(){ + return false; + } - public function getName(){ - return "Vines"; - } + public function getName(){ + return "Vines"; + } - public function getHardness(){ - return 1; - } + public function getHardness(){ + return 1; + } - public function hasEntityCollision(){ - return true; - } + public function hasEntityCollision(){ + return true; + } public function onEntityCollide(Entity $entity){ $entity->fallDistance = 0; diff --git a/src/pocketmine/block/WallSign.php b/src/pocketmine/block/WallSign.php index 2e04b1ac1..1a09123fa 100644 --- a/src/pocketmine/block/WallSign.php +++ b/src/pocketmine/block/WallSign.php @@ -24,11 +24,11 @@ namespace pocketmine\block; class WallSign extends SignPost{ - protected $id = self::WALL_SIGN; + protected $id = self::WALL_SIGN; - public function getName(){ - return "Wall Sign"; - } + public function getName(){ + return "Wall Sign"; + } public function onUpdate($type){ return false; diff --git a/src/pocketmine/block/Water.php b/src/pocketmine/block/Water.php index 49f36375d..8cd69e5dd 100644 --- a/src/pocketmine/block/Water.php +++ b/src/pocketmine/block/Water.php @@ -27,20 +27,20 @@ use pocketmine\Player; class Water extends Liquid{ - protected $id = self::WATER; + protected $id = self::WATER; public function __construct($meta = 0){ $this->meta = $meta; } - public function getName(){ - return "Water"; - } + public function getName(){ + return "Water"; + } + + public function getHardness(){ + return 500; + } - public function getHardness(){ - return 500; - } - public function onEntityCollide(Entity $entity){ $entity->fallDistance = 0; if($entity->fireTicks > 0){ diff --git a/src/pocketmine/block/Wheat.php b/src/pocketmine/block/Wheat.php index 35a9b5897..31dbd1e91 100644 --- a/src/pocketmine/block/Wheat.php +++ b/src/pocketmine/block/Wheat.php @@ -25,15 +25,15 @@ use pocketmine\item\Item; class Wheat extends Crops{ - protected $id = self::WHEAT_BLOCK; + protected $id = self::WHEAT_BLOCK; public function __construct($meta = 0){ $this->meta = $meta; } - public function getName(){ - return "Wheat Block"; - } + public function getName(){ + return "Wheat Block"; + } public function getDrops(Item $item){ $drops = []; diff --git a/src/pocketmine/block/Wood.php b/src/pocketmine/block/Wood.php index 0bd8e0489..b10617d91 100644 --- a/src/pocketmine/block/Wood.php +++ b/src/pocketmine/block/Wood.php @@ -32,25 +32,25 @@ class Wood extends Solid{ //const ACACIA = 4; //const DARK_OAK = 5; - protected $id = self::WOOD; + protected $id = self::WOOD; public function __construct($meta = 0){ $this->meta = $meta; } - public function getHardness(){ - return 10; - } + public function getHardness(){ + return 10; + } - public function getName(){ - static $names = [ - self::OAK => "Oak Wood", - self::SPRUCE => "Spruce Wood", - self::BIRCH => "Birch Wood", - self::JUNGLE => "Jungle Wood", - ]; - return $names[$this->meta & 0x03]; - } + public function getName(){ + static $names = [ + self::OAK => "Oak Wood", + self::SPRUCE => "Spruce Wood", + self::BIRCH => "Birch Wood", + self::JUNGLE => "Jungle Wood", + ]; + return $names[$this->meta & 0x03]; + } public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){ $faces = [ diff --git a/src/pocketmine/block/Wood2.php b/src/pocketmine/block/Wood2.php index 8aec3a2fa..52fb2569c 100644 --- a/src/pocketmine/block/Wood2.php +++ b/src/pocketmine/block/Wood2.php @@ -23,18 +23,18 @@ namespace pocketmine\block; class Wood2 extends Wood{ - + const ACACIA = 0; const DARK_OAK = 1; - protected $id = self::WOOD2; + protected $id = self::WOOD2; public function getName(){ - static $names = [ - 0 => "Acacia Wood", - 1 => "Dark Oak Wood", - 2 => "" - ]; - return $names[$this->meta & 0x03]; - } + static $names = [ + 0 => "Acacia Wood", + 1 => "Dark Oak Wood", + 2 => "" + ]; + return $names[$this->meta & 0x03]; + } } diff --git a/src/pocketmine/block/WoodDoor.php b/src/pocketmine/block/WoodDoor.php index e5debe0b2..292eed622 100644 --- a/src/pocketmine/block/WoodDoor.php +++ b/src/pocketmine/block/WoodDoor.php @@ -25,23 +25,23 @@ use pocketmine\item\Item; class WoodDoor extends Door{ - protected $id = self::WOOD_DOOR_BLOCK; + protected $id = self::WOOD_DOOR_BLOCK; public function __construct($meta = 0){ $this->meta = $meta; } - public function getName(){ - return "Wood Door Block"; - } + public function getName(){ + return "Wood Door Block"; + } - public function canBeActivated(){ - return true; - } + public function canBeActivated(){ + return true; + } - public function getHardness(){ - return 15; - } + public function getHardness(){ + return 15; + } public function getDrops(Item $item){ return [ diff --git a/src/pocketmine/block/WoodSlab.php b/src/pocketmine/block/WoodSlab.php index 0f3fd39c1..57d051ee6 100644 --- a/src/pocketmine/block/WoodSlab.php +++ b/src/pocketmine/block/WoodSlab.php @@ -27,29 +27,29 @@ use pocketmine\Player; class WoodSlab extends Transparent{ - protected $id = self::WOOD_SLAB; + protected $id = self::WOOD_SLAB; public function __construct($meta = 0){ $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 (($this->meta & 0x08) === 0x08 ? "Upper " : "") . $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 (($this->meta & 0x08) === 0x08 ? "Upper " : "") . $names[$this->meta & 0x07] . " Wooden Slab"; + } protected function recalculateBoundingBox(){ @@ -113,7 +113,7 @@ class WoodSlab extends Transparent{ } } } - + if($block->getId() === self::WOOD_SLAB and ($target->getDamage() & 0x07) !== ($this->meta & 0x07)){ return false; } diff --git a/src/pocketmine/block/WoodStairs.php b/src/pocketmine/block/WoodStairs.php index 7826c4cb9..e641e9bdb 100644 --- a/src/pocketmine/block/WoodStairs.php +++ b/src/pocketmine/block/WoodStairs.php @@ -25,15 +25,15 @@ use pocketmine\item\Item; class WoodStairs extends Stair{ - protected $id = self::WOOD_STAIRS; + protected $id = self::WOOD_STAIRS; public function __construct($meta = 0){ - $this->meta = $meta; + $this->meta = $meta; } - public function getName(){ - return "Wood Stairs"; - } + public function getName(){ + return "Wood Stairs"; + } public function getBreakTime(Item $item){ diff --git a/src/pocketmine/block/Wool.php b/src/pocketmine/block/Wool.php index ee07f1f51..3a90247cc 100644 --- a/src/pocketmine/block/Wool.php +++ b/src/pocketmine/block/Wool.php @@ -24,36 +24,36 @@ namespace pocketmine\block; class Wool extends Solid{ - protected $id = self::WOOL; + protected $id = self::WOOL; public function __construct($meta = 0){ - $this->meta = $meta; + $this->meta = $meta; } - public function getHardness(){ - return 4; - } + public function getHardness(){ + return 4; + } - public function getName(){ - static $names = [ - 0 => "White Wool", - 1 => "Orange Wool", - 2 => "Magenta Wool", - 3 => "Light Blue Wool", - 4 => "Yellow Wool", - 5 => "Lime Wool", - 6 => "Pink Wool", - 7 => "Gray Wool", - 8 => "Light Gray Wool", - 9 => "Cyan Wool", - 10 => "Purple Wool", - 11 => "Blue Wool", - 12 => "Brown Wool", - 13 => "Green Wool", - 14 => "Red Wool", - 15 => "Black Wool", - ]; - return $names[$this->meta & 0x0f]; - } + public function getName(){ + static $names = [ + 0 => "White Wool", + 1 => "Orange Wool", + 2 => "Magenta Wool", + 3 => "Light Blue Wool", + 4 => "Yellow Wool", + 5 => "Lime Wool", + 6 => "Pink Wool", + 7 => "Gray Wool", + 8 => "Light Gray Wool", + 9 => "Cyan Wool", + 10 => "Purple Wool", + 11 => "Blue Wool", + 12 => "Brown Wool", + 13 => "Green Wool", + 14 => "Red Wool", + 15 => "Black Wool", + ]; + return $names[$this->meta & 0x0f]; + } } \ No newline at end of file diff --git a/src/pocketmine/block/Workbench.php b/src/pocketmine/block/Workbench.php index 75bf45d59..13e409d1e 100644 --- a/src/pocketmine/block/Workbench.php +++ b/src/pocketmine/block/Workbench.php @@ -27,23 +27,23 @@ use pocketmine\Player; //TODO: check orientation class Workbench extends Solid{ - protected $id = self::WORKBENCH; + protected $id = self::WORKBENCH; public function __construct($meta = 0){ $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 "Crafting Table"; - } + public function getName(){ + return "Crafting Table"; + } public function onActivate(Item $item, Player $player = null){ if($player instanceof Player){ diff --git a/src/pocketmine/command/CommandReader.php b/src/pocketmine/command/CommandReader.php index 6978b7e26..97e9f39f2 100644 --- a/src/pocketmine/command/CommandReader.php +++ b/src/pocketmine/command/CommandReader.php @@ -35,7 +35,7 @@ class CommandReader extends Thread{ /** * @param \Threaded $threaded - * @param string $stream + * @param string $stream */ public function __construct(\Threaded $threaded, $stream = "php://stdin"){ $this->stream = $stream; @@ -91,7 +91,7 @@ class CommandReader extends Thread{ usleep(40000); } - $lastLine = microtime(true); + $lastLine = microtime(true); } } } \ No newline at end of file diff --git a/src/pocketmine/command/SimpleCommandMap.php b/src/pocketmine/command/SimpleCommandMap.php index 9e47e6b4d..841de3881 100644 --- a/src/pocketmine/command/SimpleCommandMap.php +++ b/src/pocketmine/command/SimpleCommandMap.php @@ -182,7 +182,7 @@ class SimpleCommandMap implements CommandMap{ try{ $target->execute($sender, $sentCommandLabel, $args); }catch(\Exception $e){ - $this->server->getLogger()->critical("Unhandled exception executing command '". $commandLine ."' in ". $target.": ".$e->getMessage()); + $this->server->getLogger()->critical("Unhandled exception executing command '" . $commandLine . "' in " . $target . ": " . $e->getMessage()); if(($logger = $sender->getServer()->getLogger()) instanceof MainLogger){ $logger->logException($e); } diff --git a/src/pocketmine/command/defaults/TimeCommand.php b/src/pocketmine/command/defaults/TimeCommand.php index c49fdec5c..ee31afa3f 100644 --- a/src/pocketmine/command/defaults/TimeCommand.php +++ b/src/pocketmine/command/defaults/TimeCommand.php @@ -113,7 +113,7 @@ class TimeCommand extends VanillaCommand{ $level->setTime($level->getTime() + $value); $level->checkTime(); } - Command::broadcastCommandMessage($sender, "Added " . $value ." to time"); + Command::broadcastCommandMessage($sender, "Added " . $value . " to time"); }else{ $sender->sendMessage(TextFormat::RED . "Usage: " . $this->usageMessage); } diff --git a/src/pocketmine/command/defaults/TimingsCommand.php b/src/pocketmine/command/defaults/TimingsCommand.php index 974830a55..8bab24b82 100644 --- a/src/pocketmine/command/defaults/TimingsCommand.php +++ b/src/pocketmine/command/defaults/TimingsCommand.php @@ -119,8 +119,8 @@ class TimingsCommand extends VanillaCommand{ } - $sender->sendMessage("Timings uploaded to http://paste.ubuntu.com/".$matches[1]."/"); - $sender->sendMessage("You can read the results at http://timings.aikar.co/?url=".$matches[1]); + $sender->sendMessage("Timings uploaded to http://paste.ubuntu.com/" . $matches[1] . "/"); + $sender->sendMessage("You can read the results at http://timings.aikar.co/?url=" . $matches[1]); fclose($fileTimings); }else{ fclose($fileTimings); diff --git a/src/pocketmine/command/defaults/VersionCommand.php b/src/pocketmine/command/defaults/VersionCommand.php index dbdcef23e..9784478b3 100644 --- a/src/pocketmine/command/defaults/VersionCommand.php +++ b/src/pocketmine/command/defaults/VersionCommand.php @@ -44,7 +44,7 @@ class VersionCommand extends VanillaCommand{ } if(count($args) === 0){ - $output = "This server is running ". $sender->getServer()->getName() . " version " . $sender->getServer()->getPocketMineVersion() . " 「" . $sender->getServer()->getCodename() . "」 (Implementing API version " . $sender->getServer()->getApiVersion() . " for Minecraft: PE " . $sender->getServer()->getVersion() . " protocol version " . Info::CURRENT_PROTOCOL . ")"; + $output = "This server is running " . $sender->getServer()->getName() . " version " . $sender->getServer()->getPocketMineVersion() . " 「" . $sender->getServer()->getCodename() . "」 (Implementing API version " . $sender->getServer()->getApiVersion() . " for Minecraft: PE " . $sender->getServer()->getVersion() . " protocol version " . Info::CURRENT_PROTOCOL . ")"; if(\pocketmine\GIT_COMMIT !== str_repeat("00", 20)){ $output .= " [git " . \pocketmine\GIT_COMMIT . "]"; } diff --git a/src/pocketmine/entity/FallingSand.php b/src/pocketmine/entity/FallingSand.php index 262fe83c6..5c870d110 100644 --- a/src/pocketmine/entity/FallingSand.php +++ b/src/pocketmine/entity/FallingSand.php @@ -131,6 +131,7 @@ class FallingSand extends Entity{ public function getBlock(){ return $this->blockId; } + public function getDamage(){ return $this->damage; } diff --git a/src/pocketmine/entity/Projectile.php b/src/pocketmine/entity/Projectile.php index f724bb598..c155f7b73 100644 --- a/src/pocketmine/entity/Projectile.php +++ b/src/pocketmine/entity/Projectile.php @@ -82,7 +82,6 @@ abstract class Projectile extends Entity{ } - $tickDiff = max(1, $currentTick - $this->lastUpdate); $this->lastUpdate = $currentTick; diff --git a/src/pocketmine/event/TimingsHandler.php b/src/pocketmine/event/TimingsHandler.php index 808eac0c0..bc41a507d 100644 --- a/src/pocketmine/event/TimingsHandler.php +++ b/src/pocketmine/event/TimingsHandler.php @@ -71,7 +71,7 @@ class TimingsHandler{ } fwrite($fp, "# Version " . Server::getInstance()->getVersion() . PHP_EOL); - fwrite($fp, "# ". Server::getInstance()->getName() . " " . Server::getInstance()->getPocketMineVersion() . PHP_EOL); + fwrite($fp, "# " . Server::getInstance()->getName() . " " . Server::getInstance()->getPocketMineVersion() . PHP_EOL); $entities = 0; $livingEntities = 0; diff --git a/src/pocketmine/event/entity/EntityCombustByBlockEvent.php b/src/pocketmine/event/entity/EntityCombustByBlockEvent.php index dbf33e4d6..e1488df47 100644 --- a/src/pocketmine/event/entity/EntityCombustByBlockEvent.php +++ b/src/pocketmine/event/entity/EntityCombustByBlockEvent.php @@ -31,7 +31,7 @@ class EntityCombustByBlockEvent extends EntityCombustEvent{ protected $combuster; /** - * @param Block $combuster + * @param Block $combuster * @param Entity $combustee * @param int $duration */ diff --git a/src/pocketmine/event/entity/EntityDamageByBlockEvent.php b/src/pocketmine/event/entity/EntityDamageByBlockEvent.php index 2ceb3bffd..ad0060397 100644 --- a/src/pocketmine/event/entity/EntityDamageByBlockEvent.php +++ b/src/pocketmine/event/entity/EntityDamageByBlockEvent.php @@ -33,7 +33,7 @@ class EntityDamageByBlockEvent extends EntityDamageEvent{ /** - * @param Block $damager + * @param Block $damager * @param Entity $entity * @param int $cause * @param int|int[] $damage diff --git a/src/pocketmine/event/entity/EntityShootBowEvent.php b/src/pocketmine/event/entity/EntityShootBowEvent.php index 5fc92b015..324b92880 100644 --- a/src/pocketmine/event/entity/EntityShootBowEvent.php +++ b/src/pocketmine/event/entity/EntityShootBowEvent.php @@ -41,7 +41,7 @@ class EntityShootBowEvent extends EntityEvent implements Cancellable{ /** * @param Living $shooter - * @param Item $bow + * @param Item $bow * @param Projectile $projectile * @param float $force */ diff --git a/src/pocketmine/event/entity/ExplosionPrimeEvent.php b/src/pocketmine/event/entity/ExplosionPrimeEvent.php index 66944c053..b05ce1991 100644 --- a/src/pocketmine/event/entity/ExplosionPrimeEvent.php +++ b/src/pocketmine/event/entity/ExplosionPrimeEvent.php @@ -37,7 +37,7 @@ class ExplosionPrimeEvent extends EntityEvent implements Cancellable{ /** * @param Entity $entity - * @param float $force + * @param float $force */ public function __construct(Entity $entity, $force){ $this->entity = $entity; diff --git a/src/pocketmine/event/server/QueryRegenerateEvent.php b/src/pocketmine/event/server/QueryRegenerateEvent.php index 810b8ba61..3ad1367b3 100644 --- a/src/pocketmine/event/server/QueryRegenerateEvent.php +++ b/src/pocketmine/event/server/QueryRegenerateEvent.php @@ -67,7 +67,7 @@ class QueryRegenerateEvent extends ServerEvent{ $this->gametype = ($server->getGamemode() & 0x01) === 0 ? "SMP" : "CMP"; $this->version = $server->getVersion(); - $this->server_engine = $server->getName() ." ". $server->getPocketMineVersion(); + $this->server_engine = $server->getName() . " " . $server->getPocketMineVersion(); $this->map = $server->getDefaultLevel() === null ? "unknown" : $server->getDefaultLevel()->getName(); $this->numPlayers = count($this->players); $this->maxPlayers = $server->getMaxPlayers(); diff --git a/src/pocketmine/inventory/PlayerInventory.php b/src/pocketmine/inventory/PlayerInventory.php index 27683a8ee..9613e12fc 100644 --- a/src/pocketmine/inventory/PlayerInventory.php +++ b/src/pocketmine/inventory/PlayerInventory.php @@ -88,7 +88,7 @@ class PlayerInventory extends BaseInventory{ /** * @param Item $item - * @param $source + * @param $source * * @return bool */ @@ -104,14 +104,14 @@ class PlayerInventory extends BaseInventory{ if($slot >= -1 and $slot < $this->getSize()){ $item = $this->getItem($slot); - $itemIndex = $this->getHeldItemIndex(); + $itemIndex = $this->getHeldItemIndex(); - for($i = 0; $i < $this->getHotbarSize(); ++$i){ - if($this->getHotbarSlotIndex($i) === $slot){ - $itemIndex = $i; - break; - } - } + for($i = 0; $i < $this->getHotbarSize(); ++$i){ + if($this->getHotbarSlotIndex($i) === $slot){ + $itemIndex = $i; + break; + } + } if($this->getHolder() instanceof Player){ Server::getInstance()->getPluginManager()->callEvent($ev = new PlayerItemHeldEvent($this->getHolder(), $item, $slot, $itemIndex)); @@ -122,7 +122,7 @@ class PlayerInventory extends BaseInventory{ } $this->setHotbarSlotIndex($itemIndex, $slot); - $this->setHeldItemIndex($itemIndex); + $this->setHeldItemIndex($itemIndex); } } @@ -364,7 +364,6 @@ class PlayerInventory extends BaseInventory{ } - /** * @param int $index * @param Player|Player[] $target diff --git a/src/pocketmine/item/Armor.php b/src/pocketmine/item/Armor.php index b368837f5..2ca374c04 100644 --- a/src/pocketmine/item/Armor.php +++ b/src/pocketmine/item/Armor.php @@ -27,7 +27,7 @@ use pocketmine\entity\Entity; abstract class Armor extends Item{ - public function getMaxStackSize(){ - return 1; - } + public function getMaxStackSize(){ + return 1; + } } \ No newline at end of file diff --git a/src/pocketmine/item/Bed.php b/src/pocketmine/item/Bed.php index 9ad66d2f2..8d850fd82 100644 --- a/src/pocketmine/item/Bed.php +++ b/src/pocketmine/item/Bed.php @@ -29,7 +29,7 @@ class Bed extends Item{ parent::__construct(self::BED, 0, $count, "Bed"); } - public function getMaxStackSize(){ - return 1; - } + public function getMaxStackSize(){ + return 1; + } } \ No newline at end of file diff --git a/src/pocketmine/item/BeetrootSoup.php b/src/pocketmine/item/BeetrootSoup.php index 217b76e09..8a7a2425c 100644 --- a/src/pocketmine/item/BeetrootSoup.php +++ b/src/pocketmine/item/BeetrootSoup.php @@ -27,7 +27,7 @@ class BeetrootSoup extends Item{ parent::__construct(self::BEETROOT_SOUP, 0, $count, "Beetroot Soup"); } - public function getMaxStackSize(){ - return 1; - } + public function getMaxStackSize(){ + return 1; + } } \ No newline at end of file diff --git a/src/pocketmine/item/Bucket.php b/src/pocketmine/item/Bucket.php index 855bf713b..2d4e48203 100644 --- a/src/pocketmine/item/Bucket.php +++ b/src/pocketmine/item/Bucket.php @@ -33,13 +33,13 @@ class Bucket extends Item{ parent::__construct(self::BUCKET, $meta, $count, "Bucket"); } - public function getMaxStackSize(){ - return 1; - } + public function getMaxStackSize(){ + return 1; + } - public function canBeActivated(){ - return true; - } + public function canBeActivated(){ + return true; + } public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $targetBlock = Block::get($this->meta); diff --git a/src/pocketmine/item/Cake.php b/src/pocketmine/item/Cake.php index 3001c137b..f01baf5f6 100644 --- a/src/pocketmine/item/Cake.php +++ b/src/pocketmine/item/Cake.php @@ -29,7 +29,7 @@ class Cake extends Item{ parent::__construct(self::CAKE, 0, $count, "Cake"); } - public function getMaxStackSize(){ - return 1; - } + public function getMaxStackSize(){ + return 1; + } } \ No newline at end of file diff --git a/src/pocketmine/item/FlintSteel.php b/src/pocketmine/item/FlintSteel.php index 94f9a18a7..f512b1de8 100644 --- a/src/pocketmine/item/FlintSteel.php +++ b/src/pocketmine/item/FlintSteel.php @@ -32,9 +32,9 @@ class FlintSteel extends Tool{ parent::__construct(self::FLINT_STEEL, $meta, $count, "Flint and Steel"); } - public function canBeActivated(){ - return true; - } + public function canBeActivated(){ + return true; + } public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ if(($player->gamemode & 0x01) === 0 and $this->useOn($block) and $this->getDamage() >= $this->getMaxDurability()){ diff --git a/src/pocketmine/item/IronDoor.php b/src/pocketmine/item/IronDoor.php index 32a3f21f1..93402378e 100644 --- a/src/pocketmine/item/IronDoor.php +++ b/src/pocketmine/item/IronDoor.php @@ -29,7 +29,7 @@ class IronDoor extends Item{ parent::__construct(self::IRON_DOOR, 0, $count, "Iron Door"); } - public function getMaxStackSize(){ - return 1; - } + public function getMaxStackSize(){ + return 1; + } } \ No newline at end of file diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index fee49f924..4a47d6d6f 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -399,9 +399,9 @@ class Item{ protected $durability = 0; protected $name; - public function canBeActivated(){ - return false; - } + public function canBeActivated(){ + return false; + } public static function init(){ if(self::$list === null){ @@ -427,7 +427,7 @@ class Item{ self::$list[self::SPAWN_EGG] = SpawnEgg::class; self::$list[self::DIAMOND] = Diamond::class; self::$list[self::STICK] = Stick::class; - self::$list[self::SNOWBALL] = Snowball::class; + self::$list[self::SNOWBALL] = Snowball::class; self::$list[self::BOWL] = Bowl::class; self::$list[self::FEATHER] = Feather::class; self::$list[self::BRICK] = Brick::class; @@ -644,7 +644,7 @@ class Item{ } final public function __toString(){ - return "Item " . $this->name . " (" . $this->id . ":" . ($this->meta === null ? "?" : $this->meta) . ")x".$this->count; + return "Item " . $this->name . " (" . $this->id . ":" . ($this->meta === null ? "?" : $this->meta) . ")x" . $this->count; } public function getDestroySpeed(Block $block, Player $player){ diff --git a/src/pocketmine/item/MushroomStew.php b/src/pocketmine/item/MushroomStew.php index 96813a44a..172852c65 100644 --- a/src/pocketmine/item/MushroomStew.php +++ b/src/pocketmine/item/MushroomStew.php @@ -27,7 +27,7 @@ class MushroomStew extends Item{ parent::__construct(self::MUSHROOM_STEW, 0, $count, "Mushroom Stew"); } - public function getMaxStackSize(){ - return 1; - } + public function getMaxStackSize(){ + return 1; + } } \ No newline at end of file diff --git a/src/pocketmine/item/Painting.php b/src/pocketmine/item/Painting.php index 21325adb9..7db11e6ab 100644 --- a/src/pocketmine/item/Painting.php +++ b/src/pocketmine/item/Painting.php @@ -31,9 +31,9 @@ class Painting extends Item{ parent::__construct(self::PAINTING, 0, $count, "Painting"); } - public function canBeActivated(){ - return true; - } + public function canBeActivated(){ + return true; + } public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ if($target->isTransparent() === false and $face > 1 and $block->isSolid() === false){ diff --git a/src/pocketmine/item/Sign.php b/src/pocketmine/item/Sign.php index 5c3cd393c..c521d9a96 100644 --- a/src/pocketmine/item/Sign.php +++ b/src/pocketmine/item/Sign.php @@ -29,7 +29,7 @@ class Sign extends Item{ parent::__construct(self::SIGN, 0, $count, "Sign"); } - public function getMaxStackSize(){ - return 16; - } + public function getMaxStackSize(){ + return 16; + } } \ No newline at end of file diff --git a/src/pocketmine/item/Snowball.php b/src/pocketmine/item/Snowball.php index 4c5ff7986..49de71a66 100644 --- a/src/pocketmine/item/Snowball.php +++ b/src/pocketmine/item/Snowball.php @@ -27,8 +27,8 @@ class Snowball extends Item{ parent::__construct(self::SNOWBALL, 0, $count, "Snowball"); } - public function getMaxStackSize(){ - return 16; - } + public function getMaxStackSize(){ + return 16; + } } \ No newline at end of file diff --git a/src/pocketmine/item/SpawnEgg.php b/src/pocketmine/item/SpawnEgg.php index 622be0580..1eb85b531 100644 --- a/src/pocketmine/item/SpawnEgg.php +++ b/src/pocketmine/item/SpawnEgg.php @@ -36,9 +36,9 @@ class SpawnEgg extends Item{ parent::__construct(self::SPAWN_EGG, $meta, $count, "Spawn Egg"); } - public function canBeActivated(){ - return true; - } + public function canBeActivated(){ + return true; + } public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $entity = null; @@ -50,19 +50,19 @@ class SpawnEgg extends Item{ $nbt = new Compound("", [ "Pos" => new Enum("Pos", [ - new Double("", $block->getX() + 0.5), - new Double("", $block->getY()), - new Double("", $block->getZ() + 0.5) - ]), + new Double("", $block->getX() + 0.5), + new Double("", $block->getY()), + new Double("", $block->getZ() + 0.5) + ]), "Motion" => new Enum("Motion", [ - new Double("", 0), - new Double("", 0), - new Double("", 0) - ]), + new Double("", 0), + new Double("", 0), + new Double("", 0) + ]), "Rotation" => new Enum("Rotation", [ - new Float("", lcg_value() * 360), - new Float("", 0) - ]), + new Float("", lcg_value() * 360), + new Float("", 0) + ]), ]); $entity = Entity::createEntity($this->meta, $chunk, $nbt); diff --git a/src/pocketmine/item/Tool.php b/src/pocketmine/item/Tool.php index 140cc2c38..a67182e99 100644 --- a/src/pocketmine/item/Tool.php +++ b/src/pocketmine/item/Tool.php @@ -36,9 +36,9 @@ abstract class Tool extends Item{ parent::__construct($id, $meta, $count, $name); } - public function getMaxStackSize(){ - return 1; - } + public function getMaxStackSize(){ + return 1; + } /** * TODO: Move this to each item diff --git a/src/pocketmine/item/WoodenDoor.php b/src/pocketmine/item/WoodenDoor.php index 678d8328f..50423bbf0 100644 --- a/src/pocketmine/item/WoodenDoor.php +++ b/src/pocketmine/item/WoodenDoor.php @@ -29,7 +29,7 @@ class WoodenDoor extends Item{ parent::__construct(self::WOODEN_DOOR, 0, $count, "Wooden Door"); } - public function getMaxStackSize(){ - return 1; - } + public function getMaxStackSize(){ + return 1; + } } \ No newline at end of file diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index dad6c164c..eb7f25b06 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -1108,26 +1108,26 @@ class Level implements ChunkManager, Metadatable{ if($item->getId() > 0 and $item->getCount() > 0){ $itemEntity = Entity::createEntity("Item", $this->getChunk($source->getX() >> 4, $source->getZ() >> 4), new Compound("", [ "Pos" => new Enum("Pos", [ - new Double("", $source->getX()), - new Double("", $source->getY()), - new Double("", $source->getZ()) - ]), + new Double("", $source->getX()), + new Double("", $source->getY()), + new Double("", $source->getZ()) + ]), "Motion" => new Enum("Motion", [ - new Double("", $motion->x), - new Double("", $motion->y), - new Double("", $motion->z) - ]), + new Double("", $motion->x), + new Double("", $motion->y), + new Double("", $motion->z) + ]), "Rotation" => new Enum("Rotation", [ - new Float("", lcg_value() * 360), - new Float("", 0) - ]), + new Float("", lcg_value() * 360), + new Float("", 0) + ]), "Health" => new Short("Health", 5), "Item" => new Compound("Item", [ - "id" => new Short("id", $item->getId()), - "Damage" => new Short("Damage", $item->getDamage()), - "Count" => new Byte("Count", $item->getCount()) - ]), + "id" => new Short("id", $item->getId()), + "Damage" => new Short("Damage", $item->getDamage()), + "Count" => new Byte("Count", $item->getCount()) + ]), "PickupDelay" => new Short("PickupDelay", $delay) ])); @@ -1709,7 +1709,7 @@ class Level implements ChunkManager, Metadatable{ $this->chunks[$index] = $chunk; } if(ADVANCED_CACHE == true){ - Cache::remove("world:" . $this->getId() . ":". Level::chunkHash($x, $z)); + Cache::remove("world:" . $this->getId() . ":" . Level::chunkHash($x, $z)); } $chunk->setChanged(); } @@ -1820,7 +1820,7 @@ class Level implements ChunkManager, Metadatable{ $this->timings->syncChunkSendPrepareTimer->stopTiming(); } } - + $this->timings->syncChunkSendTimer->stopTiming(); } } @@ -1995,9 +1995,9 @@ class Level implements ChunkManager, Metadatable{ $this->provider->saveChunk($x, $z); } $this->provider->unloadChunk($x, $z, $safe); - }catch (\Exception $e){ + }catch(\Exception $e){ $logger = $this->server->getLogger(); - $logger->error("Error when unloading a chunk: ".$e->getMessage()); + $logger->error("Error when unloading a chunk: " . $e->getMessage()); if($logger instanceof MainLogger){ $logger->logException($e); } diff --git a/src/pocketmine/level/Position.php b/src/pocketmine/level/Position.php index d94693f43..98ee2420a 100644 --- a/src/pocketmine/level/Position.php +++ b/src/pocketmine/level/Position.php @@ -25,7 +25,7 @@ use pocketmine\math\Vector3; use pocketmine\utils\LevelException; class Position extends Vector3{ - + /** @var Level */ public $level = null; diff --git a/src/pocketmine/level/format/anvil/Chunk.php b/src/pocketmine/level/format/anvil/Chunk.php index 8aef60f1d..0a01b2b26 100644 --- a/src/pocketmine/level/format/anvil/Chunk.php +++ b/src/pocketmine/level/format/anvil/Chunk.php @@ -133,7 +133,7 @@ class Chunk extends BaseChunk{ */ public static function fromBinary($data, LevelProvider $provider = null){ $nbt = new NBT(NBT::BIG_ENDIAN); - + try{ $nbt->readCompressed($data, ZLIB_ENCODING_DEFLATE); $chunk = $nbt->getData(); @@ -143,7 +143,7 @@ class Chunk extends BaseChunk{ } return new Chunk($provider instanceof LevelProvider ? $provider : Anvil::class, $chunk->Level); - }catch (\Exception $e){ + }catch(\Exception $e){ return null; } } diff --git a/src/pocketmine/level/format/mcregion/Chunk.php b/src/pocketmine/level/format/mcregion/Chunk.php index 7205dd428..3ef5d23c7 100644 --- a/src/pocketmine/level/format/mcregion/Chunk.php +++ b/src/pocketmine/level/format/mcregion/Chunk.php @@ -265,7 +265,7 @@ class Chunk extends BaseFullChunk{ } return new Chunk($provider instanceof LevelProvider ? $provider : McRegion::class, $chunk->Level); - }catch (\Exception $e){ + }catch(\Exception $e){ return null; } } diff --git a/src/pocketmine/level/format/mcregion/McRegion.php b/src/pocketmine/level/format/mcregion/McRegion.php index a89aeb3c1..c5db36fe3 100644 --- a/src/pocketmine/level/format/mcregion/McRegion.php +++ b/src/pocketmine/level/format/mcregion/McRegion.php @@ -253,7 +253,6 @@ class McRegion extends BaseLevelProvider{ $chunk->setZ($chunkZ); - if($this->getChunk($chunkX, $chunkZ, false) !== $chunk){ $this->unloadChunk($chunkX, $chunkZ, false); } diff --git a/src/pocketmine/level/format/mcregion/RegionLoader.php b/src/pocketmine/level/format/mcregion/RegionLoader.php index 535c651b8..b5c9e33a7 100644 --- a/src/pocketmine/level/format/mcregion/RegionLoader.php +++ b/src/pocketmine/level/format/mcregion/RegionLoader.php @@ -216,7 +216,7 @@ class RegionLoader{ try{ $chunk = zlib_decode(substr($chunk, 5)); - }catch (\Exception $e){ + }catch(\Exception $e){ $this->locationTable[$i] = [0, 0, 0]; //Corrupted chunk, remove it continue; } diff --git a/src/pocketmine/level/generator/GenerationChunkManager.php b/src/pocketmine/level/generator/GenerationChunkManager.php index a84ab37c7..37347b70f 100644 --- a/src/pocketmine/level/generator/GenerationChunkManager.php +++ b/src/pocketmine/level/generator/GenerationChunkManager.php @@ -122,7 +122,8 @@ class GenerationChunkManager implements ChunkManager{ $this->getChunk($chunkX, $chunkZ); $this->generator->generateChunk($chunkX, $chunkZ); $this->setChunkGenerated($chunkX, $chunkZ); - }catch(\Exception $e){} + }catch(\Exception $e){ + } } public function populateChunk($chunkX, $chunkZ){ @@ -163,7 +164,8 @@ class GenerationChunkManager implements ChunkManager{ $chunk = $this->getChunk($chunkX, $chunkZ); $chunk->setGenerated(true); $this->changes["$chunkX:$chunkZ"] = $chunk; - }catch(\Exception $e){} + }catch(\Exception $e){ + } } public function setChunkPopulated($chunkX, $chunkZ){ @@ -171,7 +173,8 @@ class GenerationChunkManager implements ChunkManager{ $chunk = $this->getChunk($chunkX, $chunkZ); $chunk->setPopulated(true); $this->changes["$chunkX:$chunkZ"] = $chunk; - }catch(\Exception $e){} + }catch(\Exception $e){ + } } protected function requestChunk($chunkX, $chunkZ){ @@ -222,7 +225,8 @@ class GenerationChunkManager implements ChunkManager{ public function setBlockIdAt($x, $y, $z, $id){ try{ $this->getChunk($x >> 4, $z >> 4)->setBlockId($x & 0x0f, $y & 0x7f, $z & 0x0f, $id & 0xff); - }catch(\Exception $e){} + }catch(\Exception $e){ + } } /** @@ -253,7 +257,8 @@ class GenerationChunkManager implements ChunkManager{ public function setBlockDataAt($x, $y, $z, $data){ try{ $this->getChunk($x >> 4, $z >> 4)->setBlockData($x & 0x0f, $y & 0x7f, $z & 0x0f, $data & 0x0f); - }catch(\Exception $e){} + }catch(\Exception $e){ + } } public function shutdown(){ diff --git a/src/pocketmine/level/generator/GenerationManager.php b/src/pocketmine/level/generator/GenerationManager.php index 0c4b1af61..85c2195c1 100644 --- a/src/pocketmine/level/generator/GenerationManager.php +++ b/src/pocketmine/level/generator/GenerationManager.php @@ -135,7 +135,7 @@ class GenerationManager{ $this->readPacket(); } }catch(\Exception $e){ - $this->logger->warning("[Generator Thread] Exception: ".$e->getMessage() . " on file \"".$e->getFile()."\" line ".$e->getLine()); + $this->logger->warning("[Generator Thread] Exception: " . $e->getMessage() . " on file \"" . $e->getFile() . "\" line " . $e->getLine()); } } } @@ -271,7 +271,7 @@ class GenerationManager{ $this->shutdown = true; } }elseif(count($this->thread->getInternalQueue()) === 0){ - $this->thread->synchronized(function(){ + $this->thread->synchronized(function (){ $this->thread->wait(50000); }); diff --git a/src/pocketmine/level/generator/GenerationThread.php b/src/pocketmine/level/generator/GenerationThread.php index dee18e5dd..de44316ea 100644 --- a/src/pocketmine/level/generator/GenerationThread.php +++ b/src/pocketmine/level/generator/GenerationThread.php @@ -53,7 +53,7 @@ class GenerationThread extends Thread{ public function pushMainToThreadPacket($str){ $this->internalQueue[] = $str; - $this->synchronized(function(){ + $this->synchronized(function (){ $this->notify(); }); } diff --git a/src/pocketmine/math/AxisAlignedBB.php b/src/pocketmine/math/AxisAlignedBB.php index d0de5d562..905382aa7 100644 --- a/src/pocketmine/math/AxisAlignedBB.php +++ b/src/pocketmine/math/AxisAlignedBB.php @@ -20,6 +20,7 @@ */ namespace pocketmine\math; + use pocketmine\level\MovingObjectPosition; class AxisAlignedBB{ @@ -58,7 +59,7 @@ class AxisAlignedBB{ $maxX = $this->maxX; $maxY = $this->maxY; $maxZ = $this->maxZ; - + if($x < 0){ $minX += $x; }elseif($x > 0){ diff --git a/src/pocketmine/nbt/NBT.php b/src/pocketmine/nbt/NBT.php index a29bcdec1..927148726 100644 --- a/src/pocketmine/nbt/NBT.php +++ b/src/pocketmine/nbt/NBT.php @@ -42,6 +42,7 @@ use pocketmine\utils\Utils; #ifndef COMPILE use pocketmine\utils\Binary; + #endif diff --git a/src/pocketmine/network/RakLibInterface.php b/src/pocketmine/network/RakLibInterface.php index 1bb3f9d05..20e9c101c 100644 --- a/src/pocketmine/network/RakLibInterface.php +++ b/src/pocketmine/network/RakLibInterface.php @@ -103,7 +103,7 @@ class RakLibInterface implements ServerInstance, SourceInterface{ private $upload = 0; private $download = 0; - + private $internalThreaded; private $externalThreaded; @@ -113,7 +113,7 @@ class RakLibInterface implements ServerInstance, SourceInterface{ $this->server = $server; $this->identifiers = new \SplObjectStorage(); - + $this->internalThreaded = new \Threaded(); $this->externalThreaded = new \Threaded(); @@ -180,11 +180,11 @@ class RakLibInterface implements ServerInstance, SourceInterface{ $pk = $this->getPacket($packet->buffer); $pk->decode(); $this->players[$identifier]->handleDataPacket($pk); - }catch (\Exception $e){ + }catch(\Exception $e){ if(\pocketmine\DEBUG > 1){ $logger = $this->server->getLogger(); if($logger instanceof MainLogger){ - $logger->debug("Packet ".get_class($pk)." 0x".bin2hex($packet->buffer)); + $logger->debug("Packet " . get_class($pk) . " 0x" . bin2hex($packet->buffer)); $logger->logException($e); } } diff --git a/src/pocketmine/network/protocol/AddMobPacket.php b/src/pocketmine/network/protocol/AddMobPacket.php index 2f1d054a8..2a11b64d6 100644 --- a/src/pocketmine/network/protocol/AddMobPacket.php +++ b/src/pocketmine/network/protocol/AddMobPacket.php @@ -21,10 +21,11 @@ namespace pocketmine\network\protocol; -#include + #include #ifndef COMPILE use pocketmine\utils\Binary; + #endif class AddMobPacket extends DataPacket{ diff --git a/src/pocketmine/network/protocol/AddPlayerPacket.php b/src/pocketmine/network/protocol/AddPlayerPacket.php index 04825b66d..7f168b7a7 100644 --- a/src/pocketmine/network/protocol/AddPlayerPacket.php +++ b/src/pocketmine/network/protocol/AddPlayerPacket.php @@ -21,10 +21,11 @@ namespace pocketmine\network\protocol; -#include + #include #ifndef COMPILE use pocketmine\utils\Binary; + #endif class AddPlayerPacket extends DataPacket{ diff --git a/src/pocketmine/network/protocol/DataPacket.php b/src/pocketmine/network/protocol/DataPacket.php index d581530f2..6e595953d 100644 --- a/src/pocketmine/network/protocol/DataPacket.php +++ b/src/pocketmine/network/protocol/DataPacket.php @@ -21,7 +21,7 @@ namespace pocketmine\network\protocol; -#include + #include #ifndef COMPILE use pocketmine\utils\Binary; diff --git a/src/pocketmine/network/protocol/SetEntityDataPacket.php b/src/pocketmine/network/protocol/SetEntityDataPacket.php index a3239816c..6b8aaecc1 100644 --- a/src/pocketmine/network/protocol/SetEntityDataPacket.php +++ b/src/pocketmine/network/protocol/SetEntityDataPacket.php @@ -21,10 +21,11 @@ namespace pocketmine\network\protocol; -#include + #include #ifndef COMPILE use pocketmine\utils\Binary; + #endif class SetEntityDataPacket extends DataPacket{ diff --git a/src/pocketmine/network/rcon/RCONInstance.php b/src/pocketmine/network/rcon/RCONInstance.php index af6436666..30cb389ee 100644 --- a/src/pocketmine/network/rcon/RCONInstance.php +++ b/src/pocketmine/network/rcon/RCONInstance.php @@ -109,7 +109,7 @@ class RCONInstance extends \Thread{ } for($n = 0; $n < $this->maxClients; ++$n){ - $client = & $this->{"client" . $n}; + $client = &$this->{"client" . $n}; if($client !== null){ if($this->{"status" . $n} !== -1 and $this->stop !== true){ if($this->{"status" . $n} === 0 and $this->{"timeout" . $n} < microtime(true)){ //Timeout diff --git a/src/pocketmine/plugin/PluginManager.php b/src/pocketmine/plugin/PluginManager.php index 43d1f2ee3..03265ad28 100644 --- a/src/pocketmine/plugin/PluginManager.php +++ b/src/pocketmine/plugin/PluginManager.php @@ -668,7 +668,7 @@ class PluginManager{ try{ $registration->callEvent($event); }catch(\Exception $e){ - $this->server->getLogger()->critical("Could not pass event ". $event->getEventName() ." to ". $registration->getPlugin()->getDescription()->getFullName() .": ".$e->getMessage()." on ".get_class($registration->getListener())); + $this->server->getLogger()->critical("Could not pass event " . $event->getEventName() . " to " . $registration->getPlugin()->getDescription()->getFullName() . ": " . $e->getMessage() . " on " . get_class($registration->getListener())); if(($logger = $this->server->getLogger()) instanceof MainLogger){ $logger->logException($e); } diff --git a/src/pocketmine/scheduler/ServerScheduler.php b/src/pocketmine/scheduler/ServerScheduler.php index 7b3ce1b66..8e3611ebf 100644 --- a/src/pocketmine/scheduler/ServerScheduler.php +++ b/src/pocketmine/scheduler/ServerScheduler.php @@ -235,8 +235,8 @@ class ServerScheduler{ $task->timings->startTiming(); try{ $task->run($this->currentTick); - }catch (\Exception $e){ - Server::getInstance()->getLogger()->critical("Could not execute task ". $task->getTaskName() .": ".$e->getMessage()); + }catch(\Exception $e){ + Server::getInstance()->getLogger()->critical("Could not execute task " . $task->getTaskName() . ": " . $e->getMessage()); if(($logger = Server::getInstance()->getLogger()) instanceof MainLogger){ $logger->logException($e); } diff --git a/src/pocketmine/tile/Furnace.php b/src/pocketmine/tile/Furnace.php index 4aba6b9fe..0ae96907a 100644 --- a/src/pocketmine/tile/Furnace.php +++ b/src/pocketmine/tile/Furnace.php @@ -238,7 +238,8 @@ class Furnace extends Tile implements InventoryHolder, Container{ $this->namedtag->CookTime = new Short("CookTime", 0); } $ret = true; - }else{; + }else{ + ; if($this->getBlock()->getId() === Item::BURNING_FURNACE){ $this->getLevel()->setBlock($this, Block::get(Item::FURNACE, $this->getBlock()->getDamage()), true); } diff --git a/src/pocketmine/utils/MainLogger.php b/src/pocketmine/utils/MainLogger.php index 90e6ba2cb..39efa2303 100644 --- a/src/pocketmine/utils/MainLogger.php +++ b/src/pocketmine/utils/MainLogger.php @@ -136,7 +136,7 @@ class MainLogger extends \AttachableThreadedLogger{ $errstr = substr($errstr, 0, $pos); } $errfile = \pocketmine\cleanPath($errfile); - $this->log($type, get_class($e).": \"$errstr\" ($errno) in \"$errfile\" at line $errline"); + $this->log($type, get_class($e) . ": \"$errstr\" ($errno) in \"$errfile\" at line $errline"); foreach(($trace = @\pocketmine\getTrace($trace === null ? 4 : 0, $trace)) as $i => $line){ $this->debug($line); diff --git a/src/pocketmine/utils/Utils.php b/src/pocketmine/utils/Utils.php index 64602c14f..635342870 100644 --- a/src/pocketmine/utils/Utils.php +++ b/src/pocketmine/utils/Utils.php @@ -59,7 +59,7 @@ class Utils{ */ public static function getUniqueID($raw = false, $extra = ""){ $machine = php_uname("a"); - $machine .= file_exists("/proc/cpuinfo") ? implode(preg_grep("/model name/", file("/proc/cpuinfo"))): ""; + $machine .= file_exists("/proc/cpuinfo") ? implode(preg_grep("/model name/", file("/proc/cpuinfo"))) : ""; $machine .= sys_get_temp_dir(); $machine .= $extra; $os = Utils::getOS(); diff --git a/src/pocketmine/wizard/InstallerLang.php b/src/pocketmine/wizard/InstallerLang.php index 159b7776d..41b0cfffe 100644 --- a/src/pocketmine/wizard/InstallerLang.php +++ b/src/pocketmine/wizard/InstallerLang.php @@ -59,7 +59,7 @@ class InstallerLang{ $files[$file->getFilename()] = $file->getSize(); } } - + if(count($files) > 0){ arsort($files); reset($files);