Phpcraft
|
Static Public Member Functions | |
static | getProfiles (bool $bypass_cache=false) |
static | getProfilesFile () |
static | getMinecraftFolder () |
static | isWindows () |
static | saveProfiles (array $profiles) |
static | getCachableJson (string $url) |
static | maintainCache () |
static | httpPOST (string $url, array $data) |
static | resolve (string $server) |
static | binaryStringToBin (string $str) |
static | binaryStringToHex (string $str) |
static | sha1 (string $str) |
static | chatToText ($chat, int $format=ChatComponent::FORMAT_NONE, ?array $translations=null) |
static | getServerStatus (string $hostname, int $port=25565, float $timeout=3.000, int $method=ServerConnection::METHOD_ALL) |
static | textToChat (string $text, bool $allow_amp=false) |
static | colorDiff (array $rgb1, array $rgb2) |
static | rgbToHex (array $rgb) |
static | rgbToInt (array $rgb) |
static | recursivelyDelete (string $path) |
Public Attributes | |
const | SRC_DIR = __DIR__ |
const | INSTALL_DIR = self::SRC_DIR.'/..' |
const | BIN_DIR = self::INSTALL_DIR.'/bin' |
const | DATA_DIR = self::INSTALL_DIR.'/data' |
const | FORMAT_NONE = 0 |
const | FORMAT_ANSI = 1 |
const | FORMAT_SILCROW = 2 |
const | FORMAT_AMPERSAND = 3 |
const | FORMAT_HTML = 4 |
const | METHOD_ALL = 0 |
const | METHOD_MODERN = 1 |
const | METHOD_LEGACY = 2 |
Static Public Attributes | |
static | $json_cache |
static | $user_cache |
|
static |
|
static |
|
static |
array | string | null | ChatComponent | $chat | |
int | $format | |
array<string,string>|null | $translations |
|
static |
Calculates the "distance" between two RGB arrays (each 3 integers).
array{int,int,int} | $rgb1 |
array{int,int,int} | $rgb2 |
|
static |
Returns the contents of a JSON file as associative array with additional memory and disk caching levels.
string | $url | The URL of the resource. |
IOException |
|
static |
Returns the path of the .minecraft folder without a folder seperator at the end.
|
static |
Returns the contents of Minecraft's launcher_profiles.json with some values being set if they are unset.
bool | $bypass_cache | Set this to true if you anticipate external changes to the file. |
|
static |
Returns the path of Minecraft's launcher_profiles.json.
|
static |
string | $hostname | |
int | $port | |
float | $timeout | |
int | $method |
IOException |
|
static |
Sends an HTTP POST request with a JSON payload. The response will always contain a "status" value which will be the HTTP response code, e.g. 200.
string | $url | |
array | $data |
|
static |
Returns true if the code is running on a Windows machine.
|
static |
|
static |
Recursively deletes a folder.
string | $path |
|
static |
Resolves the given address.
string | $server | The server address, e.g. localhost |
|
static |
Converts an RGB array (3 integers) into a hexadecimal string, e.g. ff00ff.
array{int,int,int} | $rgb |
|
static |
Converts an RGB array (3 integers) into a decimal number for use in NBT tags.
array{int,int,int} | $rgb |
|
static |
Saves the profiles array into Minecraft's launcher_profiles.json.
array | $profiles |
|
static |
Generates a Minecraft-style SHA1 hash.
string | $str |
|
static |
string | $text | |
boolean | $allow_amp |
|
static |
|
static |
const Phpcraft\Phpcraft::BIN_DIR = self::INSTALL_DIR.'/bin' |
const Phpcraft\Phpcraft::DATA_DIR = self::INSTALL_DIR.'/data' |
const Phpcraft\Phpcraft::FORMAT_AMPERSAND = 3 |
const Phpcraft\Phpcraft::FORMAT_ANSI = 1 |
const Phpcraft\Phpcraft::FORMAT_HTML = 4 |
const Phpcraft\Phpcraft::FORMAT_NONE = 0 |
const Phpcraft\Phpcraft::FORMAT_SILCROW = 2 |
const Phpcraft\Phpcraft::INSTALL_DIR = self::SRC_DIR.'/..' |
const Phpcraft\Phpcraft::METHOD_ALL = 0 |
const Phpcraft\Phpcraft::METHOD_LEGACY = 2 |
const Phpcraft\Phpcraft::METHOD_MODERN = 1 |
const Phpcraft\Phpcraft::SRC_DIR = __DIR__ |