PocketMine-MP  1.4 - API 1.10.0
 All Classes Namespaces Functions Variables Pages
pocketmine\Server Class Reference
+ Collaboration diagram for pocketmine\Server:

Public Member Functions

 getName ()
 
 isRunning ()
 
 getPocketMineVersion ()
 
 getCodename ()
 
 getVersion ()
 
 getApiVersion ()
 
 getFilePath ()
 
 getDataPath ()
 
 getPluginPath ()
 
 getMaxPlayers ()
 
 getPort ()
 
 getViewDistance ()
 
 getIp ()
 
 getServerName ()
 
 getAutoSave ()
 
 setAutoSave ($value)
 
 getLevelType ()
 
 getGenerateStructures ()
 
 getGamemode ()
 
 getForceGamemode ()
 
 getDifficulty ()
 
 hasWhitelist ()
 
 getSpawnRadius ()
 
 getAllowFlight ()
 
 isHardcore ()
 
 getDefaultGamemode ()
 
 getMotd ()
 
 getLoader ()
 
 getLogger ()
 
 getEntityMetadata ()
 
 getPlayerMetadata ()
 
 getLevelMetadata ()
 
 getUpdater ()
 
 getPluginManager ()
 
 getCraftingManager ()
 
 getScheduler ()
 
 getGenerationManager ()
 
 getTick ()
 
 getTicksPerSecond ()
 
 getTickUsage ()
 
 getInterfaces ()
 
 addInterface (SourceInterface $interface)
 
 removeInterface (SourceInterface $interface)
 
 sendPacket ($address, $port, $payload)
 
 blockAddress ($address, $timeout=300)
 
 handlePacket ($address, $port, $payload)
 
 getCommandMap ()
 
 getOnlinePlayers ()
 
 addRecipe (Recipe $recipe)
 
 getOfflinePlayer ($name)
 
 getOfflinePlayerData ($name)
 
 saveOfflinePlayerData ($name, Compound $nbtTag)
 
 getPlayer ($name)
 
 getPlayerExact ($name)
 
 matchPlayer ($partialName)
 
 removePlayer (Player $player)
 
 getLevels ()
 
 getDefaultLevel ()
 
 setDefaultLevel ($level)
 
 isLevelLoaded ($name)
 
 getLevel ($levelId)
 
 getLevelByName ($name)
 
 unloadLevel (Level $level, $forceUnload=false)
 
 loadLevel ($name)
 
 isLevelGenerated ($name)
 
 getConfigString ($variable, $defaultValue="")
 
 getProperty ($variable, $defaultValue=null)
 
 setConfigString ($variable, $value)
 
 getConfigInt ($variable, $defaultValue=0)
 
 setConfigInt ($variable, $value)
 
 getConfigBoolean ($variable, $defaultValue=false)
 
 setConfigBool ($variable, $value)
 
 getPluginCommand ($name)
 
 getNameBans ()
 
 getIPBans ()
 
 addOp ($name)
 
 removeOp ($name)
 
 addWhitelist ($name)
 
 removeWhitelist ($name)
 
 isWhitelisted ($name)
 
 isOp ($name)
 
 getWhitelisted ()
 
 getOps ()
 
 reloadWhitelist ()
 
 getCommandAliases ()
 
 __construct (\ClassLoader $autoloader,\ThreadedLogger $logger, $filePath, $dataPath, $pluginPath)
 
 broadcastMessage ($message, $recipients=null)
 
 enablePlugins ($type)
 
 enablePlugin (Plugin $plugin)
 
 loadPlugin (Plugin $plugin)
 
 disablePlugins ()
 
 checkConsole ()
 
 dispatchCommand (CommandSender $sender, $commandLine)
 
 reload ()
 
 shutdown ()
 
 forceShutdown ()
 
 start ()
 
 handleSignal ($signo)
 
 checkTicks ()
 
 checkMemory ()
 
 exceptionHandler (\Exception $e, $trace=null)
 
 crashDump ()
 
 __debugInfo ()
 
 addPlayer ($identifier, Player $player)
 
 doAutoSave ()
 
 doLevelGC ()
 
 sendUsage ()
 

Static Public Member Functions

static getGamemodeString ($mode)
 
static getGamemodeFromString ($str)
 
static getDifficultyFromString ($str)
 
static getInstance ()
 
static broadcastPacket (array $players, DataPacket $packet)
 

Public Attributes

const BROADCAST_CHANNEL_ADMINISTRATIVE = "pocketmine.broadcast.admin"
 
const BROADCAST_CHANNEL_USERS = "pocketmine.broadcast.user"
 

Detailed Description

The class that manages everything

