mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-29 22:59:59 +00:00
Fixed some doc issues
This commit is contained in:
parent
eda7965f86
commit
2f4943ac90
@ -1243,6 +1243,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
* TODO: remove this when Spectator Mode gets added properly to MCPE
|
* TODO: remove this when Spectator Mode gets added properly to MCPE
|
||||||
*
|
*
|
||||||
* @param int $gamemode
|
* @param int $gamemode
|
||||||
|
* @return int
|
||||||
*/
|
*/
|
||||||
public static function getClientFriendlyGamemode(int $gamemode) : int{
|
public static function getClientFriendlyGamemode(int $gamemode) : int{
|
||||||
$gamemode &= 0x03;
|
$gamemode &= 0x03;
|
||||||
|
@ -243,14 +243,11 @@ abstract class BaseInventory implements Inventory{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addItem(...$slots){
|
public function addItem(Item ...$slots){
|
||||||
/** @var Item[] $itemSlots */
|
/** @var Item[] $itemSlots */
|
||||||
/** @var Item[] $slots */
|
/** @var Item[] $slots */
|
||||||
$itemSlots = [];
|
$itemSlots = [];
|
||||||
foreach($slots as $slot){
|
foreach($slots as $slot){
|
||||||
if(!($slot instanceof Item)){
|
|
||||||
throw new \InvalidArgumentException("Expected Item[], got " . gettype($slot));
|
|
||||||
}
|
|
||||||
if($slot->getId() !== 0 and $slot->getCount() > 0){
|
if($slot->getId() !== 0 and $slot->getCount() > 0){
|
||||||
$itemSlots[] = clone $slot;
|
$itemSlots[] = clone $slot;
|
||||||
}
|
}
|
||||||
@ -303,14 +300,11 @@ abstract class BaseInventory implements Inventory{
|
|||||||
return $itemSlots;
|
return $itemSlots;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function removeItem(...$slots){
|
public function removeItem(Item ...$slots){
|
||||||
/** @var Item[] $itemSlots */
|
/** @var Item[] $itemSlots */
|
||||||
/** @var Item[] $slots */
|
/** @var Item[] $slots */
|
||||||
$itemSlots = [];
|
$itemSlots = [];
|
||||||
foreach($slots as $slot){
|
foreach($slots as $slot){
|
||||||
if(!($slot instanceof Item)){
|
|
||||||
throw new \InvalidArgumentException("Expected Item[], got " . gettype($slot));
|
|
||||||
}
|
|
||||||
if($slot->getId() !== 0 and $slot->getCount() > 0){
|
if($slot->getId() !== 0 and $slot->getCount() > 0){
|
||||||
$itemSlots[] = clone $slot;
|
$itemSlots[] = clone $slot;
|
||||||
}
|
}
|
||||||
|
@ -68,11 +68,11 @@ interface Inventory{
|
|||||||
*
|
*
|
||||||
* Returns the Items that did not fit.
|
* Returns the Items that did not fit.
|
||||||
*
|
*
|
||||||
* @param Item ...$slots
|
* @param Item[] ...$slots
|
||||||
*
|
*
|
||||||
* @return Item[]
|
* @return Item[]
|
||||||
*/
|
*/
|
||||||
public function addItem(...$slots);
|
public function addItem(Item ...$slots);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if a given Item can be added to the inventory
|
* Checks if a given Item can be added to the inventory
|
||||||
@ -87,11 +87,11 @@ interface Inventory{
|
|||||||
* Removes the given Item from the inventory.
|
* Removes the given Item from the inventory.
|
||||||
* It will return the Items that couldn't be removed.
|
* It will return the Items that couldn't be removed.
|
||||||
*
|
*
|
||||||
* @param Item ...$slots
|
* @param Item[] ...$slots
|
||||||
*
|
*
|
||||||
* @return Item[]
|
* @return Item[]
|
||||||
*/
|
*/
|
||||||
public function removeItem(...$slots);
|
public function removeItem(Item ...$slots);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Item[]
|
* @return Item[]
|
||||||
|
@ -672,7 +672,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
* WARNING: Do not use this, it's only for internal use.
|
* WARNING: Do not use this, it's only for internal use.
|
||||||
* Changes to this function won't be recorded on the version.
|
* Changes to this function won't be recorded on the version.
|
||||||
*
|
*
|
||||||
* @param Player ...$targets If empty, will send to all players in the level.
|
* @param Player[] ...$targets If empty, will send to all players in the level.
|
||||||
*/
|
*/
|
||||||
public function sendTime(Player ...$targets){
|
public function sendTime(Player ...$targets){
|
||||||
$pk = new SetTimePacket();
|
$pk = new SetTimePacket();
|
||||||
|
@ -72,10 +72,10 @@ class UUID{
|
|||||||
/**
|
/**
|
||||||
* Creates an UUIDv3 from binary data or list of binary data
|
* Creates an UUIDv3 from binary data or list of binary data
|
||||||
*
|
*
|
||||||
* @param string ...$data
|
* @param string[] ...$data
|
||||||
* @return UUID
|
* @return UUID
|
||||||
*/
|
*/
|
||||||
public static function fromData(...$data){
|
public static function fromData(string ...$data){
|
||||||
$hash = hash("md5", implode($data), true);
|
$hash = hash("md5", implode($data), true);
|
||||||
|
|
||||||
return self::fromBinary($hash, 3);
|
return self::fromBinary($hash, 3);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user