fix PHPstan

This commit is contained in:
ShockedPlot7560 2024-08-10 19:10:10 +02:00
parent e4f979dadf
commit 44c3e03598
No known key found for this signature in database
GPG Key ID: D7539B420F1FA86E
3 changed files with 5 additions and 2 deletions

View File

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

View File

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

View File

@ -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[]
*/