mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-20 15:41:33 +00:00
Added a way to send Player's inventory directly
This commit is contained in:
@@ -151,7 +151,8 @@ class BlockAPI{
|
||||
}
|
||||
|
||||
if($player instanceof Player){
|
||||
$this->drop(new Vector3($player->entity->x - 0.5, $player->entity->y, $player->entity->z - 0.5), $item, true);
|
||||
$player->addItem($item->getID(), $item->getMetadata(), $item->count);
|
||||
//$this->drop(new Vector3($player->entity->x - 0.5, $player->entity->y, $player->entity->z - 0.5), $item, true);
|
||||
$output .= "Giving ".$item->count." of ".$item->getName()." (".$item->getID().":".$item->getMetadata().") to ".$player->username."\n";
|
||||
}else{
|
||||
$output .= "Unknown player\n";
|
||||
@@ -170,6 +171,7 @@ class BlockAPI{
|
||||
"block" => $block->getID(),
|
||||
"meta" => $block->getMetadata()
|
||||
));
|
||||
$player->sendInventory();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user