Clear inventory on respawn (#1022, #1069)

Fix null PlayerInventory
Fix issue #1022
This commit is contained in:
Рома Данилов 2020-06-14 21:53:11 +05:00 committed by GitHub
parent c79c22bcdf
commit eddf7ad063
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -546,6 +546,12 @@ namespace MinecraftClient
/// </summary>
public void OnRespawn()
{
if (inventoryHandlingEnabled)
{
inventories.Clear();
inventories[0] = new Container(0, ContainerType.PlayerInventory, "Player Inventory");
}
if (terrainAndMovementsRequested)
{
terrainAndMovementsEnabled = true;