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