Skip to content

Commit

Permalink
Fix PHPStan
Browse files Browse the repository at this point in the history
  • Loading branch information
dries-c committed Sep 26, 2023
1 parent cf93ab3 commit b011589
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/item/FireworkRocket.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public function onClickAir(Player $player, Vector3 $directionVector, array &$ret
$this->pop();
$player->setMotion($player->getDirectionVector()->multiply(1.8));

return ItemUseResult::SUCCESS();
return ItemUseResult::SUCCESS;
}

return parent::onClickAir($player, $directionVector, $returnedItems);
Expand Down Expand Up @@ -134,7 +134,7 @@ public function onInteractBlock(Player $player, Block $blockReplace, Block $bloc

$this->pop();

return ItemUseResult::SUCCESS();
return ItemUseResult::SUCCESS;
}

protected function deserializeCompoundTag(CompoundTag $tag) : void{
Expand Down
2 changes: 1 addition & 1 deletion src/item/FireworkStar.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class FireworkStar extends Item{
public function __construct(ItemIdentifier $identifier, string $name){
parent::__construct($identifier, $name);

$this->explosion = new FireworkRocketExplosion(FireworkRocketType::SMALL_BALL(), [DyeColor::BLACK()], [], false, false);
$this->explosion = new FireworkRocketExplosion(FireworkRocketType::SMALL_BALL(), [DyeColor::BLACK], [], false, false);
}

public function getExplosion() : FireworkRocketExplosion{
Expand Down
12 changes: 6 additions & 6 deletions src/item/utils/ItemRepairUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ public static function isRepairableWith(Durable $target, Item $sacrifice) : bool
*/
public static function getRepairMaterial(Durable $target) : ?array{
if($target instanceof TieredTool){
return match ($target->getTier()->id()) {
ToolTier::WOOD()->id() => [VanillaBlocks::OAK_PLANKS()->asItem()],
ToolTier::STONE()->id() => [VanillaBlocks::COBBLESTONE()->asItem()],
ToolTier::GOLD()->id() => [VanillaItems::GOLD_INGOT()],
ToolTier::IRON()->id() => [VanillaItems::IRON_INGOT()],
ToolTier::DIAMOND()->id() => [VanillaItems::DIAMOND()],
return match ($target->getTier()) {
ToolTier::WOOD => [VanillaBlocks::OAK_PLANKS()->asItem()],
ToolTier::STONE => [VanillaBlocks::COBBLESTONE()->asItem()],
ToolTier::GOLD => [VanillaItems::GOLD_INGOT()],
ToolTier::IRON => [VanillaItems::IRON_INGOT()],
ToolTier::DIAMOND => [VanillaItems::DIAMOND()],
default => null
// TODO: Netherite tools
};
Expand Down

0 comments on commit b011589

Please sign in to comment.