Definition at line 110 of file Server.php.

Constructor & Destructor Documentation

pocketmine\Server::__construct ( \ClassLoader  $autoloader,
\ThreadedLogger  $logger,
  $filePath,
  $dataPath,
  $pluginPath 
)
Parameters
\ClassLoader$autoloader
\ThreadedLogger$logger
string$filePath
string$dataPath
string$pluginPath

Definition at line 1455 of file Server.php.

Member Function Documentation

pocketmine\Server::addInterface ( SourceInterface  $interface)
Parameters
SourceInterface$interface

Definition at line 604 of file Server.php.

pocketmine\Server::addOp (   $name)
Parameters
string$name

Definition at line 1346 of file Server.php.

pocketmine\Server::addWhitelist (   $name)
Parameters
string$name

Definition at line 1370 of file Server.php.

pocketmine\Server::blockAddress (   $address,
  $timeout = 300 
)

Blocks an IP address from the main interface. Setting timeout to -1 will block it forever

Parameters
string$address
int$timeout

Definition at line 631 of file Server.php.

pocketmine\Server::broadcastMessage (   $message,
  $recipients = null 
)
Parameters
$message
Player[]|null$recipients
Returns
int

Definition at line 1686 of file Server.php.

static pocketmine\Server::broadcastPacket ( array  $players,
DataPacket  $packet 
)
static

Broadcasts a Minecraft packet to a list of players

Parameters
Player[]$players
DataPacket$packet

Definition at line 1725 of file Server.php.

Referenced by pocketmine\inventory\ChestInventory\onClose(), pocketmine\inventory\DoubleChestInventory\onClose(), pocketmine\inventory\ChestInventory\onOpen(), pocketmine\inventory\DoubleChestInventory\onOpen(), pocketmine\level\Level\sendTime(), and pocketmine\level\Level\setBlock().

+ Here is the caller graph for this function:

pocketmine\Server::dispatchCommand ( CommandSender  $sender,
  $commandLine 
)

Executes a command from a CommandSender

Parameters
CommandSender$sender
string$commandLine
Returns
bool
Exceptions
\Exception

Definition at line 1794 of file Server.php.

References pocketmine\command\CommandSender\sendMessage().

+ Here is the call graph for this function:

pocketmine\Server::enablePlugin ( Plugin  $plugin)
Parameters
Plugin$plugin

Definition at line 1756 of file Server.php.

pocketmine\Server::enablePlugins (   $type)
Parameters
int$type

Definition at line 1740 of file Server.php.

pocketmine\Server::getAllowFlight ( )
Returns
bool

Definition at line 474 of file Server.php.

pocketmine\Server::getApiVersion ( )
Returns
string

Definition at line 260 of file Server.php.

pocketmine\Server::getAutoSave ( )
Returns
bool

Definition at line 323 of file Server.php.

pocketmine\Server::getCodename ( )
Returns
string

Definition at line 246 of file Server.php.

pocketmine\Server::getCommandAliases ( )
Returns
string[]

Definition at line 1422 of file Server.php.

pocketmine\Server::getCommandMap ( )
Returns
SimpleCommandMap

Definition at line 660 of file Server.php.

pocketmine\Server::getConfigBoolean (   $variable,
  $defaultValue = false 
)
Parameters
string$variable
boolean$defaultValue
Returns
boolean

Definition at line 1286 of file Server.php.

pocketmine\Server::getConfigInt (   $variable,
  $defaultValue = 0 
)
Parameters
string$variable
int$defaultValue
Returns
int

Definition at line 1263 of file Server.php.

pocketmine\Server::getConfigString (   $variable,
  $defaultValue = "" 
)
Parameters
string$variable
string$defaultValue
Returns
string

Definition at line 1228 of file Server.php.

pocketmine\Server::getCraftingManager ( )
Returns
CraftingManager

Definition at line 551 of file Server.php.

pocketmine\Server::getDataPath ( )
Returns
string

Definition at line 274 of file Server.php.

pocketmine\Server::getDefaultGamemode ( )
Returns
int

Definition at line 488 of file Server.php.

pocketmine\Server::getDefaultLevel ( )
Returns
Level

Definition at line 900 of file Server.php.

pocketmine\Server::getDifficulty ( )
Returns
int

Definition at line 453 of file Server.php.

static pocketmine\Server::getDifficultyFromString (   $str)
static
Parameters
string$str
Returns
int

Definition at line 425 of file Server.php.

pocketmine\Server::getEntityMetadata ( )
Returns
EntityMetadataStore

Definition at line 516 of file Server.php.

pocketmine\Server::getFilePath ( )
Returns
string

