mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add inventory type convert
This commit is contained in:
parent
e9613ad366
commit
13206614c4
5 changed files with 49 additions and 33 deletions
|
|
@ -26,10 +26,11 @@ namespace MinecraftClient.Inventory
|
|||
Title = title;
|
||||
Items = items;
|
||||
}
|
||||
public Container(int id, Protocol.InventoryType type, string title)
|
||||
public Container(int id, ContainerTypeOld type, string title)
|
||||
{
|
||||
ID = id;
|
||||
Title = title;
|
||||
Type = ConvertType.ToNew(type);
|
||||
}
|
||||
public Container(int id, int typeID, string title)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -31,8 +31,47 @@ namespace MinecraftClient.Inventory
|
|||
Smoker,
|
||||
Cartography,
|
||||
Stonecutter,
|
||||
// not in the list
|
||||
// not in the wiki.vg list
|
||||
PlayerInventory,
|
||||
Unknown
|
||||
}
|
||||
public enum ContainerTypeOld
|
||||
{
|
||||
CONTAINER,
|
||||
CHEST,
|
||||
CRAFTING_TABLE,
|
||||
FURNACE,
|
||||
DISPENSER,
|
||||
ENCHANTING_TABLE,
|
||||
BREWING_STAND,
|
||||
VILLAGER,
|
||||
BEACON,
|
||||
ANVIL,
|
||||
HOPPER,
|
||||
DROPPER,
|
||||
SHULKER_BOX,
|
||||
ENTITYHORSE
|
||||
}
|
||||
public static class ConvertType
|
||||
{
|
||||
public static ContainerType ToNew(ContainerTypeOld type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case ContainerTypeOld.CONTAINER: return ContainerType.Unknown;
|
||||
case ContainerTypeOld.CHEST: return ContainerType.Generic_9x3;
|
||||
case ContainerTypeOld.CRAFTING_TABLE: return ContainerType.Crafting;
|
||||
case ContainerTypeOld.FURNACE: return ContainerType.Furnace;
|
||||
case ContainerTypeOld.DISPENSER: return ContainerType.Generic_3x3;
|
||||
case ContainerTypeOld.ENCHANTING_TABLE: return ContainerType.Enchantment;
|
||||
case ContainerTypeOld.BREWING_STAND: return ContainerType.BrewingStand;
|
||||
case ContainerTypeOld.VILLAGER: return ContainerType.Merchant;
|
||||
case ContainerTypeOld.HOPPER: return ContainerType.Hopper;
|
||||
case ContainerTypeOld.DROPPER: return ContainerType.Generic_3x3;
|
||||
case ContainerTypeOld.SHULKER_BOX: return ContainerType.ShulkerBox;
|
||||
case ContainerTypeOld.ENTITYHORSE: return ContainerType.Unknown;
|
||||
default: return ContainerType.Unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue