PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
|
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 179 of file src/Server.php.
pocketmine\Server::__construct | ( | private ThreadSafeClassLoader | $autoloader, |
private AttachableThreadSafeLogger | $logger, | ||
string | $dataPath, | ||
string | $pluginPath ) |
Definition at line 767 of file src/Server.php.
pocketmine\Server::__debugInfo | ( | ) |
Definition at line 1685 of file src/Server.php.
pocketmine\Server::addOnlinePlayer | ( | Player | $player | ) |
Definition at line 1704 of file src/Server.php.
pocketmine\Server::addOp | ( | string | $name | ) |
Definition at line 688 of file src/Server.php.
pocketmine\Server::addWhitelist | ( | string | $name | ) |
Definition at line 712 of file src/Server.php.
pocketmine\Server::broadcastMessage | ( | Translatable|string | $message, |
?array | $recipients = null ) |
CommandSender[] | null | $recipients |
Definition at line 1293 of file src/Server.php.
pocketmine\Server::broadcastPopup | ( | string | $popup, |
?array | $recipients = null ) |
Player[] | null | $recipients |
Definition at line 1333 of file src/Server.php.
pocketmine\Server::broadcastTip | ( | string | $tip, |
?array | $recipients = null ) |
Player[] | null | $recipients |
Definition at line 1320 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 1349 of file src/Server.php.
pocketmine\Server::crashDump | ( | ) |
Definition at line 1595 of file src/Server.php.
pocketmine\Server::createPlayer | ( | NetworkSession | $session, |
PlayerInfo | $playerInfo, | ||
bool | $authenticated, | ||
?CompoundTag | $offlinePlayerData ) |
@phpstan-return Promise<Player>
Definition at line 557 of file src/Server.php.
pocketmine\Server::dispatchCommand | ( | CommandSender | $sender, |
string | $commandLine, | ||
bool | $internal = false ) |
Executes a command from a CommandSender
Definition at line 1422 of file src/Server.php.
pocketmine\Server::enablePlugins | ( | PluginEnableOrder | $type | ) |
Definition at line 1402 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 1529 of file src/Server.php.
pocketmine\Server::forceShutdown | ( | ) |
Definition at line 1451 of file src/Server.php.
pocketmine\Server::getAllowedViewDistance | ( | int | $distance | ) |
Returns a view distance up to the currently-allowed limit.
Definition at line 376 of file src/Server.php.
pocketmine\Server::getApiVersion | ( | ) |
Definition at line 322 of file src/Server.php.
pocketmine\Server::getAsyncPool | ( | ) |
Definition at line 449 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 1286 of file src/Server.php.
pocketmine\Server::getCommandAliases | ( | ) |
Definition at line 741 of file src/Server.php.
pocketmine\Server::getCommandMap | ( | ) |
Definition at line 489 of file src/Server.php.
pocketmine\Server::getConfigGroup | ( | ) |
Definition at line 664 of file src/Server.php.
pocketmine\Server::getCraftingManager | ( | ) |
Definition at line 437 of file src/Server.php.
pocketmine\Server::getDataPath | ( | ) |
Definition at line 334 of file src/Server.php.
pocketmine\Server::getDifficulty | ( | ) |
Returns Server global difficulty. Note that this may be overridden in individual worlds.
Definition at line 405 of file src/Server.php.
pocketmine\Server::getFilePath | ( | ) |
Definition at line 326 of file src/Server.php.
pocketmine\Server::getForceGamemode | ( | ) |
Definition at line 398 of file src/Server.php.
pocketmine\Server::getGamemode | ( | ) |
Definition at line 394 of file src/Server.php.
|
static |
Definition at line 760 of file src/Server.php.
pocketmine\Server::getIp | ( | ) |
Definition at line 380 of file src/Server.php.
pocketmine\Server::getIPBans | ( | ) |
Definition at line 684 of file src/Server.php.
pocketmine\Server::getIpV6 | ( | ) |
Definition at line 385 of file src/Server.php.
pocketmine\Server::getLanguage | ( | ) |
Definition at line 1755 of file src/Server.php.
pocketmine\Server::getLoader | ( | ) |
Definition at line 421 of file src/Server.php.
pocketmine\Server::getLogger | ( | ) |
Definition at line 425 of file src/Server.php.
pocketmine\Server::getMaxPlayers | ( | ) |
Definition at line 342 of file src/Server.php.
pocketmine\Server::getMemoryManager | ( | ) |
Definition at line 1767 of file src/Server.php.
pocketmine\Server::getMotd | ( | ) |
Definition at line 417 of file src/Server.php.
pocketmine\Server::getName | ( | ) |
Definition at line 306 of file src/Server.php.
pocketmine\Server::getNameBans | ( | ) |
Definition at line 680 of file src/Server.php.
pocketmine\Server::getNetwork | ( | ) |
Definition at line 1763 of file src/Server.php.
pocketmine\Server::getOfflinePlayer | ( | string | $name | ) |
Definition at line 504 of file src/Server.php.
pocketmine\Server::getOfflinePlayerData | ( | string | $name | ) |
Definition at line 522 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 350 of file src/Server.php.
pocketmine\Server::getOnlinePlayers | ( | ) |
Definition at line 496 of file src/Server.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
pocketmine\Server::getOps | ( | ) |
Definition at line 734 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 616 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 653 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 660 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 639 of file src/Server.php.
pocketmine\Server::getPluginCommand | ( | string | $name | ) |
Definition at line 672 of file src/Server.php.
pocketmine\Server::getPluginManager | ( | ) |
Definition at line 433 of file src/Server.php.
pocketmine\Server::getPluginPath | ( | ) |
Definition at line 338 of file src/Server.php.
pocketmine\Server::getPocketMineVersion | ( | ) |
Definition at line 314 of file src/Server.php.
pocketmine\Server::getPort | ( | ) |
Definition at line 361 of file src/Server.php.
pocketmine\Server::getPortV6 | ( | ) |
Definition at line 365 of file src/Server.php.
pocketmine\Server::getQueryInformation | ( | ) |
Definition at line 1521 of file src/Server.php.
pocketmine\Server::getResourcePackManager | ( | ) |
Definition at line 441 of file src/Server.php.
pocketmine\Server::getResourcePath | ( | ) |
Definition at line 330 of file src/Server.php.
pocketmine\Server::getServerUniqueId | ( | ) |
Definition at line 390 of file src/Server.php.
pocketmine\Server::getStartTime | ( | ) |
Definition at line 485 of file src/Server.php.
pocketmine\Server::getTick | ( | ) |
Definition at line 453 of file src/Server.php.
pocketmine\Server::getTickSleeper | ( | ) |
Definition at line 1689 of file src/Server.php.
pocketmine\Server::getTicksPerSecond | ( | ) |
Returns the last server TPS measure
Definition at line 460 of file src/Server.php.
pocketmine\Server::getTicksPerSecondAverage | ( | ) |
Returns the last server TPS average measure
Definition at line 467 of file src/Server.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
pocketmine\Server::getTickUsage | ( | ) |
Returns the TPS usage/load in %
Definition at line 474 of file src/Server.php.
pocketmine\Server::getTickUsageAverage | ( | ) |
Returns the TPS usage/load average in %
Definition at line 481 of file src/Server.php.
Referenced by pocketmine\stats\SendUsageTask\__construct().
pocketmine\Server::getUpdater | ( | ) |
Definition at line 429 of file src/Server.php.
pocketmine\Server::getVersion | ( | ) |
Definition at line 318 of file src/Server.php.
pocketmine\Server::getViewDistance | ( | ) |
Definition at line 369 of file src/Server.php.
pocketmine\Server::getWhitelisted | ( | ) |
Definition at line 730 of file src/Server.php.
pocketmine\Server::getWorldManager | ( | ) |
Definition at line 445 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 518 of file src/Server.php.
pocketmine\Server::hasWhitelist | ( | ) |
Definition at line 409 of file src/Server.php.
pocketmine\Server::isHardcore | ( | ) |
Definition at line 413 of file src/Server.php.
pocketmine\Server::isLanguageForced | ( | ) |
Definition at line 1759 of file src/Server.php.
pocketmine\Server::isOp | ( | string | $name | ) |
Definition at line 726 of file src/Server.php.
pocketmine\Server::isRunning | ( | ) |
Definition at line 310 of file src/Server.php.
pocketmine\Server::isWhitelisted | ( | string | $name | ) |
Definition at line 722 of file src/Server.php.
pocketmine\Server::prepareBatch | ( | string | $buffer, |
Compressor | $compressor, | ||
?bool | $sync = null, | ||
?TimingsHandler | $timings = null ) |
Definition at line 1372 of file src/Server.php.
pocketmine\Server::removeOnlinePlayer | ( | Player | $player | ) |
Definition at line 1739 of file src/Server.php.
pocketmine\Server::removeOp | ( | string | $name | ) |
Definition at line 697 of file src/Server.php.
pocketmine\Server::removeWhitelist | ( | string | $name | ) |
Definition at line 717 of file src/Server.php.
pocketmine\Server::requiresAuthentication | ( | ) |
Alias of getOnlineMode()
.
Definition at line 357 of file src/Server.php.
pocketmine\Server::saveOfflinePlayerData | ( | string | $name, |
CompoundTag | $nbtTag ) |
Definition at line 534 of file src/Server.php.
pocketmine\Server::sendUsage | ( | int | $type = SendUsageTask::TYPE_STATUS | ) |
Definition at line 1748 of file src/Server.php.
pocketmine\Server::shouldSavePlayerData | ( | ) |
Definition at line 500 of file src/Server.php.
pocketmine\Server::shutdown | ( | ) |
Shuts the server down correctly
Definition at line 1439 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 1254 of file src/Server.php.
pocketmine\Server::unsubscribeFromAllBroadcastChannels | ( | CommandSender | $subscriber | ) |
Unsubscribes from all broadcast channels.
Definition at line 1274 of file src/Server.php.
pocketmine\Server::unsubscribeFromBroadcastChannel | ( | string | $channelId, |
CommandSender | $subscriber ) |
Unsubscribes from a particular message broadcast channel.
Definition at line 1261 of file src/Server.php.
const pocketmine\Server::BROADCAST_CHANNEL_ADMINISTRATIVE = "pocketmine.broadcast.admin" |
Definition at line 183 of file src/Server.php.
const pocketmine\Server::BROADCAST_CHANNEL_USERS = "pocketmine.broadcast.user" |
Definition at line 184 of file src/Server.php.
const pocketmine\Server::DEFAULT_MAX_PLAYERS = 20 |
Definition at line 187 of file src/Server.php.
const pocketmine\Server::DEFAULT_MAX_VIEW_DISTANCE = 16 |
Definition at line 190 of file src/Server.php.
const pocketmine\Server::DEFAULT_PORT_IPV4 = 19132 |
Definition at line 188 of file src/Server.php.
const pocketmine\Server::DEFAULT_PORT_IPV6 = 19133 |
Definition at line 189 of file src/Server.php.
const pocketmine\Server::DEFAULT_SERVER_NAME = VersionInfo::NAME . " Server" |
Definition at line 186 of file src/Server.php.
const pocketmine\Server::TARGET_NANOSECONDS_PER_TICK = 1_000_000_000 / self::TARGET_TICKS_PER_SECOND |
Definition at line 202 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 201 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 197 of file src/Server.php.