pocketmine\item\Item::setRepairCost PHP Méthode

setRepairCost() public méthode

public setRepairCost ( integer $cost )
$cost integer
    public function setRepairCost(int $cost)
    {
        if ($cost === 1) {
            $this->clearRepairCost();
        }
        if (!($hadCompoundTag = $this->hasCompoundTag())) {
            $tag = new CompoundTag("", []);
        } else {
            $tag = $this->getNamedTag();
        }
        $tag->RepairCost = new IntTag("RepairCost", $cost);
        if (!$hadCompoundTag) {
            $this->setCompoundTag($tag);
        }
        return $this;
    }