mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix player inventory being deleted by server (#1430)
* Fix auto drop crash * Fix player inventory being deleted by server
This commit is contained in:
parent
f5f1a22b93
commit
d19764869c
3 changed files with 14 additions and 2 deletions
|
|
@ -1757,8 +1757,13 @@ namespace MinecraftClient
|
|||
public void OnInventoryClose(int inventoryID)
|
||||
{
|
||||
if (inventories.ContainsKey(inventoryID))
|
||||
inventories.Remove(inventoryID);
|
||||
|
||||
{
|
||||
if (inventoryID == 0)
|
||||
inventories[0].Items.Clear(); // Don't delete player inventory
|
||||
else
|
||||
inventories.Remove(inventoryID);
|
||||
}
|
||||
|
||||
if (inventoryID != 0)
|
||||
{
|
||||
Log.Info(Translations.Get("extra.inventory_close", inventoryID));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue