Calling hasPlayerInfo() on an instance of AbstractClientPlayer (specifically in RenderPlayerEvent.Pre in this case) and receiving a return value of true still leads to a NPE on accessing the playerInfo field.
Expected Behavior:
When calling hasPlayerInfo() on an instance of AbstractClientPlayer, a return value of true should mean that accessing the playerInfo field of that Object should not be null.
Steps to Reproduce:
This requires some other mod since this breaks an invariant of the AbstractClientPlayer class that is expected to be true. This can be observed with any currently released version of GregTech CE Unofficial (v2.1.4 or earlier, as we have worked around it in subsequent releases).
In c4.conarm.client.gui.PreviewPlayer, an override of hasPlayerInfo() should be sufficient to address this issue. Unfortunately since getPlayerInfo() is protected, there is no way for us to call that instead of directly accessing the field. As a workaround, we have resulted in null-checking the playerInfo field, but this issue could cause issues with other mods who have not done this fix.
Versions (Be specific, do not write "latest"):
Observed Behavior:
Calling
hasPlayerInfo()
on an instance ofAbstractClientPlayer
(specifically inRenderPlayerEvent.Pre
in this case) and receiving a return value oftrue
still leads to a NPE on accessing theplayerInfo
field.Expected Behavior:
When calling
hasPlayerInfo()
on an instance ofAbstractClientPlayer
, a return value oftrue
should mean that accessing theplayerInfo
field of that Object should not be null.Steps to Reproduce:
This requires some other mod since this breaks an invariant of the
AbstractClientPlayer
class that is expected to be true. This can be observed with any currently released version of GregTech CE Unofficial (v2.1.4 or earlier, as we have worked around it in subsequent releases).In
c4.conarm.client.gui.PreviewPlayer
, an override ofhasPlayerInfo()
should be sufficient to address this issue. Unfortunately sincegetPlayerInfo()
is protected, there is no way for us to call that instead of directly accessing the field. As a workaround, we have resulted in null-checking theplayerInfo
field, but this issue could cause issues with other mods who have not done this fix.Crash Log: https://pastebin.com/dAbNcjcd
Issue from our end: https://github.com/GregTechCEu/GregTech/issues/615