Phpcraft
Static Public Member Functions | List of all members
Phpcraft\Versions Class Reference

Static Public Member Functions

static protocol (bool $all=true)
 
static list (bool $all=true)
 
static protocolSupported (int $protocol_version)
 
static minecraftSupported (string $minecraft_version)
 
static minecraftToProtocol (string $minecraft_version)
 
static minecraft (bool $all=true)
 
static minecraftReleases (bool $all=true)
 
static releases (bool $all=true)
 
static protocolToRange (int $protocol_version)
 
static protocolToMinecraft (int $protocol_version)
 

Member Function Documentation

◆ list()

static Phpcraft\Versions::list ( bool  $all = true)
static

Returns an associative array of Minecraft versions with their protocol version as value; newest first.

Parameters
boolean$alltrue = all versions; false = only supported versions.
Returns
array<string,int>
Exceptions
Exception

◆ minecraft()

static Phpcraft\Versions::minecraft ( bool  $all = true)
static

Returns an array of Minecraft versions; newest first.

Parameters
boolean$alltrue = all versions; false = only supported versions.
Returns
array<string>

◆ minecraftReleases()

static Phpcraft\Versions::minecraftReleases ( bool  $all = true)
static

Returns an array of non-snapshot Minecraft versions; newest first.

Parameters
boolean$alltrue = all versions; false = only supported versions.
Returns
array<string>

◆ minecraftSupported()

static Phpcraft\Versions::minecraftSupported ( string  $minecraft_version)
static

Returns true if the given Minecraft version is supported by Phpcraft.

Parameters
string$minecraft_version
Returns
boolean

◆ minecraftToProtocol()

static Phpcraft\Versions::minecraftToProtocol ( string  $minecraft_version)
static

Returns the protocol version corresponding to the given Minecraft version; newest first.

Parameters
string$minecraft_version
Returns
int The protocol version or NULL if the Minecraft version doesn't exist.

◆ protocol()

static Phpcraft\Versions::protocol ( bool  $all = true)
static

Returns a list of protocol versions; newest first.

Parameters
boolean$alltrue = all versions; false = only supported versions.
Returns
array<int>

◆ protocolSupported()

static Phpcraft\Versions::protocolSupported ( int  $protocol_version)
static

Returns true if the given protocol version is supported by Phpcraft.

Parameters
int$protocol_versione.g., 340
Returns
boolean

◆ protocolToMinecraft()

static Phpcraft\Versions::protocolToMinecraft ( int  $protocol_version)
static

Returns an array of Minecraft versions corresponding to the given protocol version; newest first.

Parameters
int$protocol_version
Returns
array<string>

◆ protocolToRange()

static Phpcraft\Versions::protocolToRange ( int  $protocol_version)
static

Returns a human-readable range of Minecraft versions corresponding to the given protocol version, e.g. 47 would return "1.8 - 1.8.9"

Parameters
int$protocol_version
Returns
string The version range or an empty string if the given protocol version is not supported.

◆ releases()

static Phpcraft\Versions::releases ( bool  $all = true)
static

Returns an associative array of non-snapshot Minecraft versions with their protocol version as value; newest first.

Parameters
boolean$alltrue = all versions; false = only supported versions.
Returns
array<string,int>
See also
Versions::list