mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Implement inventory handling for MC 1.16+
Item ID got changed in 1.16+ so a palette is needed.
This commit is contained in:
parent
68a9a5b064
commit
4d7cab2b25
10 changed files with 3972 additions and 897 deletions
|
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue