From 44c3e035983948de075202442fa02629f3c123c9 Mon Sep 17 00:00:00 2001 From: ShockedPlot7560 Date: Sat, 10 Aug 2024 19:10:10 +0200 Subject: [PATCH] fix PHPstan --- src/item/ArmorMaterial.php | 2 ++ src/item/Item.php | 2 +- src/item/ToolTier.php | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/item/ArmorMaterial.php b/src/item/ArmorMaterial.php index 2465acc79..dc0ddcbb8 100644 --- a/src/item/ArmorMaterial.php +++ b/src/item/ArmorMaterial.php @@ -56,6 +56,8 @@ class ArmorMaterial{ /** * Returns the items that can be used to repair the armor + * + * @return int[] */ public function getRepairMaterials() : array{ return $this->repairMaterials; diff --git a/src/item/Item.php b/src/item/Item.php index ea7e6ef71..ceeeecb20 100644 --- a/src/item/Item.php +++ b/src/item/Item.php @@ -427,7 +427,7 @@ class Item implements \JsonSerializable{ $tag->removeTag(self::TAG_KEEP_ON_DEATH); } - if($this->repairCost){ + if($this->repairCost > 0){ $tag->setInt(self::TAG_REPAIR_COST, $this->repairCost); }else{ $tag->removeTag(self::TAG_REPAIR_COST); diff --git a/src/item/ToolTier.php b/src/item/ToolTier.php index dd8862e73..e0c7f48a3 100644 --- a/src/item/ToolTier.php +++ b/src/item/ToolTier.php @@ -51,6 +51,7 @@ enum ToolTier{ /** * This function exists only to permit the use of named arguments and to make the code easier to read in PhpStorm. + * @param int[] $repairMaterials The typeId of the items that can be used to repair this tool in the anvil. * @phpstan-return TMetadata */ private static function meta(int $harvestLevel, int $maxDurability, int $baseAttackPoints, int $baseEfficiency, int $enchantability, array $repairMaterials = []) : array{ @@ -112,7 +113,7 @@ enum ToolTier{ } /** - * Returns the list of items that can be used to repair this tool. + * Returns the typeId of items that can be used to repair this tool in the anvil. * * @return int[] */