PocketMine-MP 5.23.3 git-976fc63567edab7a6fb6aeae739f43cf9fe57de4
|
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 182 of file src/Server.php.
pocketmine\Server::__construct | ( | private ThreadSafeClassLoader | $autoloader, |
private AttachableThreadSafeLogger | $logger, | ||
string | $dataPath, | ||
string | $pluginPath ) |
Definition at line 777 of file src/Server.php.
pocketmine\Server::__debugInfo | ( | ) |
Definition at line 1730 of file src/Server.php.
pocketmine\Server::addOnlinePlayer | ( | Player | $player | ) |
Definition at line 1749 of file src/Server.php.
pocketmine\Server::addOp | ( | string | $name | ) |
Definition at line 695 of file src/Server.php.
pocketmine\Server::addWhitelist | ( | string | $name | ) |
Definition at line 719 of file src/Server.php.
pocketmine\Server::broadcastMessage | ( | Translatable|string | $message, |
?array | $recipients = null ) |
CommandSender[] | null | $recipients |
Definition at line 1338 of file src/Server.php.
pocketmine\Server::broadcastPopup | ( | string | $popup, |
?array | $recipients = null ) |
Player[] | null | $recipients |
Definition at line 1378 of file src/Server.php.
pocketmine\Server::broadcastTip | ( | string | $tip, |
?array | $recipients = null ) |
Player[] | null | $recipients |
Definition at line 1365 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 1394 of file src/Server.php.
pocketmine\Server::crashDump | ( | ) |
Definition at line 1640 of file src/Server.php.
pocketmine\Server::createPlayer | ( | NetworkSession | $session, |
PlayerInfo | $playerInfo, | ||
bool | $authenticated, | ||
?CompoundTag | $offlinePlayerData ) |
@phpstan-return Promise<Player>
Definition at line 564 of file src/Server.php.
pocketmine\Server::dispatchCommand | ( | CommandSender | $sender, |
string | $commandLine, | ||
bool | $internal = false ) |
Executes a command from a CommandSender
Definition at line 1467 of file src/Server.php.
pocketmine\Server::enablePlugins | ( | PluginEnableOrder | $type | ) |
Definition at line 1447 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 1574 of file src/Server.php.
pocketmine\Server::forceShutdown | ( | ) |
Definition at line 1496 of file src/Server.php.
pocketmine\Server::getAllowedViewDistance | ( | int | $distance | ) |
Returns a view distance up to the currently-allowed limit.
Definition at line 383 of file src/Server.php.
pocketmine\Server::getApiVersion | ( | ) |
Definition at line 325 of file src/Server.php.
pocketmine\Server::getAsyncPool | ( | ) |
Definition at line 456 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 1331 of file src/Server.php.
pocketmine\Server::getCommandAliases | ( | ) |
Definition at line 749 of file src/Server.php.
pocketmine\Server::getCommandMap | ( | ) |
Definition at line 496 of file src/Server.php.
pocketmine\Server::getConfigGroup | ( | ) |
Definition at line 671 of file src/Server.php.
pocketmine\Server::getCraftingManager | ( | ) |
Definition at line 444 of file src/Server.php.
pocketmine\Server::getDataPath | ( | ) |
Definition at line 337 of file src/Server.php.
pocketmine\Server::getDifficulty | ( | ) |
Returns Server global difficulty. Note that this may be overridden in individual worlds.
Definition at line 412 of file src/Server.php.
pocketmine\Server::getFilePath | ( | ) |
Definition at line 329 of file src/Server.php.
pocketmine\Server::getForceGamemode | ( | ) |
Definition at line 405 of file src/Server.php.
pocketmine\Server::getGamemode | ( | ) |
Definition at line 401 of file src/Server.php.
|
static |
Definition at line 770 of file src/Server.php.
pocketmine\Server::getIp | ( | ) |
Definition at line 387 of file src/Server.php.
pocketmine\Server::getIPBans | ( | ) |
Definition at line 691 of file src/Server.php.
pocketmine\Server::getIpV6 | ( | ) |
Definition at line 392 of file src/Server.php.
pocketmine\Server::getLanguage | ( | ) |
Definition at line 1800 of file src/Server.php.
pocketmine\Server::getLoader | ( | ) |
Definition at line 428 of file src/Server.php.
pocketmine\Server::getLogger | ( | ) |
Definition at line 432 of file src/Server.php.
pocketmine\Server::getMaxPlayers | ( | ) |
Definition at line 345 of file src/Server.php.
pocketmine\Server::getMemoryManager | ( | ) |
Definition at line 1812 of file src/Server.php.
pocketmine\Server::getMotd | ( | ) |
Definition at line 424 of file src/Server.php.
pocketmine\Server::getName | ( | ) |
Definition at line 309 of file src/Server.php.
pocketmine\Server::getNameBans | ( | ) |
Definition at line 687 of file src/Server.php.
pocketmine\Server::getNetwork | ( | ) |
Definition at line 1808 of file src/Server.php.
pocketmine\Server::getOfflinePlayer | ( | string | $name | ) |
Definition at line 511 of file src/Server.php.
pocketmine\Server::getOfflinePlayerData | ( | string | $name | ) |
Definition at line 529 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 357 of file src/Server.php.
pocketmine\Server::getOnlinePlayers | ( | ) |
Definition at line 503 of file src/Server.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
pocketmine\Server::getOps | ( | ) |
Definition at line 741 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 623 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 660 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 667 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 646 of file src/Server.php.
pocketmine\Server::getPluginCommand | ( | string | $name | ) |
Definition at line 679 of file src/Server.php.
pocketmine\Server::getPluginManager | ( | ) |
Definition at line 440 of file src/Server.php.
pocketmine\Server::getPluginPath | ( | ) |
Definition at line 341 of file src/Server.php.
pocketmine\Server::getPocketMineVersion | ( | ) |
Definition at line 317 of file src/Server.php.
pocketmine\Server::getPort | ( | ) |
Definition at line 368 of file src/Server.php.
pocketmine\Server::getPortV6 | ( | ) |
Definition at line 372 of file src/Server.php.
pocketmine\Server::getQueryInformation | ( | ) |
Definition at line 1566 of file src/Server.php.
pocketmine\Server::getResourcePackManager | ( | ) |
Definition at line 448 of file src/Server.php.
pocketmine\Server::getResourcePath | ( | ) |
Definition at line 333 of file src/Server.php.
pocketmine\Server::getServerUniqueId | ( | ) |
Definition at line 397 of file src/Server.php.
pocketmine\Server::getStartTime | ( | ) |
Definition at line 492 of file src/Server.php.
pocketmine\Server::getTick | ( | ) |
Definition at line 460 of file src/Server.php.
pocketmine\Server::getTickSleeper | ( | ) |
Definition at line 1734 of file src/Server.php.
pocketmine\Server::getTicksPerSecond | ( | ) |
Returns the last server TPS measure
Definition at line 467 of file src/Server.php.
pocketmine\Server::getTicksPerSecondAverage | ( | ) |
Returns the last server TPS average measure
Definition at line 474 of file src/Server.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
pocketmine\Server::getTickUsage | ( | ) |
Returns the TPS usage/load in %
Definition at line 481 of file src/Server.php.
pocketmine\Server::getTickUsageAverage | ( | ) |
Returns the TPS usage/load average in %
Definition at line 488 of file src/Server.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
pocketmine\Server::getUpdater | ( | ) |
Definition at line 436 of file src/Server.php.
pocketmine\Server::getVersion | ( | ) |
Definition at line 321 of file src/Server.php.
pocketmine\Server::getViewDistance | ( | ) |
Definition at line 376 of file src/Server.php.
pocketmine\Server::getWhitelisted | ( | ) |
Definition at line 737 of file src/Server.php.
pocketmine\Server::getWorldManager | ( | ) |
Definition at line 452 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 525 of file src/Server.php.
pocketmine\Server::hasWhitelist | ( | ) |
Definition at line 416 of file src/Server.php.
pocketmine\Server::isHardcore | ( | ) |
Definition at line 420 of file src/Server.php.
pocketmine\Server::isLanguageForced | ( | ) |
Definition at line 1804 of file src/Server.php.
pocketmine\Server::isOp | ( | string | $name | ) |
Definition at line 733 of file src/Server.php.
pocketmine\Server::isRunning | ( | ) |
Definition at line 313 of file src/Server.php.
pocketmine\Server::isWhitelisted | ( | string | $name | ) |
Definition at line 729 of file src/Server.php.
pocketmine\Server::prepareBatch | ( | string | $buffer, |
Compressor | $compressor, | ||
?bool | $sync = null, | ||
?TimingsHandler | $timings = null ) |
Definition at line 1417 of file src/Server.php.
pocketmine\Server::removeOnlinePlayer | ( | Player | $player | ) |
Definition at line 1784 of file src/Server.php.
pocketmine\Server::removeOp | ( | string | $name | ) |
Definition at line 704 of file src/Server.php.
pocketmine\Server::removeWhitelist | ( | string | $name | ) |
Definition at line 724 of file src/Server.php.
pocketmine\Server::requiresAuthentication | ( | ) |
Alias of getOnlineMode()
.
Definition at line 364 of file src/Server.php.
pocketmine\Server::saveOfflinePlayerData | ( | string | $name, |
CompoundTag | $nbtTag ) |
Definition at line 541 of file src/Server.php.
pocketmine\Server::sendUsage | ( | int | $type = SendUsageTask::TYPE_STATUS | ) |
Definition at line 1793 of file src/Server.php.
pocketmine\Server::setMaxPlayers | ( | int | $maxPlayers | ) |
Definition at line 349 of file src/Server.php.
pocketmine\Server::shouldSavePlayerData | ( | ) |
Definition at line 507 of file src/Server.php.
pocketmine\Server::shutdown | ( | ) |
Shuts the server down correctly
Definition at line 1484 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 1299 of file src/Server.php.
pocketmine\Server::unsubscribeFromAllBroadcastChannels | ( | CommandSender | $subscriber | ) |
Unsubscribes from all broadcast channels.
Definition at line 1319 of file src/Server.php.
pocketmine\Server::unsubscribeFromBroadcastChannel | ( | string | $channelId, |
CommandSender | $subscriber ) |
Unsubscribes from a particular message broadcast channel.
Definition at line 1306 of file src/Server.php.
const pocketmine\Server::BROADCAST_CHANNEL_ADMINISTRATIVE = "pocketmine.broadcast.admin" |
Definition at line 186 of file src/Server.php.
const pocketmine\Server::BROADCAST_CHANNEL_USERS = "pocketmine.broadcast.user" |
Definition at line 187 of file src/Server.php.
const pocketmine\Server::DEFAULT_MAX_PLAYERS = 20 |
Definition at line 190 of file src/Server.php.
const pocketmine\Server::DEFAULT_MAX_VIEW_DISTANCE = 16 |
Definition at line 193 of file src/Server.php.
const pocketmine\Server::DEFAULT_PORT_IPV4 = 19132 |
Definition at line 191 of file src/Server.php.
const pocketmine\Server::DEFAULT_PORT_IPV6 = 19133 |
Definition at line 192 of file src/Server.php.
const pocketmine\Server::DEFAULT_SERVER_NAME = VersionInfo::NAME . " Server" |
Definition at line 189 of file src/Server.php.
const pocketmine\Server::TARGET_NANOSECONDS_PER_TICK = 1_000_000_000 / self::TARGET_TICKS_PER_SECOND |
Definition at line 205 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 204 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 200 of file src/Server.php.