Strict type all the things and fix lots of assorted bugs exposed by strict types (#993)

Strict type all the things
This commit is contained in:
Dylan K. Taylor 2017-06-08 11:21:51 +01:00 committed by GitHub
commit d358e13868
863 changed files with 2033 additions and 308 deletions

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use pocketmine\event\TranslationContainer; use pocketmine\event\TranslationContainer;
@ -108,7 +110,7 @@ abstract class Achievement{
public static function broadcast(Player $player, $achievementId){ public static function broadcast(Player $player, $achievementId){
if(isset(Achievement::$list[$achievementId])){ if(isset(Achievement::$list[$achievementId])){
$translation = new TranslationContainer("chat.type.achievement", [$player->getDisplayName(), TextFormat::GREEN . Achievement::$list[$achievementId]["name"] . TextFormat::RESET]); $translation = new TranslationContainer("chat.type.achievement", [$player->getDisplayName(), TextFormat::GREEN . Achievement::$list[$achievementId]["name"] . TextFormat::RESET]);
if(Server::getInstance()->getConfigString("announce-player-achievements", true) === true){ if(Server::getInstance()->getConfigBoolean("announce-player-achievements", true) === true){
Server::getInstance()->broadcastMessage($translation); Server::getInstance()->broadcastMessage($translation);
}else{ }else{
$player->sendMessage($translation); $player->sendMessage($translation);

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
abstract class Collectable extends \Threaded implements \Collectable{ abstract class Collectable extends \Threaded implements \Collectable{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use pocketmine\network\mcpe\protocol\ProtocolInfo; use pocketmine\network\mcpe\protocol\ProtocolInfo;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use pocketmine\permission\ServerOperator; use pocketmine\permission\ServerOperator;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use pocketmine\event\server\LowMemoryEvent; use pocketmine\event\server\LowMemoryEvent;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use pocketmine\metadata\Metadatable; use pocketmine\metadata\Metadatable;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
use pocketmine\block\Air; use pocketmine\block\Air;
@ -839,6 +841,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$X = null; $X = null;
$Z = null; $Z = null;
Level::getXZ($index, $X, $Z); Level::getXZ($index, $X, $Z);
assert(is_int($X) and is_int($Z));
++$count; ++$count;
@ -900,7 +903,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->getDisplayName() $this->getDisplayName()
]) ])
)); ));
if(strlen(trim($ev->getJoinMessage())) > 0){ if(strlen(trim((string) $ev->getJoinMessage())) > 0){
$this->server->broadcastMessage($ev->getJoinMessage()); $this->server->broadcastMessage($ev->getJoinMessage());
} }
@ -1806,7 +1809,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->allowFlight = (bool) ($this->gamemode & 0x01); $this->allowFlight = (bool) ($this->gamemode & 0x01);
if(($level = $this->server->getLevelByName($this->namedtag["Level"])) === null){ if(($level = $this->server->getLevelByName((string) $this->namedtag["Level"])) === null){
$this->setLevel($this->server->getDefaultLevel()); $this->setLevel($this->server->getDefaultLevel());
$this->namedtag["Level"] = $this->level->getName(); $this->namedtag["Level"] = $this->level->getName();
$this->namedtag["Pos"][0] = $this->level->getSpawnLocation()->x; $this->namedtag["Pos"][0] = $this->level->getSpawnLocation()->x;
@ -1823,7 +1826,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$this->achievements[$achievement->getName()] = $achievement->getValue() > 0 ? true : false; $this->achievements[$achievement->getName()] = $achievement->getValue() > 0 ? true : false;
} }
$this->namedtag->lastPlayed = new LongTag("lastPlayed", floor(microtime(true) * 1000)); $this->namedtag->lastPlayed = new LongTag("lastPlayed", (int) floor(microtime(true) * 1000));
if($this->server->getAutoSave()){ if($this->server->getAutoSave()){
$this->server->saveOfflinePlayerData($this->username, $this->namedtag, true); $this->server->saveOfflinePlayerData($this->username, $this->namedtag, true);
} }
@ -1842,7 +1845,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
protected function completeLoginSequence(){ protected function completeLoginSequence(){
parent::__construct($this->level, $this->namedtag); parent::__construct($this->level, $this->namedtag);
if(!$this->hasValidSpawnPosition() and isset($this->namedtag->SpawnLevel) and ($level = $this->server->getLevelByName($this->namedtag["SpawnLevel"])) instanceof Level){ if(!$this->hasValidSpawnPosition() and isset($this->namedtag->SpawnLevel) and ($level = $this->server->getLevelByName((string) $this->namedtag["SpawnLevel"])) instanceof Level){
$this->spawnPosition = new WeakPosition($this->namedtag["SpawnX"], $this->namedtag["SpawnY"], $this->namedtag["SpawnZ"], $level); $this->spawnPosition = new WeakPosition($this->namedtag["SpawnX"], $this->namedtag["SpawnY"], $this->namedtag["SpawnZ"], $level);
} }
@ -1864,12 +1867,12 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$pk->spawnX = $spawnPosition->getFloorX(); $pk->spawnX = $spawnPosition->getFloorX();
$pk->spawnY = $spawnPosition->getFloorY(); $pk->spawnY = $spawnPosition->getFloorY();
$pk->spawnZ = $spawnPosition->getFloorZ(); $pk->spawnZ = $spawnPosition->getFloorZ();
$pk->hasAchievementsDisabled = 1; $pk->hasAchievementsDisabled = true;
$pk->dayCycleStopTime = -1; //TODO: implement this properly $pk->dayCycleStopTime = -1; //TODO: implement this properly
$pk->eduMode = 0; $pk->eduMode = false;
$pk->rainLevel = 0; //TODO: implement these properly $pk->rainLevel = 0; //TODO: implement these properly
$pk->lightningLevel = 0; $pk->lightningLevel = 0;
$pk->commandsEnabled = 1; $pk->commandsEnabled = true;
$pk->levelId = ""; $pk->levelId = "";
$pk->worldName = $this->server->getMotd(); $pk->worldName = $this->server->getMotd();
$this->dataPacket($pk); $this->dataPacket($pk);
@ -2598,7 +2601,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
//TODO: improve this to take stuff like swimming, ladders, enchanted tools into account, fix wrong tool break time calculations for bad tools (pmmp/PocketMine-MP#211) //TODO: improve this to take stuff like swimming, ladders, enchanted tools into account, fix wrong tool break time calculations for bad tools (pmmp/PocketMine-MP#211)
$breakTime = ceil($target->getBreakTime($this->inventory->getItemInHand()) * 20); $breakTime = ceil($target->getBreakTime($this->inventory->getItemInHand()) * 20);
if($breakTime > 0){ if($breakTime > 0){
$this->level->broadcastLevelEvent($pos, LevelEventPacket::EVENT_BLOCK_START_BREAK, 65535 / $breakTime); $this->level->broadcastLevelEvent($pos, LevelEventPacket::EVENT_BLOCK_START_BREAK, (int) (65535 / $breakTime));
} }
} }
$this->lastBreak = microtime(true); $this->lastBreak = microtime(true);
@ -3563,7 +3566,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
/** /**
* Sends a direct chat message to a player * Sends a direct chat message to a player
* *
* @param string|TextContainer $message * @param TextContainer|string $message
*/ */
public function sendMessage($message){ public function sendMessage($message){
if($message instanceof TextContainer){ if($message instanceof TextContainer){
@ -3745,7 +3748,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
} }
$this->namedtag["playerGameType"] = $this->gamemode; $this->namedtag["playerGameType"] = $this->gamemode;
$this->namedtag["lastPlayed"] = floor(microtime(true) * 1000); $this->namedtag["lastPlayed"] = (int) floor(microtime(true) * 1000);
if($this->username != "" and $this->namedtag instanceof CompoundTag){ if($this->username != "" and $this->namedtag instanceof CompoundTag){
$this->server->saveOfflinePlayerData($this->username, $this->namedtag, $async); $this->server->saveOfflinePlayerData($this->username, $this->namedtag, $async);
@ -3959,6 +3962,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
$pk->pitch = $pitch; $pk->pitch = $pitch;
$pk->yaw = $yaw; $pk->yaw = $yaw;
$pk->mode = $mode; $pk->mode = $mode;
$pk->onGround = $this->onGround;
if($targets !== null){ if($targets !== null){
$this->server->broadcastPacket($targets, $pk); $this->server->broadcastPacket($targets, $pk);

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace { namespace {
function safe_var_dump(){ function safe_var_dump(){
static $cnt = 0; static $cnt = 0;
@ -142,12 +144,12 @@ namespace pocketmine {
} }
}); });
ini_set("allow_url_fopen", 1); ini_set("allow_url_fopen", '1');
ini_set("display_errors", 1); ini_set("display_errors", '1');
ini_set("display_startup_errors", 1); ini_set("display_startup_errors", '1');
ini_set("default_charset", "utf-8"); ini_set("default_charset", "utf-8");
ini_set("memory_limit", -1); ini_set("memory_limit", '-1');
define('pocketmine\START_TIME', microtime(true)); define('pocketmine\START_TIME', microtime(true));
$opts = getopt("", ["data:", "plugins:", "no-wizard", "enable-profiler"]); $opts = getopt("", ["data:", "plugins:", "no-wizard", "enable-profiler"]);

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
/** /**
* PocketMine-MP is the Minecraft: PE multiplayer server software * PocketMine-MP is the Minecraft: PE multiplayer server software
* Homepage: http://www.pocketmine.net/ * Homepage: http://www.pocketmine.net/
@ -40,6 +42,7 @@ use pocketmine\event\level\LevelLoadEvent;
use pocketmine\event\player\PlayerDataSaveEvent; use pocketmine\event\player\PlayerDataSaveEvent;
use pocketmine\event\server\QueryRegenerateEvent; use pocketmine\event\server\QueryRegenerateEvent;
use pocketmine\event\server\ServerCommandEvent; use pocketmine\event\server\ServerCommandEvent;
use pocketmine\event\TextContainer;
use pocketmine\event\Timings; use pocketmine\event\Timings;
use pocketmine\event\TimingsHandler; use pocketmine\event\TimingsHandler;
use pocketmine\event\TranslationContainer; use pocketmine\event\TranslationContainer;
@ -264,77 +267,77 @@ class Server{
/** /**
* @return string * @return string
*/ */
public function getName(){ public function getName() : string{
return "PocketMine-MP"; return "PocketMine-MP";
} }
/** /**
* @return bool * @return bool
*/ */
public function isRunning(){ public function isRunning() : bool{
return $this->isRunning === true; return $this->isRunning === true;
} }
/** /**
* @return string * @return string
*/ */
public function getPocketMineVersion(){ public function getPocketMineVersion() : string{
return \pocketmine\VERSION; return \pocketmine\VERSION;
} }
/** /**
* @return string * @return string
*/ */
public function getCodename(){ public function getCodename() : string{
return \pocketmine\CODENAME; return \pocketmine\CODENAME;
} }
/** /**
* @return string * @return string
*/ */
public function getVersion(){ public function getVersion() : string{
return ProtocolInfo::MINECRAFT_VERSION; return ProtocolInfo::MINECRAFT_VERSION;
} }
/** /**
* @return string * @return string
*/ */
public function getApiVersion(){ public function getApiVersion() : string{
return \pocketmine\API_VERSION; return \pocketmine\API_VERSION;
} }
/** /**
* @return string * @return string
*/ */
public function getFilePath(){ public function getFilePath() : string{
return $this->filePath; return $this->filePath;
} }
/** /**
* @return string * @return string
*/ */
public function getDataPath(){ public function getDataPath() : string{
return $this->dataPath; return $this->dataPath;
} }
/** /**
* @return string * @return string
*/ */
public function getPluginPath(){ public function getPluginPath() : string{
return $this->pluginPath; return $this->pluginPath;
} }
/** /**
* @return int * @return int
*/ */
public function getMaxPlayers(){ public function getMaxPlayers() : int{
return $this->maxPlayers; return $this->maxPlayers;
} }
/** /**
* @return int * @return int
*/ */
public function getPort(){ public function getPort() : int{
return $this->getConfigInt("server-port", 19132); return $this->getConfigInt("server-port", 19132);
} }
@ -359,10 +362,13 @@ class Server{
/** /**
* @return string * @return string
*/ */
public function getIp(){ public function getIp() : string{
return $this->getConfigString("server-ip", "0.0.0.0"); return $this->getConfigString("server-ip", "0.0.0.0");
} }
/**
* @return UUID
*/
public function getServerUniqueId(){ public function getServerUniqueId(){
return $this->serverID; return $this->serverID;
} }
@ -370,15 +376,15 @@ class Server{
/** /**
* @return bool * @return bool
*/ */
public function getAutoSave(){ public function getAutoSave() : bool{
return $this->autoSave; return $this->autoSave;
} }
/** /**
* @param bool $value * @param bool $value
*/ */
public function setAutoSave($value){ public function setAutoSave(bool $value){
$this->autoSave = (bool) $value; $this->autoSave = $value;
foreach($this->getLevels() as $level){ foreach($this->getLevels() as $level){
$level->setAutoSave($this->autoSave); $level->setAutoSave($this->autoSave);
} }
@ -387,28 +393,28 @@ class Server{
/** /**
* @return string * @return string
*/ */
public function getLevelType(){ public function getLevelType() : string{
return $this->getConfigString("level-type", "DEFAULT"); return $this->getConfigString("level-type", "DEFAULT");
} }
/** /**
* @return bool * @return bool
*/ */
public function getGenerateStructures(){ public function getGenerateStructures() : bool{
return $this->getConfigBoolean("generate-structures", true); return $this->getConfigBoolean("generate-structures", true);
} }
/** /**
* @return int * @return int
*/ */
public function getGamemode(){ public function getGamemode() : int{
return $this->getConfigInt("gamemode", 0) & 0b11; return $this->getConfigInt("gamemode", 0) & 0b11;
} }
/** /**
* @return bool * @return bool
*/ */
public function getForceGamemode(){ public function getForceGamemode() : bool{
return $this->getConfigBoolean("force-gamemode", false); return $this->getConfigBoolean("force-gamemode", false);
} }
@ -419,7 +425,7 @@ class Server{
* *
* @return string * @return string
*/ */
public static function getGamemodeString($mode){ public static function getGamemodeString(int $mode) : string{
switch((int) $mode){ switch((int) $mode){
case Player::SURVIVAL: case Player::SURVIVAL:
return "%gameMode.survival"; return "%gameMode.survival";
@ -441,7 +447,7 @@ class Server{
* *
* @return int * @return int
*/ */
public static function getGamemodeFromString($str){ public static function getGamemodeFromString(string $str) : int{
switch(strtolower(trim($str))){ switch(strtolower(trim($str))){
case (string) Player::SURVIVAL: case (string) Player::SURVIVAL:
case "survival": case "survival":
@ -472,7 +478,7 @@ class Server{
* *
* @return int * @return int
*/ */
public static function getDifficultyFromString($str){ public static function getDifficultyFromString(string $str) : int{
switch(strtolower(trim($str))){ switch(strtolower(trim($str))){
case "0": case "0":
case "peaceful": case "peaceful":
@ -500,49 +506,49 @@ class Server{
/** /**
* @return int * @return int
*/ */
public function getDifficulty(){ public function getDifficulty() : int{
return $this->getConfigInt("difficulty", 1); return $this->getConfigInt("difficulty", 1);
} }
/** /**
* @return bool * @return bool
*/ */
public function hasWhitelist(){ public function hasWhitelist() : bool{
return $this->getConfigBoolean("white-list", false); return $this->getConfigBoolean("white-list", false);
} }
/** /**
* @return int * @return int
*/ */
public function getSpawnRadius(){ public function getSpawnRadius() : int{
return $this->getConfigInt("spawn-protection", 16); return $this->getConfigInt("spawn-protection", 16);
} }
/** /**
* @return bool * @return bool
*/ */
public function getAllowFlight(){ public function getAllowFlight() : bool{
return $this->getConfigBoolean("allow-flight", false); return $this->getConfigBoolean("allow-flight", false);
} }
/** /**
* @return bool * @return bool
*/ */
public function isHardcore(){ public function isHardcore() : bool{
return $this->getConfigBoolean("hardcore", false); return $this->getConfigBoolean("hardcore", false);
} }
/** /**
* @return int * @return int
*/ */
public function getDefaultGamemode(){ public function getDefaultGamemode() : int{
return $this->getConfigInt("gamemode", 0) & 0b11; return $this->getConfigInt("gamemode", 0) & 0b11;
} }
/** /**
* @return string * @return string
*/ */
public function getMotd(){ public function getMotd() : string{
return $this->getConfigString("motd", "Minecraft: PE Server"); return $this->getConfigString("motd", "Minecraft: PE Server");
} }
@ -619,7 +625,7 @@ class Server{
/** /**
* @return int * @return int
*/ */
public function getTick(){ public function getTick() : int{
return $this->tickCounter; return $this->tickCounter;
} }
@ -628,7 +634,7 @@ class Server{
* *
* @return float * @return float
*/ */
public function getTicksPerSecond(){ public function getTicksPerSecond() : float{
return round($this->currentTPS, 2); return round($this->currentTPS, 2);
} }
@ -637,7 +643,7 @@ class Server{
* *
* @return float * @return float
*/ */
public function getTicksPerSecondAverage(){ public function getTicksPerSecondAverage() : float{
return round(array_sum($this->tickAverage) / count($this->tickAverage), 2); return round(array_sum($this->tickAverage) / count($this->tickAverage), 2);
} }
@ -646,7 +652,7 @@ class Server{
* *
* @return float * @return float
*/ */
public function getTickUsage(){ public function getTickUsage() : float{
return round($this->currentUse * 100, 2); return round($this->currentUse * 100, 2);
} }
@ -655,7 +661,7 @@ class Server{
* *
* @return float * @return float
*/ */
public function getTickUsageAverage(){ public function getTickUsageAverage() : float{
return round((array_sum($this->useAverage) / count($this->useAverage)) * 100, 2); return round((array_sum($this->useAverage) / count($this->useAverage)) * 100, 2);
} }
@ -669,7 +675,7 @@ class Server{
/** /**
* @return Player[] * @return Player[]
*/ */
public function getOnlinePlayers(){ public function getOnlinePlayers() : array{
return $this->playerList; return $this->playerList;
} }
@ -686,7 +692,7 @@ class Server{
* *
* @return OfflinePlayer|Player * @return OfflinePlayer|Player
*/ */
public function getOfflinePlayer($name){ public function getOfflinePlayer(string $name){
$name = strtolower($name); $name = strtolower($name);
$result = $this->getPlayerExact($name); $result = $this->getPlayerExact($name);
@ -702,7 +708,7 @@ class Server{
* *
* @return CompoundTag * @return CompoundTag
*/ */
public function getOfflinePlayerData($name) : CompoundTag{ public function getOfflinePlayerData(string $name) : CompoundTag{
$name = strtolower($name); $name = strtolower($name);
$path = $this->getDataPath() . "players/"; $path = $this->getDataPath() . "players/";
if($this->shouldSavePlayerData()){ if($this->shouldSavePlayerData()){
@ -794,9 +800,9 @@ class Server{
/** /**
* @param string $name * @param string $name
* *
* @return Player * @return Player|null
*/ */
public function getPlayer($name){ public function getPlayer(string $name){
$found = null; $found = null;
$name = strtolower($name); $name = strtolower($name);
$delta = PHP_INT_MAX; $delta = PHP_INT_MAX;
@ -819,9 +825,9 @@ class Server{
/** /**
* @param string $name * @param string $name
* *
* @return Player * @return Player|null
*/ */
public function getPlayerExact($name){ public function getPlayerExact(string $name){
$name = strtolower($name); $name = strtolower($name);
foreach($this->getOnlinePlayers() as $player){ foreach($this->getOnlinePlayers() as $player){
if($player->getLowerCaseName() === $name){ if($player->getLowerCaseName() === $name){
@ -837,7 +843,7 @@ class Server{
* *
* @return Player[] * @return Player[]
*/ */
public function matchPlayer($partialName){ public function matchPlayer(string $partialName) : array{
$partialName = strtolower($partialName); $partialName = strtolower($partialName);
$matchedPlayers = []; $matchedPlayers = [];
foreach($this->getOnlinePlayers() as $player){ foreach($this->getOnlinePlayers() as $player){
@ -875,12 +881,12 @@ class Server{
/** /**
* @return Level[] * @return Level[]
*/ */
public function getLevels(){ public function getLevels() : array{
return $this->levels; return $this->levels;
} }
/** /**
* @return Level * @return Level|null
*/ */
public function getDefaultLevel(){ public function getDefaultLevel(){
return $this->levelDefault; return $this->levelDefault;
@ -891,7 +897,7 @@ class Server{
* This won't change the level-name property, * This won't change the level-name property,
* it only affects the server on runtime * it only affects the server on runtime
* *
* @param Level $level * @param Level|null $level
*/ */
public function setDefaultLevel($level){ public function setDefaultLevel($level){
if($level === null or ($this->isLevelLoaded($level->getFolderName()) and $level !== $this->levelDefault)){ if($level === null or ($this->isLevelLoaded($level->getFolderName()) and $level !== $this->levelDefault)){
@ -904,16 +910,16 @@ class Server{
* *
* @return bool * @return bool
*/ */
public function isLevelLoaded($name){ public function isLevelLoaded(string $name) : bool{
return $this->getLevelByName($name) instanceof Level; return $this->getLevelByName($name) instanceof Level;
} }
/** /**
* @param int $levelId * @param int $levelId
* *
* @return Level * @return Level|null
*/ */
public function getLevel($levelId){ public function getLevel(int $levelId){
if(isset($this->levels[$levelId])){ if(isset($this->levels[$levelId])){
return $this->levels[$levelId]; return $this->levels[$levelId];
} }
@ -922,11 +928,13 @@ class Server{
} }
/** /**
* @param $name * NOTE: This matches levels based on the FOLDER name, NOT the display name.
* *
* @return Level * @param string $name
*
* @return Level|null
*/ */
public function getLevelByName($name){ public function getLevelByName(string $name){
foreach($this->getLevels() as $level){ foreach($this->getLevels() as $level){
if($level->getFolderName() === $name){ if($level->getFolderName() === $name){
return $level; return $level;
@ -944,7 +952,7 @@ class Server{
* *
* @throws \InvalidStateException * @throws \InvalidStateException
*/ */
public function unloadLevel(Level $level, $forceUnload = false){ public function unloadLevel(Level $level, bool $forceUnload = false) : bool{
if($level === $this->getDefaultLevel() and !$forceUnload){ if($level === $this->getDefaultLevel() and !$forceUnload){
throw new \InvalidStateException("The default level cannot be unloaded while running, please switch levels."); throw new \InvalidStateException("The default level cannot be unloaded while running, please switch levels.");
} }
@ -966,7 +974,7 @@ class Server{
* *
* @throws LevelException * @throws LevelException
*/ */
public function loadLevel($name){ public function loadLevel(string $name) : bool{
if(trim($name) === ""){ if(trim($name) === ""){
throw new LevelException("Invalid empty level name"); throw new LevelException("Invalid empty level name");
} }
@ -1012,13 +1020,13 @@ class Server{
* Generates a new level if it does not exists * Generates a new level if it does not exists
* *
* @param string $name * @param string $name
* @param int $seed * @param int|null $seed
* @param string $generator Class name that extends pocketmine\level\generator\Noise * @param string|null $generator Class name that extends pocketmine\level\generator\Noise
* @param array $options * @param array $options
* *
* @return bool * @return bool
*/ */
public function generateLevel($name, $seed = null, $generator = null, $options = []){ public function generateLevel(string $name, $seed = null, $generator = null, array $options = []){
if(trim($name) === "" or $this->isLevelGenerated($name)){ if(trim($name) === "" or $this->isLevelGenerated($name)){
return false; return false;
} }
@ -1042,7 +1050,7 @@ class Server{
/** @var \pocketmine\level\format\io\LevelProvider $provider */ /** @var \pocketmine\level\format\io\LevelProvider $provider */
$provider::generate($path, $name, $seed, $generator, $options); $provider::generate($path, $name, $seed, $generator, $options);
$level = new Level($this, $name, $path, $provider); $level = new Level($this, $name, $path, (string) $provider);
$this->levels[$level->getId()] = $level; $this->levels[$level->getId()] = $level;
$level->initLevel(); $level->initLevel();
@ -1090,7 +1098,7 @@ class Server{
* *
* @return bool * @return bool
*/ */
public function isLevelGenerated($name){ public function isLevelGenerated(string $name) : bool{
if(trim($name) === ""){ if(trim($name) === ""){
return false; return false;
} }
@ -1130,28 +1138,13 @@ class Server{
return null; return null;
} }
/**
* @param string $variable
* @param string $defaultValue
*
* @return string
*/
public function getConfigString($variable, $defaultValue = ""){
$v = getopt("", ["$variable::"]);
if(isset($v[$variable])){
return (string) $v[$variable];
}
return $this->properties->exists($variable) ? $this->properties->get($variable) : $defaultValue;
}
/** /**
* @param string $variable * @param string $variable
* @param mixed $defaultValue * @param mixed $defaultValue
* *
* @return mixed * @return mixed
*/ */
public function getProperty($variable, $defaultValue = null){ public function getProperty(string $variable, $defaultValue = null){
if(!array_key_exists($variable, $this->propertyCache)){ if(!array_key_exists($variable, $this->propertyCache)){
$v = getopt("", ["$variable::"]); $v = getopt("", ["$variable::"]);
if(isset($v[$variable])){ if(isset($v[$variable])){
@ -1164,11 +1157,26 @@ class Server{
return $this->propertyCache[$variable] === null ? $defaultValue : $this->propertyCache[$variable]; return $this->propertyCache[$variable] === null ? $defaultValue : $this->propertyCache[$variable];
} }
/**
* @param string $variable
* @param string $defaultValue
*
* @return string
*/
public function getConfigString(string $variable, string $defaultValue = "") : string{
$v = getopt("", ["$variable::"]);
if(isset($v[$variable])){
return (string) $v[$variable];
}
return $this->properties->exists($variable) ? (string) $this->properties->get($variable) : $defaultValue;
}
/** /**
* @param string $variable * @param string $variable
* @param string $value * @param string $value
*/ */
public function setConfigString($variable, $value){ public function setConfigString(string $variable, string $value){
$this->properties->set($variable, $value); $this->properties->set($variable, $value);
} }
@ -1178,7 +1186,7 @@ class Server{
* *
* @return int * @return int
*/ */
public function getConfigInt($variable, $defaultValue = 0){ public function getConfigInt(string $variable, int $defaultValue = 0) : int{
$v = getopt("", ["$variable::"]); $v = getopt("", ["$variable::"]);
if(isset($v[$variable])){ if(isset($v[$variable])){
return (int) $v[$variable]; return (int) $v[$variable];
@ -1191,17 +1199,17 @@ class Server{
* @param string $variable * @param string $variable
* @param int $value * @param int $value
*/ */
public function setConfigInt($variable, $value){ public function setConfigInt(string $variable, int $value){
$this->properties->set($variable, (int) $value); $this->properties->set($variable, (int) $value);
} }
/** /**
* @param string $variable * @param string $variable
* @param boolean $defaultValue * @param bool $defaultValue
* *
* @return boolean * @return bool
*/ */
public function getConfigBoolean($variable, $defaultValue = false){ public function getConfigBoolean(string $variable, bool $defaultValue = false) : bool{
$v = getopt("", ["$variable::"]); $v = getopt("", ["$variable::"]);
if(isset($v[$variable])){ if(isset($v[$variable])){
$value = $v[$variable]; $value = $v[$variable];
@ -1227,16 +1235,16 @@ class Server{
* @param string $variable * @param string $variable
* @param bool $value * @param bool $value
*/ */
public function setConfigBool($variable, $value){ public function setConfigBool(string $variable, bool $value){
$this->properties->set($variable, $value == true ? "1" : "0"); $this->properties->set($variable, $value == true ? "1" : "0");
} }
/** /**
* @param string $name * @param string $name
* *
* @return PluginIdentifiableCommand * @return PluginIdentifiableCommand|null
*/ */
public function getPluginCommand($name){ public function getPluginCommand(string $name){
if(($command = $this->commandMap->getCommand($name)) instanceof PluginIdentifiableCommand){ if(($command = $this->commandMap->getCommand($name)) instanceof PluginIdentifiableCommand){
return $command; return $command;
}else{ }else{
@ -1261,7 +1269,7 @@ class Server{
/** /**
* @param string $name * @param string $name
*/ */
public function addOp($name){ public function addOp(string $name){
$this->operators->set(strtolower($name), true); $this->operators->set(strtolower($name), true);
if(($player = $this->getPlayerExact($name)) !== null){ if(($player = $this->getPlayerExact($name)) !== null){
@ -1273,7 +1281,7 @@ class Server{
/** /**
* @param string $name * @param string $name
*/ */
public function removeOp($name){ public function removeOp(string $name){
$this->operators->remove(strtolower($name)); $this->operators->remove(strtolower($name));
if(($player = $this->getPlayerExact($name)) !== null){ if(($player = $this->getPlayerExact($name)) !== null){
@ -1285,7 +1293,7 @@ class Server{
/** /**
* @param string $name * @param string $name
*/ */
public function addWhitelist($name){ public function addWhitelist(string $name){
$this->whitelist->set(strtolower($name), true); $this->whitelist->set(strtolower($name), true);
$this->whitelist->save(true); $this->whitelist->save(true);
} }
@ -1293,7 +1301,7 @@ class Server{
/** /**
* @param string $name * @param string $name
*/ */
public function removeWhitelist($name){ public function removeWhitelist(string $name){
$this->whitelist->remove(strtolower($name)); $this->whitelist->remove(strtolower($name));
$this->whitelist->save(); $this->whitelist->save();
} }
@ -1303,7 +1311,7 @@ class Server{
* *
* @return bool * @return bool
*/ */
public function isWhitelisted($name){ public function isWhitelisted(string $name){
return !$this->hasWhitelist() or $this->operators->exists($name, true) or $this->whitelist->exists($name, true); return !$this->hasWhitelist() or $this->operators->exists($name, true) or $this->whitelist->exists($name, true);
} }
@ -1312,7 +1320,7 @@ class Server{
* *
* @return bool * @return bool
*/ */
public function isOp($name){ public function isOp(string $name){
return $this->operators->exists($name, true); return $this->operators->exists($name, true);
} }
@ -1337,7 +1345,7 @@ class Server{
/** /**
* @return string[] * @return string[]
*/ */
public function getCommandAliases(){ public function getCommandAliases() : array{
$section = $this->getProperty("aliases"); $section = $this->getProperty("aliases");
$result = []; $result = [];
if(is_array($section)){ if(is_array($section)){
@ -1376,7 +1384,7 @@ class Server{
* @param string $dataPath * @param string $dataPath
* @param string $pluginPath * @param string $pluginPath
*/ */
public function __construct(\ClassLoader $autoloader, \ThreadedLogger $logger, $filePath, $dataPath, $pluginPath){ public function __construct(\ClassLoader $autoloader, \ThreadedLogger $logger, string $filePath, string $dataPath, string $pluginPath){
self::$instance = $this; self::$instance = $this;
self::$sleeper = new \Threaded; self::$sleeper = new \Threaded;
$this->autoloader = $autoloader; $this->autoloader = $autoloader;
@ -1650,12 +1658,12 @@ class Server{
} }
/** /**
* @param string $message * @param TextContainer|string $message
* @param Player[]|null $recipients * @param Player[] $recipients
* *
* @return int * @return int
*/ */
public function broadcastMessage($message, $recipients = null){ public function broadcastMessage($message, array $recipients = null) : int{
if(!is_array($recipients)){ if(!is_array($recipients)){
return $this->broadcast($message, self::BROADCAST_CHANNEL_USERS); return $this->broadcast($message, self::BROADCAST_CHANNEL_USERS);
} }
@ -1670,15 +1678,14 @@ class Server{
/** /**
* @param string $tip * @param string $tip
* @param Player[]|null $recipients * @param Player[] $recipients
* *
* @return int * @return int
*/ */
public function broadcastTip($tip, $recipients = null){ public function broadcastTip(string $tip, array $recipients = null) : int{
if(!is_array($recipients)){ if(!is_array($recipients)){
/** @var Player[] $recipients */ /** @var Player[] $recipients */
$recipients = []; $recipients = [];
foreach($this->pluginManager->getPermissionSubscriptions(self::BROADCAST_CHANNEL_USERS) as $permissible){ foreach($this->pluginManager->getPermissionSubscriptions(self::BROADCAST_CHANNEL_USERS) as $permissible){
if($permissible instanceof Player and $permissible->hasPermission(self::BROADCAST_CHANNEL_USERS)){ if($permissible instanceof Player and $permissible->hasPermission(self::BROADCAST_CHANNEL_USERS)){
$recipients[spl_object_hash($permissible)] = $permissible; // do not send messages directly, or some might be repeated $recipients[spl_object_hash($permissible)] = $permissible; // do not send messages directly, or some might be repeated
@ -1696,11 +1703,11 @@ class Server{
/** /**
* @param string $popup * @param string $popup
* @param Player[]|null $recipients * @param Player[] $recipients
* *
* @return int * @return int
*/ */
public function broadcastPopup($popup, $recipients = null){ public function broadcastPopup(string $popup, array $recipients = null) : int{
if(!is_array($recipients)){ if(!is_array($recipients)){
/** @var Player[] $recipients */ /** @var Player[] $recipients */
$recipients = []; $recipients = [];
@ -1751,12 +1758,12 @@ class Server{
} }
/** /**
* @param string $message * @param TextContainer|string $message
* @param string $permissions * @param string $permissions
* *
* @return int * @return int
*/ */
public function broadcast($message, $permissions){ public function broadcast($message, string $permissions) : int{
/** @var CommandSender[] $recipients */ /** @var CommandSender[] $recipients */
$recipients = []; $recipients = [];
foreach(explode(";", $permissions) as $permission){ foreach(explode(";", $permissions) as $permission){
@ -1794,7 +1801,7 @@ class Server{
* @param bool $forceSync * @param bool $forceSync
* @param bool $immediate * @param bool $immediate
*/ */
public function batchPackets(array $players, array $packets, $forceSync = false, bool $immediate = false){ public function batchPackets(array $players, array $packets, bool $forceSync = false, bool $immediate = false){
Timings::$playerNetworkTimer->startTiming(); Timings::$playerNetworkTimer->startTiming();
$targets = []; $targets = [];
@ -1856,7 +1863,7 @@ class Server{
/** /**
* @param int $type * @param int $type
*/ */
public function enablePlugins($type){ public function enablePlugins(int $type){
foreach($this->pluginManager->getPlugins() as $plugin){ foreach($this->pluginManager->getPlugins() as $plugin){
if(!$plugin->isEnabled() and $plugin->getDescription()->getOrder() === $type){ if(!$plugin->isEnabled() and $plugin->getDescription()->getOrder() === $type){
$this->enablePlugin($plugin); $this->enablePlugin($plugin);
@ -1899,7 +1906,7 @@ class Server{
* *
* @return bool * @return bool
*/ */
public function dispatchCommand(CommandSender $sender, $commandLine){ public function dispatchCommand(CommandSender $sender, string $commandLine){
if($this->commandMap->dispatch($sender, $commandLine)){ if($this->commandMap->dispatch($sender, $commandLine)){
return true; return true;
} }
@ -2115,8 +2122,8 @@ class Server{
} }
$this->hasStopped = false; $this->hasStopped = false;
ini_set("error_reporting", 0); ini_set("error_reporting", '0');
ini_set("memory_limit", -1); //Fix error dump not dumped on memory problems ini_set("memory_limit", '-1'); //Fix error dump not dumped on memory problems
$this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.create")); $this->logger->emergency($this->getLanguage()->translateString("pocketmine.crash.create"));
try{ try{
$dump = new CrashDump($this); $dump = new CrashDump($this);
@ -2272,11 +2279,11 @@ class Server{
$this->getLogger()->debug("Raising level \"{$level->getName()}\" tick rate to {$level->getTickRate()} ticks"); $this->getLogger()->debug("Raising level \"{$level->getName()}\" tick rate to {$level->getTickRate()} ticks");
}elseif($tickMs >= 50){ }elseif($tickMs >= 50){
if($level->getTickRate() === $this->baseTickRate){ if($level->getTickRate() === $this->baseTickRate){
$level->setTickRate(max($this->baseTickRate + 1, min($this->autoTickRateLimit, floor($tickMs / 50)))); $level->setTickRate(max($this->baseTickRate + 1, min($this->autoTickRateLimit, (int) floor($tickMs / 50))));
$this->getLogger()->debug(sprintf("Level \"%s\" took %gms, setting tick rate to %d ticks", $level->getName(), round($tickMs, 2), $level->getTickRate())); $this->getLogger()->debug(sprintf("Level \"%s\" took %gms, setting tick rate to %d ticks", $level->getName(), (int) round($tickMs, 2), $level->getTickRate()));
}elseif(($tickMs / $level->getTickRate()) >= 50 and $level->getTickRate() < $this->autoTickRateLimit){ }elseif(($tickMs / $level->getTickRate()) >= 50 and $level->getTickRate() < $this->autoTickRateLimit){
$level->setTickRate($level->getTickRate() + 1); $level->setTickRate($level->getTickRate() + 1);
$this->getLogger()->debug(sprintf("Level \"%s\" took %gms, setting tick rate to %d ticks", $level->getName(), round($tickMs, 2), $level->getTickRate())); $this->getLogger()->debug(sprintf("Level \"%s\" took %gms, setting tick rate to %d ticks", $level->getName(), (int) round($tickMs, 2), $level->getTickRate()));
} }
$level->tickRateCounter = $level->getTickRate(); $level->tickRateCounter = $level->getTickRate();
} }
@ -2324,7 +2331,7 @@ class Server{
/** /**
* @return bool * @return bool
*/ */
public function isLanguageForced(){ public function isLanguageForced() : bool{
return $this->forceLanguage; return $this->forceLanguage;
} }
@ -2367,7 +2374,7 @@ class Server{
* *
* TODO: move this to Network * TODO: move this to Network
*/ */
public function handlePacket($address, $port, $payload){ public function handlePacket(string $address, int $port, string $payload){
try{ try{
if(strlen($payload) > 2 and substr($payload, 0, 2) === "\xfe\xfd" and $this->queryHandler instanceof QueryHandler){ if(strlen($payload) > 2 and substr($payload, 0, 2) === "\xfe\xfd" and $this->queryHandler instanceof QueryHandler){
$this->queryHandler->handle($address, $port, $payload); $this->queryHandler->handle($address, $port, $payload);

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
/** /**

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
class ThreadManager extends \Volatile{ class ThreadManager extends \Volatile{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine; namespace pocketmine;
/** /**

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
class AcaciaWoodStairs extends WoodStairs{ class AcaciaWoodStairs extends WoodStairs{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
class ActivatorRail extends Rail{ class ActivatorRail extends Rail{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\inventory\AnvilInventory; use pocketmine\inventory\AnvilInventory;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\event\TranslationContainer; use pocketmine\event\TranslationContainer;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
class BirchWoodStairs extends WoodStairs{ class BirchWoodStairs extends WoodStairs{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
/** /**
* All Block classes are in here * All Block classes are in here
*/ */

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
interface BlockIds{ interface BlockIds{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Tool; use pocketmine\item\Tool;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Tool; use pocketmine\item\Tool;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Tool; use pocketmine\item\Tool;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\entity\Effect; use pocketmine\entity\Effect;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Tool; use pocketmine\item\Tool;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
class CocoaBlock extends Solid{ class CocoaBlock extends Solid{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\event\block\BlockGrowEvent; use pocketmine\event\block\BlockGrowEvent;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
class DarkOakWoodStairs extends WoodStairs{ class DarkOakWoodStairs extends WoodStairs{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
class DaylightSensor extends Transparent{ class DaylightSensor extends Transparent{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\level\Level; use pocketmine\level\Level;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
class DetectorRail extends Rail{ class DetectorRail extends Rail{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\inventory\EnchantInventory; use pocketmine\inventory\EnchantInventory;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Tool; use pocketmine\item\Tool;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Tool; use pocketmine\item\Tool;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\entity\Arrow; use pocketmine\entity\Arrow;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
abstract class Flowable extends Transparent{ abstract class Flowable extends Transparent{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\event\block\BlockSpreadEvent; use pocketmine\event\block\BlockSpreadEvent;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Tool; use pocketmine\item\Tool;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Tool; use pocketmine\item\Tool;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
class JungleWoodStairs extends WoodStairs{ class JungleWoodStairs extends WoodStairs{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\item\Item; use pocketmine\item\Item;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\entity\Effect; use pocketmine\entity\Effect;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\event\block\LeavesDecayEvent; use pocketmine\event\block\LeavesDecayEvent;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\event\block\LeavesDecayEvent; use pocketmine\event\block\LeavesDecayEvent;

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
class Lever extends Flowable{ class Lever extends Flowable{

View File

@ -19,6 +19,8 @@
* *
*/ */
declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
use pocketmine\entity\Entity; use pocketmine\entity\Entity;

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