Skip to content

Commit d8680d9

Browse files
authored
Merge pull request #15 from aternosorg/add-neo-forge-update-filter
Add optional filter for NeoForgeUpdate to `ModrinthAPIClient->getForgeUpdates()`
2 parents a23bdbe + d98d5a7 commit d8680d9

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

lib/Client/ModrinthAPIClient.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,12 +627,13 @@ public function getStatistics(): Statistics
627627
/**
628628
* Get the forge update data for a mod
629629
* @param string $idOrSlug
630+
* @param NeoForgeUpdate|null $neoForgeFilter
630631
* @return ForgeUpdates|InvalidInputError
631632
* @throws ApiException
632633
*/
633-
public function getForgeUpdates(string $idOrSlug): ForgeUpdates|InvalidInputError
634+
public function getForgeUpdates(string $idOrSlug, ?NeoForgeUpdate $neoForgeFilter = null): ForgeUpdates|InvalidInputError
634635
{
635-
return $this->misc->forgeUpdates($idOrSlug);
636+
return $this->misc->forgeUpdates($idOrSlug, $neoForgeFilter?->value);
636637
}
637638

638639
/**

lib/Client/NeoForgeUpdate.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Aternos\ModrinthApi\Client;
4+
5+
enum NeoForgeUpdate: string
6+
{
7+
/**
8+
* NeoForge-only versions
9+
*/
10+
case ONLY = "only";
11+
12+
/**
13+
* both Forge and NeoForge versions
14+
*/
15+
case INCLUDE = "include";
16+
17+
/**
18+
* Forge-only versions
19+
*/
20+
case OMITTED = "omitted";
21+
}

0 commit comments

Comments
 (0)