Fix all warnings & Trim (#2226)

* Fix AutoFishing crash
* Fix all warnings
* Remove DotNetZip.
* Fix the usage of HttpClient.
This commit is contained in:
BruceChen 2022-10-02 18:31:08 +08:00 committed by GitHub
parent 4aa6c1c99f
commit 1d52d1eadd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
227 changed files with 2201 additions and 43564 deletions

View file

@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MinecraftClient.Protocol.Handlers.Forge
{
@ -42,9 +40,11 @@ namespace MinecraftClient.Protocol.Handlers.Forge
switch (fmlVersion)
{
case FMLVersion.FML2:
this.Mods = new List<ForgeMod>();
this.Mods.Add(new ForgeMod("forge", "ANY"));
this.Version = fmlVersion;
Mods = new List<ForgeMod>
{
new ForgeMod("forge", "ANY")
};
Version = fmlVersion;
break;
default:
throw new InvalidOperationException(Translations.Get("error.forgeforce"));
@ -58,8 +58,8 @@ namespace MinecraftClient.Protocol.Handlers.Forge
/// <param name="fmlVersion">Forge protocol version</param>
internal ForgeInfo(Json.JSONData data, FMLVersion fmlVersion)
{
this.Mods = new List<ForgeMod>();
this.Version = fmlVersion;
Mods = new List<ForgeMod>();
Version = fmlVersion;
switch (fmlVersion)
{
@ -89,7 +89,7 @@ namespace MinecraftClient.Protocol.Handlers.Forge
String modid = mod.Properties["modid"].StringValue;
String modversion = mod.Properties["version"].StringValue;
this.Mods.Add(new ForgeMod(modid, modversion));
Mods.Add(new ForgeMod(modid, modversion));
}
break;
@ -129,7 +129,7 @@ namespace MinecraftClient.Protocol.Handlers.Forge
String modid = mod.Properties["modId"].StringValue;
String modmarker = mod.Properties["modmarker"].StringValue;
this.Mods.Add(new ForgeMod(modid, modmarker));
Mods.Add(new ForgeMod(modid, modmarker));
}
break;