mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix all warnings & Trim (#2226)
* Fix AutoFishing crash * Fix all warnings * Remove DotNetZip. * Fix the usage of HttpClient.
This commit is contained in:
parent
4aa6c1c99f
commit
1d52d1eadd
227 changed files with 2201 additions and 43564 deletions
|
|
@ -1,7 +1,7 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace MinecraftClient.Mapping.BlockPalettes
|
||||
|
|
@ -42,13 +42,13 @@ namespace MinecraftClient.Mapping.BlockPalettes
|
|||
/// <param name="outputEnum">output path for material.cs</param>
|
||||
/// <remarks>java -cp minecraft_server.jar net.minecraft.data.Main --reports</remarks>
|
||||
/// <returns>state => block name mappings</returns>
|
||||
public static void JsonToClass(string blocksJsonFile, string outputClass, string outputEnum = null)
|
||||
public static void JsonToClass(string blocksJsonFile, string outputClass, string? outputEnum = null)
|
||||
{
|
||||
string outputPalettePath = Path.Combine(Path.GetDirectoryName(blocksJsonFile), outputClass + "XXX.cs");
|
||||
string outputEnumPath = Path.Combine(Path.GetDirectoryName(blocksJsonFile), outputEnum + "XXX.cs");
|
||||
string outputPalettePath = Path.Combine(Path.GetDirectoryName(blocksJsonFile)!, outputClass + "XXX.cs");
|
||||
string outputEnumPath = Path.Combine(Path.GetDirectoryName(blocksJsonFile)!, outputEnum + "XXX.cs");
|
||||
|
||||
HashSet<int> knownStates = new HashSet<int>();
|
||||
Dictionary<string, HashSet<int>> blocks = new Dictionary<string, HashSet<int>>();
|
||||
HashSet<int> knownStates = new();
|
||||
Dictionary<string, HashSet<int>> blocks = new();
|
||||
|
||||
Json.JSONData palette = Json.ParseJson(File.ReadAllText(blocksJsonFile, Encoding.UTF8));
|
||||
foreach (KeyValuePair<string, Json.JSONData> item in palette.Properties)
|
||||
|
|
@ -76,17 +76,16 @@ namespace MinecraftClient.Mapping.BlockPalettes
|
|||
}
|
||||
}
|
||||
|
||||
HashSet<string> materials = new HashSet<string>();
|
||||
List<string> outFile = new List<string>();
|
||||
HashSet<string> materials = new();
|
||||
List<string> outFile = new();
|
||||
outFile.AddRange(new[] {
|
||||
"using System;",
|
||||
"using System.Collections.Generic;",
|
||||
"",
|
||||
"namespace MinecraftClient.Mapping.BlockPalettes",
|
||||
"{",
|
||||
" public class PaletteXXX : BlockPalette",
|
||||
" {",
|
||||
" private static Dictionary<int, Material> materials = new Dictionary<int, Material>();",
|
||||
" private static readonly Dictionary<int, Material> materials = new();",
|
||||
"",
|
||||
" static PaletteXXX()",
|
||||
" {",
|
||||
|
|
@ -103,7 +102,7 @@ namespace MinecraftClient.Mapping.BlockPalettes
|
|||
if (idList.Count > 1)
|
||||
{
|
||||
idList.Sort();
|
||||
Queue<int> idQueue = new Queue<int>(idList);
|
||||
Queue<int> idQueue = new(idList);
|
||||
|
||||
while (idQueue.Count > 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue