
NullPointerException when calling `PalettedContainer.Data.writePacket` without context
senseiwells opened this issue ยท 1 comments
This issue is regarding a compatibility issue with ServerReplay.
With ServerReplay it's possible to write packets without a player context (i.e. ChunkRecordings).
Here is a stacktrace relevant to this issue: https://mclo.gs/lNA4M4I
In this snippet the result of PacketContext.get()
is a reference to the MutableContext
thread local instance, which by default returns ContextProvidingPacketListener.EMPTY
on the getPacketListener()
call, not null
, getPacketListener()
is not marked @Nullable
so this check is redundant. This results in PolymerServerNetworking.getMetadata
throwing a NullPointerException
since there's no actual connection context.
I believe this should be replaced with a getBackingPacketListener()
call instead.
Even in the case where there is no context should polymer still not replace the block states, just without the player?