Wesley1808 / ServerCore

A mod that aims to optimize the minecraft server.
77 stars 11 forks source link

Crash when holding a map with Impersonate installed #41

Closed Pyrofab closed 2 years ago

Pyrofab commented 2 years ago

Original issue : https://github.com/Ladysnake/Impersonate/issues/26

Game instances with both this mod and Impersonate installed seem to crash when a player has a map in their inventory during impersonation : crash-2022-07-20_21.40.42-server.txt (tested with Impersonate 2.6.1 and ServerCore 1.3.0-1.19).

Steps to reproduce :

  1. Install ServerCore and Impersonate
  2. Start an impersonation with /impersonate disguise as Pyrofab
  3. Get a map

It looks like this crash is caused by MapItemSavedDataMixin assuming that a player's name always consists of a text literal, which is not the case when Impersonate is installed. This could most easily be fixed by adding an instanceof check before the cast.