Skip to content

Commit c944a06

Browse files
author
tekgator
committed
Removed ProviderOptions as it had no use and created an unnecessary dependency
1 parent d6032c1 commit c944a06

13 files changed

Lines changed: 26 additions & 53 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
55

6+
## [1.4.2] - 2023-06-03
7+
8+
### Removed
9+
- Removed ProviderOptions as it had no use and created an unnecessary dependency
10+
11+
### Added
12+
- Added MinecraftJarOptions so the optional IHttpClientFactory can be provided
13+
14+
### Fixed
15+
- Removed unnecessary dependency of MinecraftJars.Core causing Nuget installation to fail
16+
17+
618
## [1.4.1] - 2023-06-03
719

820
### Changed

MinecraftJars.Core/Providers/IMinecraftProvider.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ namespace MinecraftJars.Core.Providers;
55

66
public interface IMinecraftProvider
77
{
8-
/// <summary>
9-
/// The options the provider manager has been provided with
10-
/// </summary>
11-
ProviderOptions ProviderOptions { get; }
12-
138
/// <summary>
149
/// Name of the provider e.g. Mojang, PaperMC, etc.
1510
/// </summary>

MinecraftJars.Extension/MinecraftJars.Extension.DependencyInjection/MinecraftJars.Extension.DependencyInjection.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
</ItemGroup>
2525

2626
<ItemGroup>
27-
<ProjectReference Include="..\..\MinecraftJars.Core\MinecraftJars.Core.csproj" />
2827
<ProjectReference Include="..\..\MinecraftJars\MinecraftJars.csproj" />
2928
</ItemGroup>
3029

MinecraftJars.Extension/MinecraftJars.Extension.DependencyInjection/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
using Microsoft.Extensions.DependencyInjection;
2-
using MinecraftJars.Core.Providers;
32

43
namespace MinecraftJars.Extension.DependencyInjection;
54

@@ -8,7 +7,7 @@ public static class ServiceCollectionExtensions
87
public static IServiceCollection AddMinecraftJar(this IServiceCollection services)
98
{
109
services.AddHttpClient();
11-
services.AddScoped<IMinecraftJar, MinecraftJar>(sp => new MinecraftJar(new ProviderOptions
10+
services.AddScoped<IMinecraftJar, MinecraftJar>(sp => new MinecraftJar(new MinecraftJarOptions()
1211
{
1312
HttpClientFactory = sp.GetRequiredService<IHttpClientFactory>()
1413
}));

MinecraftJars.Plugin/MinecraftJars.Plugin.Fabric/FabricProvider.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ namespace MinecraftJars.Plugin.Fabric;
1010
public class FabricProvider : IMinecraftProvider
1111
{
1212
[ImportingConstructor]
13-
public FabricProvider(
14-
PluginHttpClientFactory httpClientFactory,
15-
ProviderOptions? options)
13+
public FabricProvider(PluginHttpClientFactory httpClientFactory)
1614
{
1715
FabricVersionFactory.HttpClientFactory = httpClientFactory;
18-
ProviderOptions = options ?? new ProviderOptions();
1916
}
2017

21-
public ProviderOptions ProviderOptions { get; }
2218
public string Name => "Fabric";
2319
public byte[] Logo => Properties.Resources.Fabric;
2420
public IEnumerable<IMinecraftProject> Projects => FabricProjectFactory.Projects;

MinecraftJars.Plugin/MinecraftJars.Plugin.Mohist/MohistProvider.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ namespace MinecraftJars.Plugin.Mohist;
1010
public class MohistProvider : IMinecraftProvider
1111
{
1212
[ImportingConstructor]
13-
public MohistProvider(
14-
PluginHttpClientFactory httpClientFactory,
15-
ProviderOptions? options)
13+
public MohistProvider(PluginHttpClientFactory httpClientFactory)
1614
{
1715
MohistVersionFactory.HttpClientFactory = httpClientFactory;
18-
ProviderOptions = options ?? new ProviderOptions();
1916
}
2017

21-
public ProviderOptions ProviderOptions { get; }
2218
public string Name => "Mohist";
2319
public byte[] Logo => Properties.Resources.Mohist;
2420
public IEnumerable<IMinecraftProject> Projects => MohistProjectFactory.Projects;

MinecraftJars.Plugin/MinecraftJars.Plugin.Mojang/MojangProvider.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ namespace MinecraftJars.Plugin.Mojang;
1010
public class MojangProvider : IMinecraftProvider
1111
{
1212
[ImportingConstructor]
13-
public MojangProvider(
14-
PluginHttpClientFactory httpClientFactory,
15-
ProviderOptions? options)
13+
public MojangProvider(PluginHttpClientFactory httpClientFactory)
1614
{
1715
MojangVersionFactory.HttpClientFactory = httpClientFactory;
18-
ProviderOptions = options ?? new ProviderOptions();
1916
}
2017

21-
public ProviderOptions ProviderOptions { get; }
2218
public string Name => "Mojang";
2319
public byte[] Logo => Properties.Resources.Mojang;
2420
public IEnumerable<IMinecraftProject> Projects => MojangProjectFactory.Projects;

MinecraftJars.Plugin/MinecraftJars.Plugin.Paper/PaperProvider.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ namespace MinecraftJars.Plugin.Paper;
1010
public class PaperProvider : IMinecraftProvider
1111
{
1212
[ImportingConstructor]
13-
public PaperProvider(
14-
PluginHttpClientFactory httpClientFactory,
15-
ProviderOptions? options)
13+
public PaperProvider(PluginHttpClientFactory httpClientFactory)
1614
{
1715
PaperVersionFactory.HttpClientFactory = httpClientFactory;
18-
ProviderOptions = options ?? new ProviderOptions();
1916
}
2017

21-
public ProviderOptions ProviderOptions { get; }
2218
public string Name => "Paper";
2319
public byte[] Logo => Properties.Resources.Paper;
2420
public IEnumerable<IMinecraftProject> Projects => PaperProjectFactory.Projects;

MinecraftJars.Plugin/MinecraftJars.Plugin.Pocketmine/PocketmineProvider.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ namespace MinecraftJars.Plugin.Pocketmine;
1010
public class PocketmineProvider : IMinecraftProvider
1111
{
1212
[ImportingConstructor]
13-
public PocketmineProvider(
14-
PluginHttpClientFactory httpClientFactory,
15-
ProviderOptions? options)
13+
public PocketmineProvider(PluginHttpClientFactory httpClientFactory)
1614
{
1715
PocketmineVersionFactory.HttpClientFactory = httpClientFactory;
18-
ProviderOptions = options ?? new ProviderOptions();
1916
}
2017

21-
public ProviderOptions ProviderOptions { get; }
2218
public string Name => "Pocketmine";
2319
public byte[] Logo => Properties.Resources.Pocketmine;
2420
public IEnumerable<IMinecraftProject> Projects => PocketmineProjectFactory.Projects;

MinecraftJars.Plugin/MinecraftJars.Plugin.Purpur/PurpurProvider.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,11 @@ namespace MinecraftJars.Plugin.Purpur;
1010
public class PurpurProvider : IMinecraftProvider
1111
{
1212
[ImportingConstructor]
13-
public PurpurProvider(
14-
PluginHttpClientFactory httpClientFactory,
15-
ProviderOptions? options)
13+
public PurpurProvider(PluginHttpClientFactory httpClientFactory)
1614
{
1715
PurpurVersionFactory.HttpClientFactory = httpClientFactory;
18-
ProviderOptions = options ?? new ProviderOptions();
1916
}
2017

21-
public ProviderOptions ProviderOptions { get; }
2218
public string Name => "Purpur";
2319
public byte[] Logo => Properties.Resources.Purpur;
2420
public IEnumerable<IMinecraftProject> Projects => PurpurProjectFactory.Projects;

0 commit comments

Comments
 (0)