mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
Added some documentation
This commit is contained in:
parent
c32b75fa18
commit
8a35b9da29
@ -43,7 +43,9 @@ use pocketmine\plugin\Plugin;
|
||||
class Block extends Position implements BlockIds, Metadatable{
|
||||
|
||||
/**
|
||||
* @deprecated This functionality has moved to {@link BlockFactory#get}
|
||||
* Returns a new Block instance with the specified ID, meta and position.
|
||||
*
|
||||
* This function redirects to {@link BlockFactory#get}.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
|
@ -360,6 +360,8 @@ class BlockFactory{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new Block instance with the specified ID, meta and position.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
* @param Position $pos
|
||||
|
@ -77,6 +77,10 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new Item instance with the specified ID, damage, count and NBT.
|
||||
*
|
||||
* This function redirects to {@link ItemFactory#get}.
|
||||
*
|
||||
* @param int $id
|
||||
* @param int $meta
|
||||
* @param int $count
|
||||
@ -84,18 +88,20 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
*
|
||||
* @return Item
|
||||
*/
|
||||
|
||||
public static function get(int $id, int $meta = 0, int $count = 1, $tags = "") : Item{
|
||||
return ItemFactory::get($id, $meta, $count, $tags);
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to parse the specified string into Item ID/meta identifiers, and returns Item instances it created.
|
||||
*
|
||||
* This function redirects to {@link ItemFactory#fromString}.
|
||||
*
|
||||
* @param string $str
|
||||
* @param bool $multiple
|
||||
*
|
||||
* @return Item[]|Item
|
||||
*/
|
||||
|
||||
public static function fromString(string $str, bool $multiple = false){
|
||||
return ItemFactory::fromString($str, $multiple);
|
||||
}
|
||||
|
@ -249,6 +249,16 @@ class ItemFactory{
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to parse the specified string into Item ID/meta identifiers, and returns Item instances it created.
|
||||
*
|
||||
* Example accepted formats:
|
||||
* - `diamond_pickaxe:5`
|
||||
* - `minecraft:string`
|
||||
* - `351:4 (lapis lazuli ID:meta)`
|
||||
*
|
||||
* If multiple item instances are to be created, their identifiers must be comma-separated, for example:
|
||||
* `diamond_pickaxe,wooden_shovel:18,iron_ingot`
|
||||
*
|
||||
* @param string $str
|
||||
* @param bool $multiple
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user