Definition at line 267 of file Server.php.

pocketmine\Server::getForceGamemode ( )
Returns
bool

Definition at line 361 of file Server.php.

pocketmine\Server::getGamemode ( )
Returns
int

Definition at line 354 of file Server.php.

static pocketmine\Server::getGamemodeFromString (   $str)
static

Parses a string and returns a gamemode integer, -1 if not found

Parameters
string$str
Returns
int

Definition at line 394 of file Server.php.

static pocketmine\Server::getGamemodeString (   $mode)
static

Returns the gamemode text name

Parameters
int$mode
Returns
string

Definition at line 372 of file Server.php.

pocketmine\Server::getGenerateStructures ( )
Returns
bool

Definition at line 347 of file Server.php.

pocketmine\Server::getGenerationManager ( )
Returns
GenerationRequestManager

Definition at line 565 of file Server.php.

pocketmine\Server::getInterfaces ( )
Returns
SourceInterface[]

Definition at line 597 of file Server.php.

pocketmine\Server::getIp ( )
Returns
string

Definition at line 309 of file Server.php.

pocketmine\Server::getIPBans ( )
Returns
BanList

Definition at line 1339 of file Server.php.

pocketmine\Server::getLevel (   $levelId)
Parameters
int$levelId
Returns
Level

Definition at line 931 of file Server.php.

pocketmine\Server::getLevelByName (   $name)
Parameters
$name
Returns
Level

Definition at line 944 of file Server.php.

pocketmine\Server::getLevelMetadata ( )
Returns
LevelMetadataStore

Definition at line 530 of file Server.php.

pocketmine\Server::getLevels ( )
Returns
Level[]

Definition at line 893 of file Server.php.

pocketmine\Server::getLevelType ( )
Returns
string

Definition at line 340 of file Server.php.

pocketmine\Server::getLoader ( )
Returns

Definition at line 502 of file Server.php.

Referenced by pocketmine\level\generator\GenerationRequestManager\__construct().

+ Here is the caller graph for this function:

pocketmine\Server::getLogger ( )
Returns

Definition at line 509 of file Server.php.

Referenced by pocketmine\level\generator\GenerationRequestManager\__construct().

+ Here is the caller graph for this function:

pocketmine\Server::getMaxPlayers ( )
Returns
int

Definition at line 288 of file Server.php.

pocketmine\Server::getMotd ( )
Returns
string

Definition at line 495 of file Server.php.

pocketmine\Server::getName ( )
Returns
string

Definition at line 225 of file Server.php.

pocketmine\Server::getNameBans ( )
Returns
BanList

Definition at line 1332 of file Server.php.

pocketmine\Server::getOfflinePlayer (   $name)
Parameters
string$name
Returns
OfflinePlayer|Player

Definition at line 680 of file Server.php.

pocketmine\Server::getOfflinePlayerData (   $name)
Parameters
string$name
Returns
Compound

Definition at line 696 of file Server.php.

Referenced by pocketmine\OfflinePlayer\__construct().

+ Here is the caller graph for this function:

pocketmine\Server::getOnlinePlayers ( )
Returns
Player[]

Definition at line 667 of file Server.php.

pocketmine\Server::getOps ( )
Returns
Config

Definition at line 1411 of file Server.php.

pocketmine\Server::getPlayer (   $name)
Parameters
string$name
Returns
Player

Definition at line 822 of file Server.php.

pocketmine\Server::getPlayerExact (   $name)
Parameters
string$name
Returns
Player

Definition at line 847 of file Server.php.

pocketmine\Server::getPlayerMetadata ( )
Returns
PlayerMetadataStore

Definition at line 523 of file Server.php.

pocketmine\Server::getPluginCommand (   $name)
Parameters
string$name
Returns
PluginIdentifiableCommand

Definition at line 1321 of file Server.php.

pocketmine\Server::getPluginManager ( )
Returns
PluginManager

Definition at line 544 of file Server.php.

pocketmine\Server::getPluginPath ( )
Returns
string

Definition at line 281 of file Server.php.

pocketmine\Server::getPocketMineVersion ( )
Returns
string

Definition at line 239 of file Server.php.

pocketmine\Server::getPort ( )
Returns
int

Definition at line 295 of file Server.php.

pocketmine\Server::getProperty (   $variable,
  $defaultValue = null 
)
Parameters
string$variable
mixed$defaultValue
Returns
mixed

Definition at line 1243 of file Server.php.

pocketmine\Server::getScheduler ( )
Returns
ServerScheduler

Definition at line 558 of file Server.php.

pocketmine\Server::getServerName ( )
Returns
string

Definition at line 316 of file Server.php.

