mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-11 12:27:51 +00:00
Get Item Lists from BlockAPI::fromString() method
This commit is contained in:
parent
6c4900cd32
commit
e8c2662258
@ -38,7 +38,14 @@ define("BLOCK_UPDATE_WEAK", 3);
|
|||||||
class BlockAPI{
|
class BlockAPI{
|
||||||
private $server;
|
private $server;
|
||||||
|
|
||||||
public static function fromString($str){
|
public static function fromString($str, $multiple = false){
|
||||||
|
if($multiple === true){
|
||||||
|
$blocks = array();
|
||||||
|
foreach(explode(",",$str) as $b){
|
||||||
|
$blocks[] = BlockAPI::fromString($b, false);
|
||||||
|
}
|
||||||
|
return $blocks;
|
||||||
|
}else{
|
||||||
$b = explode(":", str_replace(" ", "_", trim($str)));
|
$b = explode(":", str_replace(" ", "_", trim($str)));
|
||||||
if(!isset($b[1])){
|
if(!isset($b[1])){
|
||||||
$meta = 0;
|
$meta = 0;
|
||||||
@ -56,6 +63,7 @@ class BlockAPI{
|
|||||||
}
|
}
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function get($id, $meta = 0, $v = false){
|
public static function get($id, $meta = 0, $v = false){
|
||||||
$id = (int) $id;
|
$id = (int) $id;
|
||||||
|
@ -47,5 +47,5 @@ define("MAJOR_VERSION", "Alpha_1.3dev");
|
|||||||
define("CURRENT_STRUCTURE", 5);
|
define("CURRENT_STRUCTURE", 5);
|
||||||
define("CURRENT_PROTOCOL", 9);
|
define("CURRENT_PROTOCOL", 9);
|
||||||
define("CURRENT_MINECRAFT_VERSION", "v0.6.1 alpha");
|
define("CURRENT_MINECRAFT_VERSION", "v0.6.1 alpha");
|
||||||
define("CURRENT_API_VERSION", 3);
|
define("CURRENT_API_VERSION", 4);
|
||||||
define("CURRENT_PHP_VERSION", "5.4.12");
|
define("CURRENT_PHP_VERSION", "5.4.12");
|
Loading…
x
Reference in New Issue
Block a user