mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Implemented basic player inventory items handle
This commit is contained in:
parent
51d03b9ced
commit
8b8f3a719b
3 changed files with 44 additions and 1 deletions
|
|
@ -57,6 +57,9 @@ namespace MinecraftClient
|
|||
private object lastKeepAliveLock = new object();
|
||||
|
||||
private int playerEntityID;
|
||||
// not really understand the Inventory Class
|
||||
// so I use a Dict instead for player inventory
|
||||
private Dictionary<int, Item> playerItems;
|
||||
|
||||
// auto attack
|
||||
private class Entity
|
||||
|
|
@ -763,6 +766,23 @@ namespace MinecraftClient
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When received window items from server.
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
/// <param name="itemList"></param>
|
||||
public void OnWindowItems(int type, Dictionary<int, Item> itemList)
|
||||
{
|
||||
// player inventory
|
||||
//if (type == 0)
|
||||
// playerItems = itemList;
|
||||
foreach(KeyValuePair<int,Item> pair in itemList)
|
||||
{
|
||||
ConsoleIO.WriteLine("Slot: "+pair.Key+" itemID:"+pair.Value.id);
|
||||
}
|
||||
ConsoleIO.WriteLine("Type: "+type);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When connection has been lost, login was denied or played was kicked from the server
|
||||
/// </summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue