PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
|
Static Public Member Functions | |
static | getInstance () |
Public Attributes | |
const | BROADCAST_CHANNEL_ADMINISTRATIVE = "pocketmine.broadcast.admin" |
const | BROADCAST_CHANNEL_USERS = "pocketmine.broadcast.user" |
const | DEFAULT_MAX_PLAYERS = 20 |
const | DEFAULT_MAX_VIEW_DISTANCE = 16 |
const | DEFAULT_PORT_IPV4 = 19132 |
const | DEFAULT_PORT_IPV6 = 19133 |
const | DEFAULT_SERVER_NAME = VersionInfo::NAME . " Server" |
const | TARGET_NANOSECONDS_PER_TICK = 1_000_000_000 / self::TARGET_TICKS_PER_SECOND |
const | TARGET_SECONDS_PER_TICK = 1 / self::TARGET_TICKS_PER_SECOND |
const | TARGET_TICKS_PER_SECOND = 20 |
The class that manages everything
Definition at line 178 of file src/Server.php.
pocketmine\Server::__construct | ( | private ThreadSafeClassLoader | $autoloader, |
private AttachableThreadSafeLogger | $logger, | ||
string | $dataPath, | ||
string | $pluginPath ) |
Definition at line 766 of file src/Server.php.
pocketmine\Server::__debugInfo | ( | ) |
Definition at line 1683 of file src/Server.php.
pocketmine\Server::addOnlinePlayer | ( | Player | $player | ) |
Definition at line 1702 of file src/Server.php.
pocketmine\Server::addOp | ( | string | $name | ) |
Definition at line 687 of file src/Server.php.
pocketmine\Server::addWhitelist | ( | string | $name | ) |
Definition at line 711 of file src/Server.php.
pocketmine\Server::broadcastMessage | ( | Translatable|string | $message, |
?array | $recipients = null ) |
CommandSender[] | null | $recipients |
Definition at line 1291 of file src/Server.php.
pocketmine\Server::broadcastPopup | ( | string | $popup, |
?array | $recipients = null ) |
Player[] | null | $recipients |
Definition at line 1331 of file src/Server.php.
pocketmine\Server::broadcastTip | ( | string | $tip, |
?array | $recipients = null ) |
Player[] | null | $recipients |
Definition at line 1318 of file src/Server.php.
pocketmine\Server::broadcastTitle | ( | string | $title, |
string | $subtitle = "", | ||
int | $fadeIn = -1, | ||
int | $stay = -1, | ||
int | $fadeOut = -1, | ||
?array | $recipients = null ) |
int | $fadeIn | Duration in ticks for fade-in. If -1 is given, client-sided defaults will be used. |
int | $stay | Duration in ticks to stay on screen for |
int | $fadeOut | Duration in ticks for fade-out. |
Player[] | null | $recipients |
Definition at line 1347 of file src/Server.php.
pocketmine\Server::crashDump | ( | ) |
Definition at line 1593 of file src/Server.php.
pocketmine\Server::createPlayer | ( | NetworkSession | $session, |
PlayerInfo | $playerInfo, | ||
bool | $authenticated, | ||
?CompoundTag | $offlinePlayerData ) |
@phpstan-return Promise<Player>
Definition at line 556 of file src/Server.php.
pocketmine\Server::dispatchCommand | ( | CommandSender | $sender, |
string | $commandLine, | ||
bool | $internal = false ) |
Executes a command from a CommandSender
Definition at line 1420 of file src/Server.php.
pocketmine\Server::enablePlugins | ( | PluginEnableOrder | $type | ) |
Definition at line 1400 of file src/Server.php.
pocketmine\Server::exceptionHandler | ( | \Throwable | $e, |
?array | $trace = null ) |
mixed[][] | null | $trace | @phpstan-param list<array<string, mixed>>|null $trace |
Definition at line 1527 of file src/Server.php.
pocketmine\Server::forceShutdown | ( | ) |
Definition at line 1449 of file src/Server.php.
pocketmine\Server::getAllowedViewDistance | ( | int | $distance | ) |
Returns a view distance up to the currently-allowed limit.
Definition at line 375 of file src/Server.php.
pocketmine\Server::getApiVersion | ( | ) |
Definition at line 321 of file src/Server.php.
pocketmine\Server::getAsyncPool | ( | ) |
Definition at line 448 of file src/Server.php.
pocketmine\Server::getBroadcastChannelSubscribers | ( | string | $channelId | ) |
Returns a list of all the CommandSenders subscribed to the given broadcast channel.
Definition at line 1284 of file src/Server.php.
pocketmine\Server::getCommandAliases | ( | ) |
Definition at line 740 of file src/Server.php.
pocketmine\Server::getCommandMap | ( | ) |
Definition at line 488 of file src/Server.php.
pocketmine\Server::getConfigGroup | ( | ) |
Definition at line 663 of file src/Server.php.
pocketmine\Server::getCraftingManager | ( | ) |
Definition at line 436 of file src/Server.php.
pocketmine\Server::getDataPath | ( | ) |
Definition at line 333 of file src/Server.php.
pocketmine\Server::getDifficulty | ( | ) |
Returns Server global difficulty. Note that this may be overridden in individual worlds.
Definition at line 404 of file src/Server.php.
pocketmine\Server::getFilePath | ( | ) |
Definition at line 325 of file src/Server.php.
pocketmine\Server::getForceGamemode | ( | ) |
Definition at line 397 of file src/Server.php.
pocketmine\Server::getGamemode | ( | ) |
Definition at line 393 of file src/Server.php.
|
static |
Definition at line 759 of file src/Server.php.
pocketmine\Server::getIp | ( | ) |
Definition at line 379 of file src/Server.php.
pocketmine\Server::getIPBans | ( | ) |
Definition at line 683 of file src/Server.php.
pocketmine\Server::getIpV6 | ( | ) |
Definition at line 384 of file src/Server.php.
pocketmine\Server::getLanguage | ( | ) |
Definition at line 1753 of file src/Server.php.
pocketmine\Server::getLoader | ( | ) |
Definition at line 420 of file src/Server.php.
pocketmine\Server::getLogger | ( | ) |
Definition at line 424 of file src/Server.php.
pocketmine\Server::getMaxPlayers | ( | ) |
Definition at line 341 of file src/Server.php.
pocketmine\Server::getMemoryManager | ( | ) |
Definition at line 1765 of file src/Server.php.
pocketmine\Server::getMotd | ( | ) |
Definition at line 416 of file src/Server.php.
pocketmine\Server::getName | ( | ) |
Definition at line 305 of file src/Server.php.
pocketmine\Server::getNameBans | ( | ) |
Definition at line 679 of file src/Server.php.
pocketmine\Server::getNetwork | ( | ) |
Definition at line 1761 of file src/Server.php.
pocketmine\Server::getOfflinePlayer | ( | string | $name | ) |
Definition at line 503 of file src/Server.php.
pocketmine\Server::getOfflinePlayerData | ( | string | $name | ) |
Definition at line 521 of file src/Server.php.
pocketmine\Server::getOnlineMode | ( | ) |
Returns whether the server requires that players be authenticated to Xbox Live. If true, connecting players who are not logged into Xbox Live will be disconnected.
Definition at line 349 of file src/Server.php.
pocketmine\Server::getOnlinePlayers | ( | ) |
Definition at line 495 of file src/Server.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
pocketmine\Server::getOps | ( | ) |
Definition at line 733 of file src/Server.php.
pocketmine\Server::getPlayerByPrefix | ( | string | $name | ) |
Server::getOnlinePlayers()
yourself.Returns an online player whose name begins with or equals the given string (case insensitive). The closest match will be returned, or null if there are no online matches.
Definition at line 615 of file src/Server.php.
pocketmine\Server::getPlayerByRawUUID | ( | string | $rawUUID | ) |
Returns the player online with the specified raw UUID, or null if not found
Definition at line 652 of file src/Server.php.
pocketmine\Server::getPlayerByUUID | ( | UuidInterface | $uuid | ) |
Returns the player online with a UUID equivalent to the specified UuidInterface object, or null if not found
Definition at line 659 of file src/Server.php.
pocketmine\Server::getPlayerExact | ( | string | $name | ) |
Returns an online player with the given name (case insensitive), or null if not found.
Definition at line 638 of file src/Server.php.
pocketmine\Server::getPluginCommand | ( | string | $name | ) |
Definition at line 671 of file src/Server.php.
pocketmine\Server::getPluginManager | ( | ) |
Definition at line 432 of file src/Server.php.
pocketmine\Server::getPluginPath | ( | ) |
Definition at line 337 of file src/Server.php.
pocketmine\Server::getPocketMineVersion | ( | ) |
Definition at line 313 of file src/Server.php.
pocketmine\Server::getPort | ( | ) |
Definition at line 360 of file src/Server.php.
pocketmine\Server::getPortV6 | ( | ) |
Definition at line 364 of file src/Server.php.
pocketmine\Server::getQueryInformation | ( | ) |
Definition at line 1519 of file src/Server.php.
pocketmine\Server::getResourcePackManager | ( | ) |
Definition at line 440 of file src/Server.php.
pocketmine\Server::getResourcePath | ( | ) |
Definition at line 329 of file src/Server.php.
pocketmine\Server::getServerUniqueId | ( | ) |
Definition at line 389 of file src/Server.php.
pocketmine\Server::getStartTime | ( | ) |
Definition at line 484 of file src/Server.php.
pocketmine\Server::getTick | ( | ) |
Definition at line 452 of file src/Server.php.
pocketmine\Server::getTickSleeper | ( | ) |
Definition at line 1687 of file src/Server.php.
pocketmine\Server::getTicksPerSecond | ( | ) |
Returns the last server TPS measure
Definition at line 459 of file src/Server.php.
pocketmine\Server::getTicksPerSecondAverage | ( | ) |
Returns the last server TPS average measure
Definition at line 466 of file src/Server.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
pocketmine\Server::getTickUsage | ( | ) |
Returns the TPS usage/load in %
Definition at line 473 of file src/Server.php.
pocketmine\Server::getTickUsageAverage | ( | ) |
Returns the TPS usage/load average in %
Definition at line 480 of file src/Server.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
pocketmine\Server::getUpdater | ( | ) |
Definition at line 428 of file src/Server.php.
pocketmine\Server::getVersion | ( | ) |
Definition at line 317 of file src/Server.php.
pocketmine\Server::getViewDistance | ( | ) |
Definition at line 368 of file src/Server.php.
pocketmine\Server::getWhitelisted | ( | ) |
Definition at line 729 of file src/Server.php.
pocketmine\Server::getWorldManager | ( | ) |
Definition at line 444 of file src/Server.php.
pocketmine\Server::hasOfflinePlayerData | ( | string | $name | ) |
Returns whether the server has stored any saved data for this player.
Definition at line 517 of file src/Server.php.
pocketmine\Server::hasWhitelist | ( | ) |
Definition at line 408 of file src/Server.php.
pocketmine\Server::isHardcore | ( | ) |
Definition at line 412 of file src/Server.php.
pocketmine\Server::isLanguageForced | ( | ) |
Definition at line 1757 of file src/Server.php.
pocketmine\Server::isOp | ( | string | $name | ) |
Definition at line 725 of file src/Server.php.
pocketmine\Server::isRunning | ( | ) |
Definition at line 309 of file src/Server.php.
pocketmine\Server::isWhitelisted | ( | string | $name | ) |
Definition at line 721 of file src/Server.php.
pocketmine\Server::prepareBatch | ( | string | $buffer, |
Compressor | $compressor, | ||
?bool | $sync = null, | ||
?TimingsHandler | $timings = null ) |
Definition at line 1370 of file src/Server.php.
pocketmine\Server::removeOnlinePlayer | ( | Player | $player | ) |
Definition at line 1737 of file src/Server.php.
pocketmine\Server::removeOp | ( | string | $name | ) |
Definition at line 696 of file src/Server.php.
pocketmine\Server::removeWhitelist | ( | string | $name | ) |
Definition at line 716 of file src/Server.php.
pocketmine\Server::requiresAuthentication | ( | ) |
Alias of getOnlineMode()
.
Definition at line 356 of file src/Server.php.
pocketmine\Server::saveOfflinePlayerData | ( | string | $name, |
CompoundTag | $nbtTag ) |
Definition at line 533 of file src/Server.php.
pocketmine\Server::sendUsage | ( | int | $type = SendUsageTask::TYPE_STATUS | ) |
Definition at line 1746 of file src/Server.php.
pocketmine\Server::shouldSavePlayerData | ( | ) |
Definition at line 499 of file src/Server.php.
pocketmine\Server::shutdown | ( | ) |
Shuts the server down correctly
Definition at line 1437 of file src/Server.php.
pocketmine\Server::subscribeToBroadcastChannel | ( | string | $channelId, |
CommandSender | $subscriber ) |
Subscribes to a particular message broadcast channel. The channel ID can be any arbitrary string.
Definition at line 1252 of file src/Server.php.
pocketmine\Server::unsubscribeFromAllBroadcastChannels | ( | CommandSender | $subscriber | ) |
Unsubscribes from all broadcast channels.
Definition at line 1272 of file src/Server.php.
pocketmine\Server::unsubscribeFromBroadcastChannel | ( | string | $channelId, |
CommandSender | $subscriber ) |
Unsubscribes from a particular message broadcast channel.
Definition at line 1259 of file src/Server.php.
const pocketmine\Server::BROADCAST_CHANNEL_ADMINISTRATIVE = "pocketmine.broadcast.admin" |
Definition at line 182 of file src/Server.php.
const pocketmine\Server::BROADCAST_CHANNEL_USERS = "pocketmine.broadcast.user" |
Definition at line 183 of file src/Server.php.
const pocketmine\Server::DEFAULT_MAX_PLAYERS = 20 |
Definition at line 186 of file src/Server.php.
const pocketmine\Server::DEFAULT_MAX_VIEW_DISTANCE = 16 |
Definition at line 189 of file src/Server.php.
const pocketmine\Server::DEFAULT_PORT_IPV4 = 19132 |
Definition at line 187 of file src/Server.php.
const pocketmine\Server::DEFAULT_PORT_IPV6 = 19133 |
Definition at line 188 of file src/Server.php.
const pocketmine\Server::DEFAULT_SERVER_NAME = VersionInfo::NAME . " Server" |
Definition at line 185 of file src/Server.php.
const pocketmine\Server::TARGET_NANOSECONDS_PER_TICK = 1_000_000_000 / self::TARGET_TICKS_PER_SECOND |
Definition at line 201 of file src/Server.php.
const pocketmine\Server::TARGET_SECONDS_PER_TICK = 1 / self::TARGET_TICKS_PER_SECOND |
The average time between ticks, in seconds.
Definition at line 200 of file src/Server.php.
const pocketmine\Server::TARGET_TICKS_PER_SECOND = 20 |
Worlds, network, commands and most other things are polled this many times per second on average. Between ticks, the server will sleep to ensure that the average tick rate is maintained. It may wake up between ticks if a Snooze notification source is triggered (e.g. to process network packets).
Definition at line 196 of file src/Server.php.