Added a way to send Player's inventory directly

This commit is contained in:
Shoghi Cervantes Pueyo
2013-04-17 19:25:53 +02:00
parent 5e4ef9732b
commit 09301f0e5f
6 changed files with 85 additions and 24 deletions

View File

@@ -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;
}