mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-06 11:57:10 +00:00
Player: remove useless return value from dropItem()
This commit is contained in:
parent
ea9415961b
commit
90f80782d4
@ -2412,17 +2412,12 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Drops an item on the ground in front of the player. Returns if the item drop was successful.
|
* Drops an item on the ground in front of the player.
|
||||||
*
|
*
|
||||||
* @param Item $item
|
* @param Item $item
|
||||||
* @return bool if the item was dropped or if the item was null
|
|
||||||
*/
|
*/
|
||||||
public function dropItem(Item $item) : bool{
|
public function dropItem(Item $item) : void{
|
||||||
$motion = $this->getDirectionVector()->multiply(0.4);
|
$this->level->dropItem($this->add(0, 1.3, 0), $item, $this->getDirectionVector()->multiply(0.4), 40);
|
||||||
|
|
||||||
$this->level->dropItem($this->add(0, 1.3, 0), $item, $motion, 40);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
|
public function handleAdventureSettings(AdventureSettingsPacket $packet) : bool{
|
||||||
|
@ -57,7 +57,8 @@ class DropItemAction extends InventoryAction{
|
|||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function execute(Player $source) : bool{
|
public function execute(Player $source) : bool{
|
||||||
return $source->dropItem($this->targetItem);
|
$source->dropItem($this->targetItem);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onExecuteSuccess(Player $source) : void{
|
public function onExecuteSuccess(Player $source) : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user