mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add inventory related ChatBot event
Added OnInventoryOpen and OnInventoryClose Updated some method summary
This commit is contained in:
parent
500e7f1bec
commit
f2816c3fee
2 changed files with 31 additions and 10 deletions
|
|
@ -1511,7 +1511,8 @@ namespace MinecraftClient
|
|||
/// <summary>
|
||||
/// When an inventory is opened
|
||||
/// </summary>
|
||||
/// <param name="inventory">Location to reach</param>
|
||||
/// <param name="inventory">The inventory</param>
|
||||
/// <param name="inventoryID">Inventory ID</param>
|
||||
public void OnInventoryOpen(int inventoryID, Container inventory)
|
||||
{
|
||||
inventories[inventoryID] = inventory;
|
||||
|
|
@ -1520,20 +1521,24 @@ namespace MinecraftClient
|
|||
{
|
||||
ConsoleIO.WriteLogLine("Inventory # " + inventoryID + " opened: " + inventory.Title);
|
||||
ConsoleIO.WriteLogLine("Use /inventory to interact with it.");
|
||||
DispatchBotEvent(bot => bot.OnInventoryOpen(inventoryID));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// When an inventory is close
|
||||
/// </summary>
|
||||
/// <param name="inventoryID">Location to reach</param>
|
||||
/// <param name="inventoryID">Inventory ID</param>
|
||||
public void OnInventoryClose(int inventoryID)
|
||||
{
|
||||
if (inventories.ContainsKey(inventoryID))
|
||||
inventories.Remove(inventoryID);
|
||||
|
||||
if (inventoryID != 0)
|
||||
{
|
||||
ConsoleIO.WriteLogLine("Inventory # " + inventoryID + " closed.");
|
||||
DispatchBotEvent(bot => bot.OnInventoryClose(inventoryID));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue