setBoots() 공개 메소드

public setBoots ( Item $boots )
$boots pocketmine\item\Item
예제 #1
0
 public function equip(PlayerInventory $inv, PvpSessionData $data, $send = true)
 {
     $inv->clearAll();
     $messages = [];
     $info = Settings::kitpvp_getKitUpgradeInfo("helmet", $this->helmet);
     $inv->setHelmet($info->getItem());
     $messages[] = $info->itemsToString();
     $info = Settings::kitpvp_getKitUpgradeInfo("chestplate", $this->chestplate);
     $inv->setChestplate($info->getItem());
     $messages[] = $info->itemsToString();
     $info = Settings::kitpvp_getKitUpgradeInfo("leggings", $this->leggings);
     $inv->setLeggings($info->getItem());
     $messages[] = $info->itemsToString();
     $info = Settings::kitpvp_getKitUpgradeInfo("boots", $this->boots);
     $inv->setBoots($info->getItem());
     $messages[] = $info->itemsToString();
     $inv->sendArmorContents($inv->getViewers());
     if ($data->isUsingBowKit()) {
         $weapon = $data->getBowLevel() > 0 ? new Bow() : Item::get(Item::AIR);
         $messages[] = "a bow";
     } else {
         $info = Settings::kitpvp_getKitUpgradeInfo("weapon", $this->weapon);
         $weapon = $info->getItem();
         $messages[] = $info->itemsToString();
     }
     $info = Settings::kitpvp_getKitUpgradeInfo("food", $this->food);
     $food = $info->getItem();
     $messages[] = $info->itemsToString();
     $info = Settings::kitpvp_getKitUpgradeInfo("arrows", $this->arrows);
     $arrows = $info->getItem();
     $messages[] = $info->itemsToString();
     /** @var \pocketmine\item\Item[] $items */
     $items = [];
     if ($weapon->getId() !== Item::AIR) {
         $items[] = $weapon;
     }
     if ($food->getId() !== 0) {
         $items[] = $food;
     }
     if ($arrows->getId() !== 0) {
         $items[] = $arrows;
     }
     $inv->addItem(...$items);
     $cnt = Settings::easter_getSnowballCount($data->getSession());
     if ($cnt > 0) {
         $inv->addItem(new Snowball(0, $cnt));
     }
     if ($data->getKills() <= 500) {
         $inv->addItem(new Snowball(0, 8));
     }
     if ($send) {
         $inv->sendHeldItem($inv->getViewers());
         $inv->sendArmorContents($inv->getViewers());
     }
 }