mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-13 09:19:42 +00:00
Item: fix @return annotations for fluent methods (needed for correct auto complete)
This commit is contained in:
parent
b42966f61b
commit
fd27227cc7
@ -233,7 +233,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
*
|
*
|
||||||
* @param CompoundTag|string|null $tags
|
* @param CompoundTag|string|null $tags
|
||||||
*
|
*
|
||||||
* @return Item
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCompoundTag($tags) : Item{
|
public function setCompoundTag($tags) : Item{
|
||||||
if($tags instanceof CompoundTag){
|
if($tags instanceof CompoundTag){
|
||||||
@ -280,7 +280,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
/**
|
/**
|
||||||
* @param CompoundTag $compound
|
* @param CompoundTag $compound
|
||||||
*
|
*
|
||||||
* @return Item
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCustomBlockData(CompoundTag $compound) : Item{
|
public function setCustomBlockData(CompoundTag $compound) : Item{
|
||||||
$tags = clone $compound;
|
$tags = clone $compound;
|
||||||
@ -479,7 +479,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
*
|
*
|
||||||
* @return Item
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCustomName(string $name) : Item{
|
public function setCustomName(string $name) : Item{
|
||||||
if($name === ""){
|
if($name === ""){
|
||||||
@ -499,7 +499,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Item
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function clearCustomName() : Item{
|
public function clearCustomName() : Item{
|
||||||
$display = $this->getNamedTagEntry(self::TAG_DISPLAY);
|
$display = $this->getNamedTagEntry(self::TAG_DISPLAY);
|
||||||
@ -531,7 +531,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
/**
|
/**
|
||||||
* @param string[] $lines
|
* @param string[] $lines
|
||||||
*
|
*
|
||||||
* @return Item
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setLore(array $lines) : Item{
|
public function setLore(array $lines) : Item{
|
||||||
$display = $this->getNamedTagEntry(self::TAG_DISPLAY);
|
$display = $this->getNamedTagEntry(self::TAG_DISPLAY);
|
||||||
@ -588,7 +588,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
*
|
*
|
||||||
* @param CompoundTag $tag
|
* @param CompoundTag $tag
|
||||||
*
|
*
|
||||||
* @return Item
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setNamedTag(CompoundTag $tag) : Item{
|
public function setNamedTag(CompoundTag $tag) : Item{
|
||||||
if($tag->getCount() === 0){
|
if($tag->getCount() === 0){
|
||||||
@ -603,7 +603,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Removes the Item's NBT.
|
* Removes the Item's NBT.
|
||||||
* @return Item
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function clearNamedTag() : Item{
|
public function clearNamedTag() : Item{
|
||||||
return $this->setCompoundTag("");
|
return $this->setCompoundTag("");
|
||||||
@ -619,7 +619,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
/**
|
/**
|
||||||
* @param int $count
|
* @param int $count
|
||||||
*
|
*
|
||||||
* @return Item
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setCount(int $count) : Item{
|
public function setCount(int $count) : Item{
|
||||||
$this->count = $count;
|
$this->count = $count;
|
||||||
@ -632,7 +632,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
*
|
*
|
||||||
* @param int $count
|
* @param int $count
|
||||||
*
|
*
|
||||||
* @return Item
|
* @return $this
|
||||||
* @throws \InvalidArgumentException if trying to pop more items than are on the stack
|
* @throws \InvalidArgumentException if trying to pop more items than are on the stack
|
||||||
*/
|
*/
|
||||||
public function pop(int $count = 1) : Item{
|
public function pop(int $count = 1) : Item{
|
||||||
@ -700,7 +700,7 @@ class Item implements ItemIds, \JsonSerializable{
|
|||||||
/**
|
/**
|
||||||
* @param int $meta
|
* @param int $meta
|
||||||
*
|
*
|
||||||
* @return Item
|
* @return $this
|
||||||
*/
|
*/
|
||||||
public function setDamage(int $meta) : Item{
|
public function setDamage(int $meta) : Item{
|
||||||
$this->meta = $meta !== -1 ? $meta & 0x7FFF : -1;
|
$this->meta = $meta !== -1 ? $meta & 0x7FFF : -1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user