Skip to content

Commit 7bfd5c8

Browse files
committed
feat: Don't install mods that are client only (if marked properly)
1 parent 67e8896 commit 7bfd5c8

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

.github/workflows/app-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: Setup dotnet
3535
uses: actions/setup-dotnet@v1
3636
with:
37-
dotnet-version: 6.0.x
37+
dotnet-version: 7.0.x
3838

3939
- name: Build
4040
shell: bash

.github/workflows/dotnet-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Setup dotnet
3939
uses: actions/setup-dotnet@v1
4040
with:
41-
dotnet-version: 6.0.x
41+
dotnet-version: 7.0.x
4242

4343
- name: Restore dependencies
4444
run: dotnet restore

cf-mc-server/Dependencies.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ private static async Task DownloadMinecraftLibraries(ApiClient cfApiClient, stri
7474
foreach (var file in manifest.Files)
7575
{
7676
var mod = await cfApiClient.GetModFileAsync(file.ProjectId, file.FileId);
77+
78+
if (mod.Data.GameVersions.Contains("Client") && !mod.Data.GameVersions.Contains("Server"))
79+
{
80+
AnsiConsole.MarkupLineInterpolated($"[darkorange]The file {mod.Data.DisplayName} is marked as client only, and will not be installed, as it might break the server[/]");
81+
continue;
82+
}
83+
7784
var modDlUrl = mod.Data.DownloadUrl;
7885
if (string.IsNullOrWhiteSpace(modDlUrl))
7986
{

cf-mc-server/cf-mc-server.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net7.0</TargetFramework>
66
<AssemblyName>cf-mc-server</AssemblyName>
77
<PublishSingleFile>true</PublishSingleFile>
88
<PackageLicenseExpression>MIT</PackageLicenseExpression>

0 commit comments

Comments
 (0)