gkazan / ZAWA

The Zoo & Wild Animals Mod
10 stars 3 forks source link

[Bug] MessagePlayAnimation tries to use player entity before it's defined, preventing to load single player world #154

Open LemADEC opened 4 years ago

LemADEC commented 4 years ago

Describe the bug Opening an existing single player world, screen got stuck while displaying "0%". When checking logs we can see an MessagePlayAnimation packet was received while client was still connecting. When checking the code, we can see CommonProxy.getPlayer() returns a nullable but the message handler is missing a null check.

To Reproduce Steps to reproduce the behavior. (What were you doing when this happened) :

  1. Create creative world, move to a beach next to an ocean, no specific ZAWA mobs in sight.
  2. close game
  3. Start game
  4. Loading existing single player world. Issue is intermittent, only seen once so far.

Expected behavior World actually loading.

Screenshots Not applicable

Crash Report or Game Log https://gist.github.com/LemADEC/1c8d41d403c83c4c2447e01b4d5a99ac See line 16735 where the crash occurs. See line 17866 where advancements are finally loaded. See line 17887 when client configuration is synced.

Please complete the following information):

Additional context Issue was only seen once but code review shows it's prone to happen again.