Player: remove useless return value from dropItem()

This commit is contained in:
Dylan K. Taylor 2018-08-05 12:55:12 +01:00
parent ea9415961b
commit 90f80782d4
2 changed files with 5 additions and 9 deletions

View File

@ -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{

View File

@ -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{