pocketmine\Server::getSpawnRadius ( )
Returns
int

Definition at line 467 of file Server.php.

pocketmine\Server::getTick ( )
Returns
int

Definition at line 572 of file Server.php.

pocketmine\Server::getTicksPerSecond ( )

Returns the last server TPS measure

Returns
float

Definition at line 581 of file Server.php.

pocketmine\Server::getTickUsage ( )

Returns the TPS usage/load in %

Returns
float

Definition at line 590 of file Server.php.

pocketmine\Server::getUpdater ( )
Returns
AutoUpdater

Definition at line 537 of file Server.php.

pocketmine\Server::getVersion ( )
Returns
string

Definition at line 253 of file Server.php.

pocketmine\Server::getViewDistance ( )
Returns
int

Definition at line 302 of file Server.php.

pocketmine\Server::getWhitelisted ( )
Returns
Config

Definition at line 1404 of file Server.php.

pocketmine\Server::handlePacket (   $address,
  $port,
  $payload 
)
Parameters
string$address
int$port
string$payload

Definition at line 640 of file Server.php.

pocketmine\Server::hasWhitelist ( )
Returns
bool

Definition at line 460 of file Server.php.

pocketmine\Server::isHardcore ( )
Returns
bool

Definition at line 481 of file Server.php.

pocketmine\Server::isLevelGenerated (   $name)
Parameters
string$name
Returns
bool

Definition at line 1199 of file Server.php.

pocketmine\Server::isLevelLoaded (   $name)
Parameters
string$name
Returns
bool

Definition at line 922 of file Server.php.

pocketmine\Server::isOp (   $name)
Parameters
string$name
Returns
bool

Definition at line 1397 of file Server.php.

pocketmine\Server::isRunning ( )
Returns
bool

Definition at line 232 of file Server.php.

pocketmine\Server::isWhitelisted (   $name)
Parameters
string$name
Returns
bool

Definition at line 1388 of file Server.php.

pocketmine\Server::loadLevel (   $name)

Loads a level from the data directory

Parameters
string$name
Returns
bool
Exceptions
LevelException

Definition at line 979 of file Server.php.

pocketmine\Server::loadPlugin ( Plugin  $plugin)
Parameters
Plugin$plugin
Deprecated:

Definition at line 1765 of file Server.php.

pocketmine\Server::matchPlayer (   $partialName)
Parameters
string$partialName
Returns
Player[]

Definition at line 863 of file Server.php.

pocketmine\Server::removeInterface ( SourceInterface  $interface)
Parameters
SourceInterface$interface

Definition at line 611 of file Server.php.

pocketmine\Server::removeOp (   $name)
Parameters
string$name

Definition at line 1358 of file Server.php.

pocketmine\Server::removePlayer ( Player  $player)
Parameters
Player$player

Definition at line 881 of file Server.php.

pocketmine\Server::removeWhitelist (   $name)
Parameters
string$name

Definition at line 1378 of file Server.php.

pocketmine\Server::saveOfflinePlayerData (   $name,
Compound  $nbtTag 
)
Parameters
string$name
Compound$nbtTag

Definition at line 811 of file Server.php.

pocketmine\Server::sendPacket (   $address,
  $port,
  $payload 
)
Parameters
string$address
int$port
string$payload

Definition at line 621 of file Server.php.

pocketmine\Server::setAutoSave (   $value)
Parameters
bool$value

Definition at line 330 of file Server.php.

pocketmine\Server::setConfigBool (   $variable,
  $value 
)
Parameters
string$variable
bool$value

Definition at line 1312 of file Server.php.

pocketmine\Server::setConfigInt (   $variable,
  $value 
)
Parameters
string$variable
int$value

Definition at line 1276 of file Server.php.

pocketmine\Server::setConfigString (   $variable,
  $value 
)
Parameters
string$variable
string$value

Definition at line 1253 of file Server.php.

pocketmine\Server::setDefaultLevel (   $level)

Sets the default level to a different level This won't change the level-name property, it only affects the server on runtime

Parameters
Level$level

Definition at line 911 of file Server.php.

pocketmine\Server::shutdown ( )

Shutdowns the server correctly

Definition at line 1861 of file Server.php.

pocketmine\Server::start ( )

Starts the PocketMine-MP server and starts processing ticks and packets

Definition at line 1920 of file Server.php.

pocketmine\Server::unloadLevel ( Level  $level,
  $forceUnload = false 
)
Parameters
Level$level
bool$forceUnload
Returns
bool

Definition at line 960 of file Server.php.

References pocketmine\level\Level\getId(), and pocketmine\level\Level\unload().

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: