Implement inventory handling for MC 1.16+

Item ID got changed in 1.16+ so a palette is needed.
This commit is contained in:
ReinforceZwei 2020-08-17 17:28:14 +08:00
parent 68a9a5b064
commit 4d7cab2b25
10 changed files with 3972 additions and 897 deletions

View file

@ -0,0 +1,28 @@
using MinecraftClient.Protocol;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MinecraftClient.Inventory.ItemPalettes
{
public static class ItemPaletteGenerator
{
/// <summary>
/// Place below line to Program.cs
/// Inventory.ItemPalettes.ItemPaletteGenerator.GenerateItemType(@"your\path\to\registries.json");
/// See https://wiki.vg/Data_Generators for getting those .json
/// </summary>
/// <param name="registriesJsonFile"></param>
public static void GenerateItemType(string registriesJsonFile)
{
DataTypeGenerator.GenerateEnumWithPalette(
registriesJsonFile,
"minecraft:item",
"ItemType",
"MinecraftClient.Inventory",
"ItemPalette",
"MinecraftClient.Inventory.ItemPalettes");
}
}
}